Giter VIP home page Giter VIP logo

starlink-pyast's Introduction

PyAST is a Python extension that provides an interface to the Starlink
AST library. It requires Python v2.7 or later. It can be obtained from
http://pypi.python.org/pypi/starlink-pyast/. To install, do:

python setup.py install

or

python setup.py install --prefix=<installation directory>

To test it, do:

python starlink/ast/test/test.py

User docs are available at http://starlink.github.io/starlink-pyast/pyast.html



Licence:
   This program 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.

   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 Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General
   License along with this program.  If not, see
   <http://www.gnu.org/licenses/>.


starlink-pyast's People

Contributors

demitri avatar dsberry avatar keflavich avatar parejkoj avatar sfgraves avatar timj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

starlink-pyast's Issues

norm() cannot be run on the output of tran()

It would be very good to be able to run norm() (or equivalent) on the output of tran(). For example, either:

frameset.tran(pixels).norm()

or

frameset.norm(frameset.tran(pixels))

tran() should support ND array input/output

If I want to output the transformed locations of e.g. a whole CCD, something like this is the obvious approach:

xx = np.arange(0,nx)
yy = np.arange(0,ny)
xv,yv = np.meshgrid(xx,yy)
result = frameset.tran((xv,yv))

but this doesn't work, as tran wants flattened arrays, but then the output has to be reshaped:

result = frameset.tran((xv.flatten(),yv.flatten())
result_ast = (result_ast[0].reshape(ny,nx),result_ast[1].reshape(ny,nx))

It would be useful if tran supported generic NDarrays, outputting the result in the same shape.

Deprecation warnings with latest astropy version

After upgrading to the latest astropy version (0.4.2), I started getting DeprecationWarnings from my code that uses starlink.Ast.

In particular, the line fc = starlink.Ast.FitsChan( starlink.Atl.PyFITSAdapter(hdu) ). (The hdu is an astropy.io.fits hdu.)

The code still works correctly, but it emits:

WARNING: AstropyDeprecationWarning: The ascard function is deprecated and may be removed in a future version.
        Use the `.cards` attribute instead. [astropy.utils.misc]
WARNING: AstropyDeprecationWarning: The CardList class has been deprecated; all its former functionality has been subsumed by the Header class, so CardList objects should not be directly created.  See the PyFITS 3.1.0 CHANGELOG for more details. [astropy.io.fits.card]
WARNING: AstropyDeprecationWarning: The ascard function is deprecated and may be removed in a future version.
        Use the `.cards` attribute instead. [astropy.utils.misc]
WARNING: AstropyDeprecationWarning: The ascardimage function is deprecated and may be removed in a future version.
        Use the `.image` attribute instead. [astropy.utils.misc]

In GalSim, we similarly try to support both pyfits and astropy.io.fits as our fits front end, so the changes in syntax over the various versions have been a bit of a pain. We guard most of our "pyfits" usage with if statements that check which version we are using. I think it shouldn't be too hard to do a similar thing here to avoid these warnings and use the more recent recommended syntax when "pyfits" is really astropy.io.fits.

Thanks.

Error pip installing 3.13.1

I'm getting an error installing pyast version 3.13.1:

$ pip install -U starlink-pyast
Collecting starlink-pyast
  Downloading https://files.pythonhosted.org/packages/e2/ff/7354165c9fde015d887381aba11ead0f66b64c30bb38b0aac5d501480fea/starlink-pyast-3.13.1.tar.gz (8.7MB)
     |████████████████████████████████| 8.7MB 4.3MB/s 
Building wheels for collected packages: starlink-pyast
  Building wheel for starlink-pyast (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /anaconda3/envs/py3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/h8/0h3_h20d4jdg8pk8fzwxmr380000gn/T/pip-install-31az_f5w/starlink-pyast/setup.py'"'"'; __file__='"'"'/private/var/folders/h8/0h3_h20d4jdg8pk8fzwxmr380000gn/T/pip-install-31az_f5w/starlink-pyast/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/h8/0h3_h20d4jdg8pk8fzwxmr380000gn/T/pip-wheel-bubju5jk --python-tag cp36
       cwd: /private/var/folders/h8/0h3_h20d4jdg8pk8fzwxmr380000gn/T/pip-install-31az_f5w/starlink-pyast/
  Complete output (35 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.7-x86_64-3.6
  creating build/lib.macosx-10.7-x86_64-3.6/starlink
  copying starlink/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/starlink
  copying starlink/Grf.py -> build/lib.macosx-10.7-x86_64-3.6/starlink
  copying starlink/Atl.py -> build/lib.macosx-10.7-x86_64-3.6/starlink
  creating build/lib.macosx-10.7-x86_64-3.6/starlink/include
  creating build/lib.macosx-10.7-x86_64-3.6/starlink/include/star
  copying starlink/include/star/pyast.h -> build/lib.macosx-10.7-x86_64-3.6/starlink/include/star
  running build_ext
  building 'starlink.Ast' extension
  creating build/temp.macosx-10.7-x86_64-3.6
  creating build/temp.macosx-10.7-x86_64-3.6/starlink
  creating build/temp.macosx-10.7-x86_64-3.6/starlink/ast
  creating build/temp.macosx-10.7-x86_64-3.6/ast
  creating build/temp.macosx-10.7-x86_64-3.6/ast/src
  creating build/temp.macosx-10.7-x86_64-3.6/ast/wcslib
  creating build/temp.macosx-10.7-x86_64-3.6/ast/cminpack
  creating build/temp.macosx-10.7-x86_64-3.6/ast/erfa
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/envs/py3/include -arch x86_64 -I/anaconda3/envs/py3/include -arch x86_64 -DHAVE_STRTOK_R=1 -DHAVE_STRERROR_R=1 -DHAVE_DECL_ISFINITE=1 -DSIZEOF_LONG=8 -DSIZEOF_LONG_LONG=8 -DHAVE_DECL_ISNAN=1 -I/anaconda3/envs/py3/lib/python3.6/site-packages/numpy/core/include -I./starlink/include -I./ast -I./ast/src -I/anaconda3/envs/py3/include/python3.6m -c starlink/ast/Ast.c -o build/temp.macosx-10.7-x86_64-3.6/starlink/ast/Ast.o
  In file included from /anaconda3/envs/py3/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830:0,
                   from /anaconda3/envs/py3/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                   from /anaconda3/envs/py3/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                   from starlink/ast/Ast.c:3:
  /anaconda3/envs/py3/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
   #warning "Using deprecated NumPy API, disable it with " \
    ^
  starlink/ast/Ast.c:6:21: fatal error: src/grf.h: No such file or directory
   #include "src/grf.h"
                       ^
  compilation terminated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for starlink-pyast
  Running setup.py clean for starlink-pyast
Failed to build starlink-pyast
Installing collected packages: starlink-pyast
  Found existing installation: starlink-pyast 3.10.0
    Uninstalling starlink-pyast-3.10.0:
      Successfully uninstalled starlink-pyast-3.10.0
  Running setup.py install for starlink-pyast ... error
    ERROR: Command errored out with exit status 1:
     command: /anaconda3/envs/py3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/h8/0h3_h20d4jdg8pk8fzwxmr380000gn/T/pip-install-31az_f5w/starlink-pyast/setup.py'"'"'; __file__='"'"'/private/var/folders/h8/0h3_h20d4jdg8pk8fzwxmr380000gn/T/pip-install-31az_f5w/starlink-pyast/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/h8/0h3_h20d4jdg8pk8fzwxmr380000gn/T/pip-record-d761q4ev/install-record.txt --single-version-externally-managed --compile
         cwd: /private/var/folders/h8/0h3_h20d4jdg8pk8fzwxmr380000gn/T/pip-install-31az_f5w/starlink-pyast/
    Complete output (35 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.7-x86_64-3.6
    creating build/lib.macosx-10.7-x86_64-3.6/starlink
    copying starlink/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/starlink
    copying starlink/Grf.py -> build/lib.macosx-10.7-x86_64-3.6/starlink
    copying starlink/Atl.py -> build/lib.macosx-10.7-x86_64-3.6/starlink
    creating build/lib.macosx-10.7-x86_64-3.6/starlink/include
    creating build/lib.macosx-10.7-x86_64-3.6/starlink/include/star
    copying starlink/include/star/pyast.h -> build/lib.macosx-10.7-x86_64-3.6/starlink/include/star
    running build_ext
    building 'starlink.Ast' extension
    creating build/temp.macosx-10.7-x86_64-3.6
    creating build/temp.macosx-10.7-x86_64-3.6/starlink
    creating build/temp.macosx-10.7-x86_64-3.6/starlink/ast
    creating build/temp.macosx-10.7-x86_64-3.6/ast
    creating build/temp.macosx-10.7-x86_64-3.6/ast/src
    creating build/temp.macosx-10.7-x86_64-3.6/ast/wcslib
    creating build/temp.macosx-10.7-x86_64-3.6/ast/cminpack
    creating build/temp.macosx-10.7-x86_64-3.6/ast/erfa
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/envs/py3/include -arch x86_64 -I/anaconda3/envs/py3/include -arch x86_64 -DHAVE_STRTOK_R=1 -DHAVE_STRERROR_R=1 -DHAVE_DECL_ISFINITE=1 -DSIZEOF_LONG=8 -DSIZEOF_LONG_LONG=8 -DHAVE_DECL_ISNAN=1 -I/anaconda3/envs/py3/lib/python3.6/site-packages/numpy/core/include -I./starlink/include -I./ast -I./ast/src -I/anaconda3/envs/py3/include/python3.6m -c starlink/ast/Ast.c -o build/temp.macosx-10.7-x86_64-3.6/starlink/ast/Ast.o
    In file included from /anaconda3/envs/py3/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830:0,
                     from /anaconda3/envs/py3/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                     from /anaconda3/envs/py3/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                     from starlink/ast/Ast.c:3:
    /anaconda3/envs/py3/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
     #warning "Using deprecated NumPy API, disable it with " \
      ^
    starlink/ast/Ast.c:6:21: fatal error: src/grf.h: No such file or directory
     #include "src/grf.h"
                         ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
  Rolling back uninstall of starlink-pyast
  Moving to /anaconda3/envs/py3/lib/python3.6/site-packages/starlink/
   from /anaconda3/envs/py3/lib/python3.6/site-packages/~tarlink
  Moving to /anaconda3/envs/py3/lib/python3.6/site-packages/starlink_pyast-3.10.0.dist-info/
   from /anaconda3/envs/py3/lib/python3.6/site-packages/~tarlink_pyast-3.10.0.dist-info
ERROR: Command errored out with exit status 1: /anaconda3/envs/py3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/h8/0h3_h20d4jdg8pk8fzwxmr380000gn/T/pip-install-31az_f5w/starlink-pyast/setup.py'"'"'; __file__='"'"'/private/var/folders/h8/0h3_h20d4jdg8pk8fzwxmr380000gn/T/pip-install-31az_f5w/starlink-pyast/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/h8/0h3_h20d4jdg8pk8fzwxmr380000gn/T/pip-record-d761q4ev/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

Version 3.12 works fine:

$ pip install starlink-pyast==3.12
Collecting starlink-pyast==3.12
  Downloading https://files.pythonhosted.org/packages/61/7f/1ed7c5e30f848f284e5320670cf7b7a71b665ac8270fb9b65f3e823436d9/starlink-pyast-3.12.0.tar.gz (9.9MB)
     |████████████████████████████████| 9.9MB 3.9MB/s 
Building wheels for collected packages: starlink-pyast
  Building wheel for starlink-pyast (setup.py) ... done
  Created wheel for starlink-pyast: filename=starlink_pyast-3.12.0-cp36-cp36m-macosx_10_7_x86_64.whl size=2979793 sha256=bd0ce494c1980db6cb4929baef9e92e742bd10d923dfc99e8cb5a1a9f378ed13
  Stored in directory: /Users/Mike/Library/Caches/pip/wheels/cf/3d/0a/32ef9a22fc328b81fce1dd312f691b0ff64a6de6ced121017b
Successfully built starlink-pyast
Installing collected packages: starlink-pyast
  Found existing installation: starlink-pyast 3.10.0
    Uninstalling starlink-pyast-3.10.0:
      Successfully uninstalled starlink-pyast-3.10.0
Successfully installed starlink-pyast-3.12.0

Error when using astropy in lieu of pyfits

The latest version of starlink has a bug in the FitsChan implementation when used in conjunction with astropy.io.fits (imported as pyfits):

$ pip show starlink-pyast

---
Name: starlink-pyast
Version: 3.3
Location: /Library/Python/2.7/site-packages
Requires: 
$ python
Python 2.7.5 (default, Mar  9 2014, 22:15:05) 
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyfits
>>> pyfits.__version__
'3.0.13'
>>> hdu = pyfits.open('1904-66_TAN.fits')[0]
>>> import starlink.Ast as Ast
>>> import starlink.Atl as Atl
>>> fc = Ast.FitsChan(Atl.PyFITSAdapter(hdu))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/starlink/Atl.py", line 106, in __init__
    self.pyfits_3_1_0 = ( LooseVersion(pyfits.__version__) >=
AttributeError: 'module' object has no attribute '__version__'
>>> import astropy
>>> astropy.__version__
u'1.0.1'
>>> 

So, since I have astropy as well as pyfits, starlink does import astropy.io.fits as pyfits (which is fine with me -- it's what we do in GalSim too). But astropy.io.fits doesn't have a __version__ attribute. In GalSim, we get around this problem with the following code:

try:
    import astropy.io.fits as pyfits
    # astropy started their versioning over at 0.  (Understandably.)
    # To make this seamless with pyfits versions, we add 4 to the astropy version.
    from astropy import version as astropy_version
    pyfits_version = str( (4 + astropy_version.major) + astropy_version.minor/10.)
    pyfits_str = 'astropy.io.fits'
except:
    import pyfits
    pyfits_version = pyfits.__version__
    pyfits_str = 'pyfits'

Then we just use pyfits_version whenever we want to conditionally do different actions depending on the "pyfits" version. You might want to do something similar here.

For cross-reference, this issue was originally posted by a GalSim user @beckermr here.

compilation fails on Fedora 21

$ python --version
Python 2.7.8
$ gcc --version
gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6)
Copyright (C) 2014 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.
$ pip install starlink-pyast
Downloading/unpacking starlink-pyast
  Downloading starlink-pyast-3.3.tar.gz (6.3MB): 6.3MB downloaded
  Running setup.py (path:/tmp/pip-build-ZeyrSl/starlink-pyast/setup.py) egg_info for package starlink-pyast

Installing collected packages: starlink-pyast
  Running setup.py install for starlink-pyast
    building 'starlink.Ast' extension
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_STRTOK_R=1 -DHAVE_STRERROR_R=1 -DHAVE_DECL_ISFINITE=1 -DSIZEOF_LONG=8 -DSIZEOF_LONG_LONG=8 -DHAVE_DECL_ISNAN=1 -I/usr/lib64/python2.7/site-packages/numpy/core/include -I./starlink/include -I./ast -I/usr/include/python2.7 -c starlink/ast/Ast.c -o build/temp.linux-x86_64-2.7/starlink/ast/Ast.o
    In file included from /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1761:0,
                     from /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
                     from /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                     from starlink/ast/Ast.c:3:
    /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
     #warning "Using deprecated NumPy API, disable it by " \
      ^
    In file included from starlink/ast/Ast.c:54:0:
    starlink/ast/exceptions.c: In function ‘astPutErr_’:
    starlink/ast/exceptions.c:710:13: error: format not a string literal and no format arguments [-Werror=format-security]
                 text = astAppendString( text, &nc, message );
                 ^
    starlink/ast/Ast.c: In function ‘Object_repr’:
    starlink/ast/Ast.c:367:7: error: format not a string literal and no format arguments [-Werror=format-security]
           p2 = astAppendString( p2, &nc, p1 );
           ^
    starlink/ast/Ast.c: In function ‘Object_set’:
    starlink/ast/Ast.c:487:7: error: format not a string literal and no format arguments [-Werror=format-security]
           astSet( THIS, settings );
           ^
    starlink/ast/Ast.c: In function ‘Mapping_rebinseq’:
    starlink/ast/Ast.c:1300:728: warning: passing argument 22 of ‘astRebinSeqD_’ from incompatible pointer type
                 astRebinSeqD( THIS, wlim, ncoord_in, (const int *)lbnd_in->data,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ^
    In file included from starlink/ast/Ast.c:4:0:
    ./ast/ast.h:850:252: note: expected ‘int64_t *’ but argument is of type ‘int *’
     PROTO_GENERIC_DFI(D,double)
                                                                                                                                                                                                                                                                ^
    starlink/ast/Ast.c:1312:724: warning: passing argument 22 of ‘astRebinSeqF_’ from incompatible pointer type
                 astRebinSeqF( THIS, wlim, ncoord_in, (const int *)lbnd_in->data,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ^
    In file included from starlink/ast/Ast.c:4:0:
    ./ast/ast.h:851:247: note: expected ‘int64_t *’ but argument is of type ‘int *’
     PROTO_GENERIC_DFI(F,float)
                                                                                                                                                                                                                                                           ^
    starlink/ast/Ast.c:1323:716: warning: passing argument 22 of ‘astRebinSeqI_’ from incompatible pointer type
                 astRebinSeqI( THIS, wlim, ncoord_in, (const int *)lbnd_in->data,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ^
    In file included from starlink/ast/Ast.c:4:0:
    ./ast/ast.h:852:237: note: expected ‘int64_t *’ but argument is of type ‘int *’
     PROTO_GENERIC_DFI(I,int)
                                                                                                                                                                                                                                                 ^
    starlink/ast/Ast.c: In function ‘ZoomMap_init’:
    starlink/ast/Ast.c:1934:7: error: format not a string literal and no format arguments [-Werror=format-security]
           AstZoomMap *this = astZoomMap( ncoord, zoom, options );
           ^
    starlink/ast/Ast.c: In function ‘MathMap_init’:
    starlink/ast/Ast.c:2092:41: error: format not a string literal and no format arguments [-Werror=format-security]
                                             options );
                                             ^
    starlink/ast/Ast.c: In function ‘SphMap_init’:
    starlink/ast/Ast.c:2181:7: error: format not a string literal and no format arguments [-Werror=format-security]
           AstSphMap *this = astSphMap( options );
           ^
    starlink/ast/Ast.c: In function ‘GrismMap_init’:
    starlink/ast/Ast.c:2279:7: error: format not a string literal and no format arguments [-Werror=format-security]
           AstGrismMap *this = astGrismMap( options );
           ^
    starlink/ast/Ast.c: In function ‘PcdMap_init’:
    starlink/ast/Ast.c:2372:2: error: format not a string literal and no format arguments [-Werror=format-security]
      this = astPcdMap( disco, (const double *)pcdcen->data, options );
      ^
    starlink/ast/Ast.c: In function ‘WcsMap_init’:
    starlink/ast/Ast.c:2475:7: error: format not a string literal and no format arguments [-Werror=format-security]
           this = astWcsMap( ncoord, type, lonax, latax, options );
           ^
    starlink/ast/Ast.c: In function ‘UnitMap_init’:
    starlink/ast/Ast.c:2552:7: error: format not a string literal and no format arguments [-Werror=format-security]
           AstUnitMap *this = astUnitMap( ncoord, options );
           ^
    starlink/ast/Ast.c: In function ‘TimeMap_init’:
    starlink/ast/Ast.c:2639:10: error: format not a string literal and no format arguments [-Werror=format-security]
              AstTimeMap *this = astTimeMap( flags, options );
              ^
    starlink/ast/Ast.c: In function ‘RateMap_init’:
    starlink/ast/Ast.c:2753:7: error: format not a string literal and no format arguments [-Werror=format-security]
           AstRateMap *this = astRateMap( THAT, ax1, ax2, options );
           ^
    starlink/ast/Ast.c: In function ‘CmpMap_init’:
    starlink/ast/Ast.c:2833:7: error: format not a string literal and no format arguments [-Werror=format-security]
           AstCmpMap *this = astCmpMap( THAT, ANOTHER, series, options );
           ^
    starlink/ast/Ast.c: In function ‘TranMap_init’:
    starlink/ast/Ast.c:2912:7: error: format not a string literal and no format arguments [-Werror=format-security]
           AstTranMap *this = astTranMap( THAT, ANOTHER, options );
           ^
    starlink/ast/Ast.c: In function ‘PermMap_init’:
    starlink/ast/Ast.c:3016:29: error: format not a string literal and no format arguments [-Werror=format-security]
                                 options);
                                 ^
    starlink/ast/Ast.c: In function ‘ShiftMap_init’:
    starlink/ast/Ast.c:3107:29: error: format not a string literal and no format arguments [-Werror=format-security]
                                 options);
                                 ^
    starlink/ast/Ast.c: In function ‘LutMap_init’:
    starlink/ast/Ast.c:3198:28: error: format not a string literal and no format arguments [-Werror=format-security]
                                start, inc, options);
                                ^
    starlink/ast/Ast.c: In function ‘WinMap_init’:
    starlink/ast/Ast.c:3307:30: error: format not a string literal and no format arguments [-Werror=format-security]
                                  options);
                                  ^
    starlink/ast/Ast.c: In function ‘getActiveUnit’:
    starlink/ast/Ast.c:3407:130: warning: unused variable ‘att_buf’ [-Wunused-variable]
     MAKE_GET( Frame, ActiveUnit,
                                                                                                                                      ^
    starlink/ast/Ast.c: In function ‘Frame_init’:
    starlink/ast/Ast.c:3494:7: error: format not a string literal and no format arguments [-Werror=format-security]
           AstFrame *this = astFrame( naxes, options );
           ^
    starlink/ast/Ast.c: In function ‘MatrixMap_init’:
    starlink/ast/Ast.c:4146:34: error: format not a string literal and no format arguments [-Werror=format-security]
                                      1, (const double *) matrix->data, options );
                                      ^
    starlink/ast/Ast.c:4149:34: error: format not a string literal and no format arguments [-Werror=format-security]
                                      0, (const double *) matrix->data, options );
                                      ^
    starlink/ast/Ast.c: In function ‘PolyMap_init’:
    starlink/ast/Ast.c:4329:41: error: format not a string literal and no format arguments [-Werror=format-security]
                                             options );
                                             ^
    starlink/ast/Ast.c: In function ‘NormMap_init’:
    starlink/ast/Ast.c:4460:7: error: format not a string literal and no format arguments [-Werror=format-security]
           AstNormMap *this = astNormMap( THAT, options );
           ^
    starlink/ast/Ast.c: In function ‘FrameSet_init’:
    starlink/ast/Ast.c:4565:7: error: format not a string literal and no format arguments [-Werror=format-security]
           AstFrameSet *this = astFrameSet( THAT, options );
           ^
    starlink/ast/Ast.c: In function ‘CmpFrame_init’:
    starlink/ast/Ast.c:4767:7: error: format not a string literal and no format arguments [-Werror=format-security]
           AstCmpFrame *this = astCmpFrame( THAT, ANOTHER, options );
           ^
    starlink/ast/Ast.c: In function ‘SkyFrame_init’:
    starlink/ast/Ast.c:4880:7: error: format not a string literal and no format arguments [-Werror=format-security]
           AstSkyFrame *this = astSkyFrame( options );
           ^
    starlink/ast/Ast.c: In function ‘SpecFrame_init’:
    starlink/ast/Ast.c:5017:7: error: format not a string literal and no format arguments [-Werror=format-security]
           AstSpecFrame *this = astSpecFrame( options );
           ^
    starlink/ast/Ast.c: In function ‘DSBSpecFrame_init’:
    starlink/ast/Ast.c:5156:7: error: format not a string literal and no format arguments [-Werror=format-security]
           AstDSBSpecFrame *this = astDSBSpecFrame( options );
           ^
    starlink/ast/Ast.c: In function ‘TimeFrame_init’:
    starlink/ast/Ast.c:5253:7: error: format not a string literal and no format arguments [-Werror=format-security]
           AstTimeFrame *this = astTimeFrame( options );
           ^
    starlink/ast/Ast.c: In function ‘FluxFrame_init’:
    starlink/ast/Ast.c:5359:7: error: format not a string literal and no format arguments [-Werror=format-security]
           AstFluxFrame *this = astFluxFrame( specval, THAT, options );
           ^
    starlink/ast/Ast.c: In function ‘SpecFluxFrame_init’:
    starlink/ast/Ast.c:5439:7: error: format not a string literal and no format arguments [-Werror=format-security]
           AstSpecFluxFrame *this = astSpecFluxFrame( THAT, ANOTHER, options );
           ^
    starlink/ast/Ast.c: In function ‘Box_init’:
    starlink/ast/Ast.c:5718:22: error: format not a string literal and no format arguments [-Werror=format-security]
                          (const double*)point2->data, unc, options );
                          ^
    starlink/ast/Ast.c: In function ‘Circle_init’:
    starlink/ast/Ast.c:5814:27: error: format not a string literal and no format arguments [-Werror=format-security]
                               (const double*)point->data, unc, options );
                               ^
    starlink/ast/Ast.c: In function ‘Polygon_init’:
    starlink/ast/Ast.c:5917:41: error: format not a string literal and no format arguments [-Werror=format-security]
                                             options );
                                             ^
    starlink/ast/Ast.c: In function ‘PointList_init’:
    starlink/ast/Ast.c:6049:41: error: format not a string literal and no format arguments [-Werror=format-security]
                                             options );
                                             ^
    starlink/ast/Ast.c: In function ‘Ellipse_init’:
    starlink/ast/Ast.c:6151:7: error: format not a string literal and no format arguments [-Werror=format-security]
           unc, options );
           ^
    starlink/ast/Ast.c: In function ‘Interval_init’:
    starlink/ast/Ast.c:6246:27: error: format not a string literal and no format arguments [-Werror=format-security]
                               (const double*)ubnd->data, unc, options );
                               ^
    starlink/ast/Ast.c: In function ‘NullRegion_init’:
    starlink/ast/Ast.c:6330:7: error: format not a string literal and no format arguments [-Werror=format-security]
           this = astNullRegion( THAT, unc, options );
           ^
    starlink/ast/Ast.c: In function ‘CmpRegion_init’:
    starlink/ast/Ast.c:6410:7: error: format not a string literal and no format arguments [-Werror=format-security]
           AstCmpRegion *this = astCmpRegion( THAT, ANOTHER, oper, options );
           ^
    starlink/ast/Ast.c: In function ‘Prism_init’:
    starlink/ast/Ast.c:6489:7: error: format not a string literal and no format arguments [-Werror=format-security]
           AstPrism *this = astPrism( THAT, ANOTHER, options );
           ^
    starlink/ast/Ast.c: In function ‘Channel_init’:
    starlink/ast/Ast.c:6633:10: error: format not a string literal and no format arguments [-Werror=format-security]
              AstChannel *this = astChannel( source_wrap, sink_wrap, options );
              ^
    starlink/ast/Ast.c: In function ‘FitsChan_init’:
    starlink/ast/Ast.c:7114:10: error: format not a string literal and no format arguments [-Werror=format-security]
              AstFitsChan *this = astFitsChan( source_wrap, sink_wrap, options );
              ^
    starlink/ast/Ast.c: In function ‘KeyMap_init’:
    starlink/ast/Ast.c:7983:7: error: format not a string literal and no format arguments [-Werror=format-security]
           AstKeyMap *this = astKeyMap( options );
           ^
    starlink/ast/Ast.c: In function ‘Plot_init’:
    starlink/ast/Ast.c:8627:38: error: format not a string literal and no format arguments [-Werror=format-security]
                                          (const double *)bbox->data, options );
                                          ^
    starlink/ast/Ast.c: In function ‘Table_init’:
    starlink/ast/Ast.c:9450:7: error: format not a string literal and no format arguments [-Werror=format-security]
           AstTable *this = astTable( options );
           ^
    starlink/ast/Ast.c: In function ‘FitsTable_init’:
    starlink/ast/Ast.c:9892:42: error: format not a string literal and no format arguments [-Werror=format-security]
                                              options );
                                              ^
    starlink/ast/Ast.c: In function ‘DumpToString’:
    starlink/ast/Ast.c:11541:4: error: format not a string literal and no format arguments [-Werror=format-security]
        ch = astChannel( NULL, Sinka, options );
        ^
    starlink/ast/Ast.c: In function ‘Sinka’:
    starlink/ast/Ast.c:11563:7: error: format not a string literal and no format arguments [-Werror=format-security]
           *store = astAppendString( *store, &nc, text );
           ^
    cc1: some warnings being treated as errors
    error: command 'gcc' failed with exit status 1
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-ZeyrSl/starlink-pyast/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-JjS5ui-record/install-record.txt --single-version-externally-managed --compile:
    running install

running build

running build_py

creating build

creating build/lib.linux-x86_64-2.7

creating build/lib.linux-x86_64-2.7/starlink

copying starlink/__init__.py -> build/lib.linux-x86_64-2.7/starlink

copying starlink/Grf.py -> build/lib.linux-x86_64-2.7/starlink

copying starlink/Atl.py -> build/lib.linux-x86_64-2.7/starlink

creating build/lib.linux-x86_64-2.7/starlink/include

creating build/lib.linux-x86_64-2.7/starlink/include/star

copying starlink/include/star/pyast.h -> build/lib.linux-x86_64-2.7/starlink/include/star

running build_ext

building 'starlink.Ast' extension

creating build/temp.linux-x86_64-2.7

creating build/temp.linux-x86_64-2.7/starlink

creating build/temp.linux-x86_64-2.7/starlink/ast

creating build/temp.linux-x86_64-2.7/ast

creating build/temp.linux-x86_64-2.7/ast/cminpack

creating build/temp.linux-x86_64-2.7/ast/erfa

gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_STRTOK_R=1 -DHAVE_STRERROR_R=1 -DHAVE_DECL_ISFINITE=1 -DSIZEOF_LONG=8 -DSIZEOF_LONG_LONG=8 -DHAVE_DECL_ISNAN=1 -I/usr/lib64/python2.7/site-packages/numpy/core/include -I./starlink/include -I./ast -I/usr/include/python2.7 -c starlink/ast/Ast.c -o build/temp.linux-x86_64-2.7/starlink/ast/Ast.o

In file included from /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1761:0,

                 from /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,

                 from /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,

                 from starlink/ast/Ast.c:3:

/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]

 #warning "Using deprecated NumPy API, disable it by " \

  ^

In file included from starlink/ast/Ast.c:54:0:

starlink/ast/exceptions.c: In function ‘astPutErr_’:

starlink/ast/exceptions.c:710:13: error: format not a string literal and no format arguments [-Werror=format-security]

             text = astAppendString( text, &nc, message );

             ^

starlink/ast/Ast.c: In function ‘Object_repr’:

starlink/ast/Ast.c:367:7: error: format not a string literal and no format arguments [-Werror=format-security]

       p2 = astAppendString( p2, &nc, p1 );

       ^

starlink/ast/Ast.c: In function ‘Object_set’:

starlink/ast/Ast.c:487:7: error: format not a string literal and no format arguments [-Werror=format-security]

       astSet( THIS, settings );

       ^

starlink/ast/Ast.c: In function ‘Mapping_rebinseq’:

starlink/ast/Ast.c:1300:728: warning: passing argument 22 of ‘astRebinSeqD_’ from incompatible pointer type

             astRebinSeqD( THIS, wlim, ncoord_in, (const int *)lbnd_in->data,

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ^

In file included from starlink/ast/Ast.c:4:0:

./ast/ast.h:850:252: note: expected ‘int64_t *’ but argument is of type ‘int *’

 PROTO_GENERIC_DFI(D,double)

                                                                                                                                                                                                                                                            ^

starlink/ast/Ast.c:1312:724: warning: passing argument 22 of ‘astRebinSeqF_’ from incompatible pointer type

             astRebinSeqF( THIS, wlim, ncoord_in, (const int *)lbnd_in->data,

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ^

In file included from starlink/ast/Ast.c:4:0:

./ast/ast.h:851:247: note: expected ‘int64_t *’ but argument is of type ‘int *’

 PROTO_GENERIC_DFI(F,float)

                                                                                                                                                                                                                                                       ^

starlink/ast/Ast.c:1323:716: warning: passing argument 22 of ‘astRebinSeqI_’ from incompatible pointer type

             astRebinSeqI( THIS, wlim, ncoord_in, (const int *)lbnd_in->data,

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ^

In file included from starlink/ast/Ast.c:4:0:

./ast/ast.h:852:237: note: expected ‘int64_t *’ but argument is of type ‘int *’

 PROTO_GENERIC_DFI(I,int)

                                                                                                                                                                                                                                             ^

starlink/ast/Ast.c: In function ‘ZoomMap_init’:

starlink/ast/Ast.c:1934:7: error: format not a string literal and no format arguments [-Werror=format-security]

       AstZoomMap *this = astZoomMap( ncoord, zoom, options );

       ^

starlink/ast/Ast.c: In function ‘MathMap_init’:

starlink/ast/Ast.c:2092:41: error: format not a string literal and no format arguments [-Werror=format-security]

                                         options );

                                         ^

starlink/ast/Ast.c: In function ‘SphMap_init’:

starlink/ast/Ast.c:2181:7: error: format not a string literal and no format arguments [-Werror=format-security]

       AstSphMap *this = astSphMap( options );

       ^

starlink/ast/Ast.c: In function ‘GrismMap_init’:

starlink/ast/Ast.c:2279:7: error: format not a string literal and no format arguments [-Werror=format-security]

       AstGrismMap *this = astGrismMap( options );

       ^

starlink/ast/Ast.c: In function ‘PcdMap_init’:

starlink/ast/Ast.c:2372:2: error: format not a string literal and no format arguments [-Werror=format-security]

  this = astPcdMap( disco, (const double *)pcdcen->data, options );

  ^

starlink/ast/Ast.c: In function ‘WcsMap_init’:

starlink/ast/Ast.c:2475:7: error: format not a string literal and no format arguments [-Werror=format-security]

       this = astWcsMap( ncoord, type, lonax, latax, options );

       ^

starlink/ast/Ast.c: In function ‘UnitMap_init’:

starlink/ast/Ast.c:2552:7: error: format not a string literal and no format arguments [-Werror=format-security]

       AstUnitMap *this = astUnitMap( ncoord, options );

       ^

starlink/ast/Ast.c: In function ‘TimeMap_init’:

starlink/ast/Ast.c:2639:10: error: format not a string literal and no format arguments [-Werror=format-security]

          AstTimeMap *this = astTimeMap( flags, options );

          ^

starlink/ast/Ast.c: In function ‘RateMap_init’:

starlink/ast/Ast.c:2753:7: error: format not a string literal and no format arguments [-Werror=format-security]

       AstRateMap *this = astRateMap( THAT, ax1, ax2, options );

       ^

starlink/ast/Ast.c: In function ‘CmpMap_init’:

starlink/ast/Ast.c:2833:7: error: format not a string literal and no format arguments [-Werror=format-security]

       AstCmpMap *this = astCmpMap( THAT, ANOTHER, series, options );

       ^

starlink/ast/Ast.c: In function ‘TranMap_init’:

starlink/ast/Ast.c:2912:7: error: format not a string literal and no format arguments [-Werror=format-security]

       AstTranMap *this = astTranMap( THAT, ANOTHER, options );

       ^

starlink/ast/Ast.c: In function ‘PermMap_init’:

starlink/ast/Ast.c:3016:29: error: format not a string literal and no format arguments [-Werror=format-security]

                             options);

                             ^

starlink/ast/Ast.c: In function ‘ShiftMap_init’:

starlink/ast/Ast.c:3107:29: error: format not a string literal and no format arguments [-Werror=format-security]

                             options);

                             ^

starlink/ast/Ast.c: In function ‘LutMap_init’:

starlink/ast/Ast.c:3198:28: error: format not a string literal and no format arguments [-Werror=format-security]

                            start, inc, options);

                            ^

starlink/ast/Ast.c: In function ‘WinMap_init’:

starlink/ast/Ast.c:3307:30: error: format not a string literal and no format arguments [-Werror=format-security]

                              options);

                              ^

starlink/ast/Ast.c: In function ‘getActiveUnit’:

starlink/ast/Ast.c:3407:130: warning: unused variable ‘att_buf’ [-Wunused-variable]

 MAKE_GET( Frame, ActiveUnit,

                                                                                                                                  ^

starlink/ast/Ast.c: In function ‘Frame_init’:

starlink/ast/Ast.c:3494:7: error: format not a string literal and no format arguments [-Werror=format-security]

       AstFrame *this = astFrame( naxes, options );

       ^

starlink/ast/Ast.c: In function ‘MatrixMap_init’:

starlink/ast/Ast.c:4146:34: error: format not a string literal and no format arguments [-Werror=format-security]

                                  1, (const double *) matrix->data, options );

                                  ^

starlink/ast/Ast.c:4149:34: error: format not a string literal and no format arguments [-Werror=format-security]

                                  0, (const double *) matrix->data, options );

                                  ^

starlink/ast/Ast.c: In function ‘PolyMap_init’:

starlink/ast/Ast.c:4329:41: error: format not a string literal and no format arguments [-Werror=format-security]

                                         options );

                                         ^

starlink/ast/Ast.c: In function ‘NormMap_init’:

starlink/ast/Ast.c:4460:7: error: format not a string literal and no format arguments [-Werror=format-security]

       AstNormMap *this = astNormMap( THAT, options );

       ^

starlink/ast/Ast.c: In function ‘FrameSet_init’:

starlink/ast/Ast.c:4565:7: error: format not a string literal and no format arguments [-Werror=format-security]

       AstFrameSet *this = astFrameSet( THAT, options );

       ^

starlink/ast/Ast.c: In function ‘CmpFrame_init’:

starlink/ast/Ast.c:4767:7: error: format not a string literal and no format arguments [-Werror=format-security]

       AstCmpFrame *this = astCmpFrame( THAT, ANOTHER, options );

       ^

starlink/ast/Ast.c: In function ‘SkyFrame_init’:

starlink/ast/Ast.c:4880:7: error: format not a string literal and no format arguments [-Werror=format-security]

       AstSkyFrame *this = astSkyFrame( options );

       ^

starlink/ast/Ast.c: In function ‘SpecFrame_init’:

starlink/ast/Ast.c:5017:7: error: format not a string literal and no format arguments [-Werror=format-security]

       AstSpecFrame *this = astSpecFrame( options );

       ^

starlink/ast/Ast.c: In function ‘DSBSpecFrame_init’:

starlink/ast/Ast.c:5156:7: error: format not a string literal and no format arguments [-Werror=format-security]

       AstDSBSpecFrame *this = astDSBSpecFrame( options );

       ^

starlink/ast/Ast.c: In function ‘TimeFrame_init’:

starlink/ast/Ast.c:5253:7: error: format not a string literal and no format arguments [-Werror=format-security]

       AstTimeFrame *this = astTimeFrame( options );

       ^

starlink/ast/Ast.c: In function ‘FluxFrame_init’:

starlink/ast/Ast.c:5359:7: error: format not a string literal and no format arguments [-Werror=format-security]

       AstFluxFrame *this = astFluxFrame( specval, THAT, options );

       ^

starlink/ast/Ast.c: In function ‘SpecFluxFrame_init’:

starlink/ast/Ast.c:5439:7: error: format not a string literal and no format arguments [-Werror=format-security]

       AstSpecFluxFrame *this = astSpecFluxFrame( THAT, ANOTHER, options );

       ^

starlink/ast/Ast.c: In function ‘Box_init’:

starlink/ast/Ast.c:5718:22: error: format not a string literal and no format arguments [-Werror=format-security]

                      (const double*)point2->data, unc, options );

                      ^

starlink/ast/Ast.c: In function ‘Circle_init’:

starlink/ast/Ast.c:5814:27: error: format not a string literal and no format arguments [-Werror=format-security]

                           (const double*)point->data, unc, options );

                           ^

starlink/ast/Ast.c: In function ‘Polygon_init’:

starlink/ast/Ast.c:5917:41: error: format not a string literal and no format arguments [-Werror=format-security]

                                         options );

                                         ^

starlink/ast/Ast.c: In function ‘PointList_init’:

starlink/ast/Ast.c:6049:41: error: format not a string literal and no format arguments [-Werror=format-security]

                                         options );

                                         ^

starlink/ast/Ast.c: In function ‘Ellipse_init’:

starlink/ast/Ast.c:6151:7: error: format not a string literal and no format arguments [-Werror=format-security]

       unc, options );

       ^

starlink/ast/Ast.c: In function ‘Interval_init’:

starlink/ast/Ast.c:6246:27: error: format not a string literal and no format arguments [-Werror=format-security]

                           (const double*)ubnd->data, unc, options );

                           ^

starlink/ast/Ast.c: In function ‘NullRegion_init’:

starlink/ast/Ast.c:6330:7: error: format not a string literal and no format arguments [-Werror=format-security]

       this = astNullRegion( THAT, unc, options );

       ^

starlink/ast/Ast.c: In function ‘CmpRegion_init’:

starlink/ast/Ast.c:6410:7: error: format not a string literal and no format arguments [-Werror=format-security]

       AstCmpRegion *this = astCmpRegion( THAT, ANOTHER, oper, options );

       ^

starlink/ast/Ast.c: In function ‘Prism_init’:

starlink/ast/Ast.c:6489:7: error: format not a string literal and no format arguments [-Werror=format-security]

       AstPrism *this = astPrism( THAT, ANOTHER, options );

       ^

starlink/ast/Ast.c: In function ‘Channel_init’:

starlink/ast/Ast.c:6633:10: error: format not a string literal and no format arguments [-Werror=format-security]

          AstChannel *this = astChannel( source_wrap, sink_wrap, options );

          ^

starlink/ast/Ast.c: In function ‘FitsChan_init’:

starlink/ast/Ast.c:7114:10: error: format not a string literal and no format arguments [-Werror=format-security]

          AstFitsChan *this = astFitsChan( source_wrap, sink_wrap, options );

          ^

starlink/ast/Ast.c: In function ‘KeyMap_init’:

starlink/ast/Ast.c:7983:7: error: format not a string literal and no format arguments [-Werror=format-security]

       AstKeyMap *this = astKeyMap( options );

       ^

starlink/ast/Ast.c: In function ‘Plot_init’:

starlink/ast/Ast.c:8627:38: error: format not a string literal and no format arguments [-Werror=format-security]

                                      (const double *)bbox->data, options );

                                      ^

starlink/ast/Ast.c: In function ‘Table_init’:

starlink/ast/Ast.c:9450:7: error: format not a string literal and no format arguments [-Werror=format-security]

       AstTable *this = astTable( options );

       ^

starlink/ast/Ast.c: In function ‘FitsTable_init’:

starlink/ast/Ast.c:9892:42: error: format not a string literal and no format arguments [-Werror=format-security]

                                          options );

                                          ^

starlink/ast/Ast.c: In function ‘DumpToString’:

starlink/ast/Ast.c:11541:4: error: format not a string literal and no format arguments [-Werror=format-security]

    ch = astChannel( NULL, Sinka, options );

    ^

starlink/ast/Ast.c: In function ‘Sinka’:

starlink/ast/Ast.c:11563:7: error: format not a string literal and no format arguments [-Werror=format-security]

       *store = astAppendString( *store, &nc, text );

       ^

cc1: some warnings being treated as errors

error: command 'gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-ZeyrSl/starlink-pyast/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-JjS5ui-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-ZeyrSl/starlink-pyast
Traceback (most recent call last):
  File "/usr/bin/pip", line 11, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/pip/__init__.py", line 184, in main
    return command.main(cmd_args)
  File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 43: ordinal not in range(128)

WCS information for SIP files doesn't survive write/read round trip to FITS file.

PyAst doesn't seem to be writing the information in SIP files correctly when writing them in FITS format. I believe it used to work correctly in a previous version of starlink-pyast, but I can't be 100% sure. I didn't try to go back to previous versions to try them out, so maybe I'm wrong and this was never working.

Anyway, here is a script that shows the problem:

import starlink.Atl as Atl
import starlink.Ast as Ast
import astropy.io.fits as pyfits
import numpy

# File from http://fits.gsfc.nasa.gov/registry/sip.html
hdu = pyfits.open('sipsample.fits')[0]
fc = Ast.FitsChan(Atl.PyFITSAdapter(hdu))
wcs = fc.read()

# A random test position.  The "true" RA, Dec values are taken from ds9.
x = 242
y = 75
true_ra = (13 + 30/60. + 1.474154/3600. - 24.) * numpy.pi / 12.
true_dec = (47 + 12/60. + 51.794474/3600.) * numpy.pi / 180.

ra1, dec1 = wcs.tran( numpy.array([ [x], [y] ]))
print 'Initial read of sipsample.fits:'
print 'error in ra = ',(ra1-true_ra) * 180.*3600./numpy.pi, 'arcsec'
print 'error in dec = ',(dec1-true_dec) * 180.*3600./numpy.pi, 'arcsec'

# Now cycle through writing and reading to a file

hdu2 = pyfits.PrimaryHDU()
fc2 = Ast.FitsChan(None, Atl.PyFITSAdapter(hdu2, clear=False), "Encoding=FITS-WCS")
success = fc2.write(wcs)
print 'success = ',success
fc2.writefits()
hdu2.writeto('test_sip.fits', clobber=True)

hdu3 = pyfits.open('test_sip.fits')[0]
fc3 = Ast.FitsChan(Atl.PyFITSAdapter(hdu3))
wcs3 = fc3.read()

ra3, dec3 = wcs3.tran( numpy.array([ [x], [y] ]))
print 'After write/read round trip through fits file:'
print 'error in ra = ',(ra3-true_ra) * 180.*3600./numpy.pi, 'arcsec'
print 'error in dec = ',(dec3-true_dec) * 180.*3600./numpy.pi, 'arcsec'

The output I get from this is:

Initial read of sipsample.fits:
error in ra =  [ -1.94521707e-06] arcsec
error in dec =  [  5.42684051e-07] arcsec
success =  1
After write/read round trip through fits file:
error in ra =  [-3.15051913] arcsec
error in dec =  [ 0.62446887] arcsec

So the initial read works fine, but then writing to a file and reading it back in leads to an error of several arcsec. The problem is that none of the SIP information is getting output. It writes it as a simple TAN WCS, rather than TAN-SIP.

Am I doing something wrong with the I/O commands? Or is this a bug in PyAst?

Maybe just the return value from fc2.write(wcs) is wrong? It's possible that older versions reported this as 0, in which case the GalSim test suite would have skipped this check, since it would have been reported as not working. But now it claims success, so we check it.

For what it's worth, I had noticed TPV and ZPX types being incorrectly reported as successfully written, and I had a workaround to explicitly countermand the success report in those cases. So maybe SIP is now also just wrongly reporting success here.

Matplotlib dependency not listed in setup.py

When setting up Travis CI for GalSim, I discovered that starlink-pyast has a hidden dependency of matplotlib at the top of Grf.py. Since none of the other packages we use in GalSim require matplotlib, it didn't get installed on the Travis sandbox, and import starlink.Atl led to an ImportError from the matplotlib dependency.

Even with matplotlib installed, it's still an annoying import, since it has to set up the font cache the first time it is imported. This takes time and adds noise to the output:

/home/travis/virtualenv/python2.7.12/lib/python2.7/site-packages/matplotlib/font_manager.py:273:
UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')

Possible solutions in order of (my) preference:

  1. Make matplotlib an optional dependency and only import Grf (and thus matplotlib) if the user calls Atl.plotframeset. i.e. Move the line import starlink.Grf as Grf into this function.
  2. Make matplotlib an optional dependency and only import matplotlib in the Grf functions that use it. Then import starlink.Grf as Grf is quick, and matplotlib would only have to be imported if the user calls the functions in Grf that need it.
  3. Make matplotlib an official dependency by adding it to setup.py, but also do (1) or (2) to avoid the above warning.
  4. Make matplotlib an official dependency, and continue to needlessly import matplotlib whenever Atl is imported.

Thanks for your consideration. :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.