From 2bc3097be0fd4fab442dc0423f84f332519c4664 Mon Sep 17 00:00:00 2001 From: Theodore Kisner Date: Tue, 3 Oct 2017 16:19:56 -0700 Subject: [PATCH] Bump the bundled version of healpy to 1.11.0 --- configure.ac | 2 +- src/healpy/CHANGELOG.rst | 10 +- src/healpy/INSTALL.rst | 13 +- src/healpy/README.rst | 2 +- src/healpy/healpy/__init__.py | 2 +- src/healpy/healpy/fitsfunc.py | 134 +- src/healpy/healpy/newvisufunc.py | 2 +- src/healpy/healpy/pixelfunc.py | 191 +- src/healpy/healpy/projaxes.py | 84 +- src/healpy/healpy/rotator.py | 235 +- src/healpy/healpy/sphtfunc.py | 151 +- src/healpy/healpy/src/_healpy_fitsio_lib.cc | 122 - src/healpy/healpy/src/_pixelfunc.cpp | 2640 ++++--- src/healpy/healpy/src/_pixelfunc.pyx | 22 +- src/healpy/healpy/src/_query_disc.cpp | 2221 ++++-- src/healpy/healpy/src/_sphtools.cpp | 6651 ++++++++++------- src/healpy/healpy/src/_sphtools.pyx | 153 +- src/healpy/healpy/test/test_doctest_cython.py | 20 - src/healpy/healpy/test/test_fitsfunc.py | 44 +- src/healpy/healpy/test/test_sphtfunc.py | 103 +- src/healpy/healpy/test/test_visufunc.py | 13 +- src/healpy/healpy/version.py | 2 +- src/healpy/healpy/visufunc.py | 10 +- src/healpy/original_setup.py | 33 +- src/healpy/run_pykg_config.py | 6 + src/healpy/setup.cfg.in | 7 + src/healpy/setup.py.in | 34 +- 27 files changed, 8081 insertions(+), 4826 deletions(-) delete mode 100644 src/healpy/healpy/src/_healpy_fitsio_lib.cc delete mode 100644 src/healpy/healpy/test/test_doctest_cython.py create mode 100644 src/healpy/run_pykg_config.py diff --git a/configure.ac b/configure.ac index e6745b8..0688e62 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ dnl dnl +------------------------ dnl | Initialize package info dnl +------------------------ -AC_INIT([HEALPix], [3.31.3], [work@theodorekisner.com], [healpix-autotools], [https://github.com/tskisner/healpix-autotools]) +AC_INIT([HEALPix], [3.31.4], [work@theodorekisner.com], [healpix-autotools], [https://github.com/tskisner/healpix-autotools]) AC_CONFIG_SRCDIR([Makefile.am]) AM_INIT_AUTOMAKE([foreign tar-ustar]) AC_CONFIG_HEADERS(config.h) diff --git a/src/healpy/CHANGELOG.rst b/src/healpy/CHANGELOG.rst index 7262dd1..7424a15 100644 --- a/src/healpy/CHANGELOG.rst +++ b/src/healpy/CHANGELOG.rst @@ -1,3 +1,11 @@ +Release 1.11.0, 8 Aug 2017 + +* Remove NSIDE restriction to be a power of 2 for RING +* Implement Coordsys2euler zyz +* Return multiple maps as a single 2D array instead of a tuple of 1D arrays +* Support for galactic cut in anafast and map2alm +* Change in write_map default behavior: and + Release 1.10.1, 8 Nov 2016 * Removed support for Python 2.6 @@ -68,7 +76,7 @@ Release 1.7.1, 23 Jan 2014 Release 1.7.0, 14 Jan 2014 -* rewritten spherical armonics unit tests, now it uses low res maps included in the repository +* rewritten spherical harmonics unit tests, now it uses low res maps included in the repository * fix in HEALPix C++ build flags allows easier install on MAC-OSX and other python environments (e.g. anaconda) * orthview: orthografic projection * fixed bug in monopole removal in anafast diff --git a/src/healpy/INSTALL.rst b/src/healpy/INSTALL.rst index 21e1edd..10cf6cf 100644 --- a/src/healpy/INSTALL.rst +++ b/src/healpy/INSTALL.rst @@ -9,15 +9,16 @@ is included with Healpy and is built automatically, so you do not need to install them yourself. Only Linux and MAC OS X are supported, not Windows. -Binary installation with conda +Binary installation with conda (RECOMMENDED) ----------------------- -The `OpenAstronomy `_ collaboration provides a `conda -channel `_ with a pre-compiled version of ``healpy`` -for linux 64bit and MAC OS X platforms, you can install it in Anaconda with: - - conda install -c openastronomy healpy +Conda forge provides a `conda +channel `_ with a pre-compiled version of ``healpy`` +for linux 64bit and MAC OS X platforms, you can install it in Anaconda with:: + conda config --add channels conda-forge + conda install healpy + Source installation with Pip --------------------------- diff --git a/src/healpy/README.rst b/src/healpy/README.rst index 411beac..1997846 100644 --- a/src/healpy/README.rst +++ b/src/healpy/README.rst @@ -36,7 +36,7 @@ Characteristics Requirements ------------ -* `Python `_ 2.7, 3.2, 3.3, 3.4 or 3.5 +* `Python `_ 2.7, 3.4, 3.5, or 3.6 * `Numpy `_ (tested with version >=1.5.0) diff --git a/src/healpy/healpy/__init__.py b/src/healpy/healpy/__init__.py index 73a6ed7..fb32034 100644 --- a/src/healpy/healpy/__init__.py +++ b/src/healpy/healpy/__init__.py @@ -32,7 +32,7 @@ nside2order, order2nside, isnsideok, isnpixok, ring2nest, nest2ring, reorder, - get_neighbours, get_all_neighbours, max_pixrad, get_interp_val, + get_all_neighbours, max_pixrad, get_interp_val, get_interp_weights, fit_dipole, fit_monopole, remove_dipole, remove_monopole, diff --git a/src/healpy/healpy/fitsfunc.py b/src/healpy/healpy/fitsfunc.py index aabe8dc..916e845 100644 --- a/src/healpy/healpy/fitsfunc.py +++ b/src/healpy/healpy/fitsfunc.py @@ -19,14 +19,9 @@ # """Provides input and output functions for Healpix maps, alm, and cl. """ -from __future__ import with_statement from __future__ import division import six -import gzip -import tempfile -import shutil -import os import warnings import astropy.io.fits as pf import numpy as np @@ -45,29 +40,8 @@ class HealpixFitsWarning(Warning): pass -def writeto(tbhdu, filename): - # FIXME: Pyfits versions earlier than 3.1.2 had no support or flaky support - # for writing to .gz files or GzipFile objects. Drop this code when - # we decide to drop support for older versions of Pyfits or if we decide - # to support only Astropy. - if isinstance(filename, six.string_types) and filename.endswith('.gz'): - basefilename, ext = os.path.splitext(filename) - with tempfile.NamedTemporaryFile(suffix='.fits') as tmpfile: - tbhdu.writeto(tmpfile.name, clobber=True) - gzfile = gzip.open(filename, 'wb') - try: - try: - shutil.copyfileobj(tmpfile, gzfile) - finally: - gzfile.close() - except: - os.unlink(gzfile.name) - raise - else: - tbhdu.writeto(filename, clobber=True) - def read_cl(filename, dtype=np.float64, h=False): - """Reads Cl from an healpix file, as IDL fits2cl. + """Reads Cl from a healpix file, as IDL fits2cl. Parameters ---------- @@ -82,41 +56,47 @@ def read_cl(filename, dtype=np.float64, h=False): the cl array """ fits_hdu = _get_hdu(filename, hdu=1) - cl = [fits_hdu.data.field(n) for n in range(len(fits_hdu.columns))] + cl = np.array([fits_hdu.data.field(n) for n in range(len(fits_hdu.columns))]) if len(cl) == 1: return cl[0] else: return cl -def write_cl(filename, cl, dtype=np.float64): - """Writes Cl into an healpix file, as IDL cl2fits. +def write_cl(filename, cl, dtype=np.float64, overwrite=False): + """Writes Cl into a healpix file, as IDL cl2fits. Parameters ---------- filename : str the fits file name cl : array - the cl array to write to file, currently TT only + the cl array to write to file + overwrite : bool, optional + If True, existing file is silently overwritten. Otherwise trying to write + an existing file raises an OSError (IOError for Python 2). """ # check the dtype and convert it fitsformat = getformat(dtype) column_names = ['TEMPERATURE','GRADIENT','CURL','G-T','C-T','C-G'] - if isinstance(cl, list): + if len(np.shape(cl)) == 2: cols = [pf.Column(name=column_name, format='%s'%fitsformat, array=column_cl) for column_name, column_cl in zip(column_names[:len(cl)], cl)] - else: # we write only one TT + elif len(np.shape(cl)) == 1: + # we write only TT cols = [pf.Column(name='TEMPERATURE', format='%s'%fitsformat, array=cl)] + else: + raise RuntimeError('write_cl: Expected one or more vectors of equal length') tbhdu = pf.BinTableHDU.from_columns(cols) # add needed keywords tbhdu.header['CREATOR'] = 'healpy' - writeto(tbhdu, filename) + tbhdu.writeto(filename, overwrite=overwrite) -def write_map(filename,m,nest=False,dtype=np.float32,fits_IDL=True,coord=None,partial=False,column_names=None,column_units=None,extra_header=()): - """Writes an healpix map into an healpix file. +def write_map(filename,m,nest=False,dtype=np.float32,fits_IDL=True,coord=None,partial=False,column_names=None,column_units=None,extra_header=(),overwrite=False): + """Writes a healpix map into a healpix file. Parameters ---------- @@ -152,8 +132,11 @@ def write_map(filename,m,nest=False,dtype=np.float32,fits_IDL=True,coord=None,pa dtype: np.dtype or list of np.dtypes, optional The datatype in which the columns will be stored. Will be converted internally from the numpy datatype to the fits convention. If a list, - the length must correspond to the number of map arrays. + the length must correspond to the number of map arrays. Default: np.float32. + overwrite : bool, optional + If True, existing file is silently overwritten. Otherwise trying to write + an existing file raises an OSError (IOError for Python 2). """ if not hasattr(m, '__len__'): raise TypeError('The map must be a sequence') @@ -202,7 +185,7 @@ def write_map(filename,m,nest=False,dtype=np.float32,fits_IDL=True,coord=None,pa array=pix, unit=None)) - for cn, cu, mm, curr_fitsformat in zip(column_names, column_units, m, + for cn, cu, mm, curr_fitsformat in zip(column_names, column_units, m, fitsformat): if len(mm) > 1024 and fits_IDL: # I need an ndarray, for reshape: @@ -245,12 +228,12 @@ def write_map(filename,m,nest=False,dtype=np.float32,fits_IDL=True,coord=None,pa for args in extra_header: tbhdu.header[args[0]] = args[1:] - writeto(tbhdu, filename) + tbhdu.writeto(filename, overwrite=overwrite) def read_map(filename,field=0,dtype=np.float64,nest=False,partial=False,hdu=1,h=False, verbose=True,memmap=False): - """Read an healpix map from a fits file. Partial-sky files, + """Read a healpix map from a fits file. Partial-sky files, if properly identified, are expanded to full size and filled with UNSEEN. Parameters @@ -265,7 +248,7 @@ def read_map(filename,field=0,dtype=np.float64,nest=False,partial=False,hdu=1,h= first column after the pixel index column. If None, all columns are read in. dtype : data type or list of data types, optional - Force the conversion to some type. Passing a list allows different + Force the conversion to some type. Passing a list allows different types for each field. In that case, the length of the list must correspond to the length of the field parameter. Default: np.float64 nest : bool, optional @@ -353,12 +336,12 @@ def read_map(filename,field=0,dtype=np.float64,nest=False,partial=False,hdu=1,h= # increment field counters field = tuple(f if isinstance(f, str) else f+1 for f in field) try: - pix = fits_hdu.data.field(0).astype(int).ravel() + pix = fits_hdu.data.field(0).astype(int,copy=False).ravel() except pf.VerifyError as e: print(e) print("Trying to fix a badly formatted header") fits_hdu.verify("fix") - pix = fits_hdu.data.field(0).astype(int).ravel() + pix = fits_hdu.data.field(0).astype(int,copy=False).ravel() try: assert len(dtype) == len(field), "The number of dtypes are not equal to the number of fields" @@ -367,12 +350,12 @@ def read_map(filename,field=0,dtype=np.float64,nest=False,partial=False,hdu=1,h= for ff, curr_dtype in zip(field, dtype): try: - m=fits_hdu.data.field(ff).astype(curr_dtype).ravel() + m=fits_hdu.data.field(ff).astype(curr_dtype,copy=False).ravel() except pf.VerifyError as e: print(e) print("Trying to fix a badly formatted header") m=fits_hdu.verify("fix") - m=fits_hdu.data.field(ff).astype(curr_dtype).ravel() + m=fits_hdu.data.field(ff).astype(curr_dtype,copy=False).ravel() if partial: mnew = UNSEEN * np.ones(sz, dtype=curr_dtype) @@ -397,20 +380,26 @@ def read_map(filename,field=0,dtype=np.float64,nest=False,partial=False,hdu=1,h= pass ret.append(m) + if h: + header = [] + for (key, value) in fits_hdu.header.items(): + header.append((key, value)) + if len(ret) == 1: if h: - return ret[0],fits_hdu.header.items() + return ret[0], header else: return ret[0] else: + if all(dt == dtype[0] for dt in dtype): + ret = np.array(ret) if h: - ret.append(fits_hdu.header.items()) - return tuple(ret) + return ret, header else: - return tuple(ret) + return ret -def write_alm(filename,alms,out_dtype=None,lmax=-1,mmax=-1,mmax_in=-1): +def write_alm(filename,alms,out_dtype=None,lmax=-1,mmax=-1,mmax_in=-1,overwrite=False): """Write alms to a fits file. In the fits file the alms are written @@ -480,7 +469,7 @@ def write_alm(filename,alms,out_dtype=None,lmax=-1,mmax=-1,mmax_in=-1): tbhdu = pf.BinTableHDU.from_columns([cindex,creal,cimag]) hdulist.append(tbhdu) - writeto(hdulist, filename) + hdulist.writeto(filename, overwrite=overwrite) def read_alm(filename,hdu=1,return_mmax=False): """Read alm from a fits file. @@ -494,7 +483,7 @@ def read_alm(filename,hdu=1,return_mmax=False): ---------- filename : str or HDUList or HDU The name of the fits file to read - hdu : int, optional + hdu : int, or tuple of int, optional The header to read. Start at 0. Default: hdu=1 return_mmax : bool, optional If true, both the alms and mmax is returned in a tuple. Default: return_mmax=False @@ -504,17 +493,34 @@ def read_alm(filename,hdu=1,return_mmax=False): alms[, mmax] : complex array or tuple of a complex array and an int The alms read from the file and optionally mmax read from the file """ - idx, almr, almi = mrdfits(filename,hdu=hdu) - l = np.floor(np.sqrt(idx-1)).astype(np.long) - m = idx - l**2 - l - 1 - if (m<0).any(): - raise ValueError('Negative m value encountered !') - lmax = l.max() - mmax = m.max() - alm = almr*(0+0j) - i = Alm.getidx(lmax,l,m) - alm.real[i] = almr - alm.imag[i] = almi + alms = [] + lmaxtot = None + mmaxtot = None + for unit in np.atleast_1d(hdu): + idx, almr, almi = mrdfits(filename,hdu=unit) + l = np.floor(np.sqrt(idx-1)).astype(np.long) + m = idx - l**2 - l - 1 + if (m<0).any(): + raise ValueError('Negative m value encountered !') + lmax = l.max() + mmax = m.max() + if lmaxtot is None: + lmaxtot = lmax + mmaxtot = mmax + else: + if lmaxtot != lmax or mmaxtot != mmax: + raise RuntimeError( + 'read_alm: harmonic expansion order in {} HDUs {} does not ' + 'match'.format(filename, unit, hdu)) + alm = almr*(0+0j) + i = Alm.getidx(lmax,l,m) + alm.real[i] = almr + alm.imag[i] = almi + alms.append(alm) + if len(alms) == 1: + alm = alms[0] + else: + alm = np.array(alms) if return_mmax: return alm, mmax else: @@ -609,7 +615,7 @@ def mwrfits(filename,data,hdu=1,colnames=None,keys=None): for k,v in keys.items(): tbhdu.header[k] = v # write the file - writeto(tbhdu, filename) + tbhdu.writeto(filename) def getformat(t): """Get the FITS convention format string of data type t. diff --git a/src/healpy/healpy/newvisufunc.py b/src/healpy/healpy/newvisufunc.py index 6e7d203..0da9443 100644 --- a/src/healpy/healpy/newvisufunc.py +++ b/src/healpy/healpy/newvisufunc.py @@ -38,7 +38,7 @@ def mollview(m=None, rot=None, coord=None, unit='', norm=None, graticule=False, graticule_labels=False, **kwargs): - """Plot an healpix map (given as an array) in Mollweide projection. + """Plot a healpix map (given as an array) in Mollweide projection. Parameters ---------- diff --git a/src/healpy/healpy/pixelfunc.py b/src/healpy/healpy/pixelfunc.py index 5e4b113..d202830 100644 --- a/src/healpy/healpy/pixelfunc.py +++ b/src/healpy/healpy/pixelfunc.py @@ -1,20 +1,20 @@ -# +# # This file is part of Healpy. -# +# # Healpy 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 2 of the License, or # (at your option) any later version. -# +# # Healpy 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 Healpy; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# +# # For more information about Healpy, see http://code.google.com/p/healpy # """ @@ -30,7 +30,7 @@ - :func:`pix2ang` converts pixel number to angular coordinates - :func:`pix2vec` converts pixel number to unit 3-vector direction - :func:`ang2pix` converts angular coordinates to pixel number -- :func:`vec2pix` converts 3-vector to pixel number +- :func:`vec2pix` converts 3-vector to pixel number - :func:`vec2ang` converts 3-vector to angular coordinates - :func:`ang2vec` converts angular coordinates to unit 3-vector - :func:`pix2xyf` converts pixel number to coordinates within face @@ -110,7 +110,7 @@ __all__ = ['pix2ang', 'pix2vec', 'ang2pix', 'vec2pix', 'ang2vec', 'vec2ang', - 'get_interp_weights', 'get_neighbours', 'get_interp_val', 'get_all_neighbours', + 'get_interp_weights', 'get_interp_val', 'get_all_neighbours', 'max_pixrad', 'nest2ring', 'ring2nest', 'reorder', 'ud_grade', 'UNSEEN', 'mask_good', 'mask_bad', 'ma', @@ -233,7 +233,7 @@ def ma_to_array(m): return m.filled() except AttributeError: try: - return tuple([mm.filled() for mm in m]) + return np.array([mm.filled() for mm in m]) except AttributeError: pass return m @@ -356,7 +356,7 @@ def ma(m, badval = UNSEEN, rtol = 1e-5, atol = 1e-8, copy = True): Returns ------- - a masked array with the same shape as the input map, + a masked array with the same shape as the input map, masked where input map is close to badval. See Also @@ -374,10 +374,7 @@ def ma(m, badval = UNSEEN, rtol = 1e-5, atol = 1e-8, copy = True): fill_value = -1.6375e+30) """ - if maptype(m) == 0: - return np.ma.masked_values(m, badval, rtol = rtol, atol = atol, copy = copy) - else: - return tuple([ma(mm) for mm in m]) + return np.ma.masked_values(np.array(m), badval, rtol = rtol, atol = atol, copy = copy) def ang2pix(nside,theta,phi,nest=False,lonlat=False): """ang2pix : nside,theta[rad],phi[rad],nest=False,lonlat=False -> ipix (default:RING) @@ -425,7 +422,7 @@ def ang2pix(nside,theta,phi,nest=False,lonlat=False): if lonlat: theta,phi = lonlat2thetaphi(theta,phi) check_theta_valid(theta) - check_nside(nside) + check_nside(nside, nest=nest) if nest: return pixlib._ang2pix_nest(nside,theta,phi) else: @@ -471,7 +468,7 @@ def pix2ang(nside,ipix,nest=False,lonlat=False): >>> hp.pix2ang([1, 2, 4, 8], 11, lonlat=True) (array([ 315. , 337.5, 337.5, 337.5]), array([-41.8103149 , 41.8103149 , 66.44353569, 78.28414761])) """ - check_nside(nside) + check_nside(nside, nest=nest) if nest: theta,phi = pixlib._pix2ang_nest(nside, ipix) else: @@ -515,7 +512,7 @@ def xyf2pix(nside,x,y,face,nest=False): >>> hp.xyf2pix(16, [8, 8, 8, 15, 0], [8, 8, 7, 15, 0], [4, 0, 5, 0, 8]) array([1440, 427, 1520, 0, 3068]) """ - check_nside(nside) + check_nside(nside, nest=nest) if nest: return pixlib._xyf2pix_nest(nside,x,y,face) else: @@ -556,7 +553,7 @@ def pix2xyf(nside,ipix,nest=False): >>> hp.pix2xyf([1, 2, 4, 8], 11) (array([0, 1, 3, 7]), array([0, 0, 2, 6]), array([11, 3, 3, 3])) """ - check_nside(nside) + check_nside(nside, nest=nest) if nest: return pixlib._pix2xyf_nest(nside, ipix) else: @@ -635,7 +632,7 @@ def pix2vec(nside,ipix,nest=False): >>> hp.pix2vec([1, 2], 11) (array([ 0.52704628, 0.68861915]), array([-0.52704628, -0.28523539]), array([-0.66666667, 0.66666667])) """ - check_nside(nside) + check_nside(nside, nest=nest) if nest: return pixlib._pix2vec_nest(nside,ipix) else: @@ -647,9 +644,9 @@ def ang2vec(theta, phi, lonlat=False): Parameters ---------- theta : float, scalar or arry-like - colatitude in radians measured southward from north pole (in [0,pi]). + colatitude in radians measured southward from north pole (in [0,pi]). phi : float, scalar or array-like - longitude in radians measured eastward (in [0, 2*pi]). + longitude in radians measured eastward (in [0, 2*pi]). lonlat : bool If True, input angles are assumed to be longitude and latitude in degree, otherwise, they are co-latitude and longitude in radians. @@ -720,7 +717,7 @@ def ring2nest(nside, ipix): See Also -------- nest2ring, reorder - + Examples -------- >>> import healpy as hp @@ -729,11 +726,11 @@ def ring2nest(nside, ipix): >>> hp.ring2nest(2, np.arange(10)) array([ 3, 7, 11, 15, 2, 1, 6, 5, 10, 9]) - + >>> hp.ring2nest([1, 2, 4, 8], 11) array([ 11, 13, 61, 253]) """ - check_nside(nside) + check_nside(nside, nest=True) return pixlib._ring2nest(nside, ipix) def nest2ring(nside, ipix): @@ -754,7 +751,7 @@ def nest2ring(nside, ipix): See Also -------- ring2nest, reorder - + Examples -------- >>> import healpy as hp @@ -763,16 +760,16 @@ def nest2ring(nside, ipix): >>> hp.nest2ring(2, np.arange(10)) array([13, 5, 4, 0, 15, 7, 6, 1, 17, 9]) - + >>> hp.nest2ring([1, 2, 4, 8], 11) array([ 11, 2, 12, 211]) """ - check_nside(nside) + check_nside(nside, nest=True) return pixlib._nest2ring(nside, ipix) @accept_ma def reorder(map_in, inp=None, out=None, r2n=None, n2r=None): - """Reorder an healpix map from RING/NESTED ordering to NESTED/RING + """Reorder a healpix map from RING/NESTED ordering to NESTED/RING Parameters ---------- @@ -788,7 +785,7 @@ def reorder(map_in, inp=None, out=None, r2n=None, n2r=None): Returns ------- map_out : array-like - the reordered map, as masked array if the input was a + the reordered map, as masked array if the input was a masked array Notes @@ -819,16 +816,16 @@ def reorder(map_in, inp=None, out=None, r2n=None, n2r=None): >>> m[2][2] = hp.UNSEEN >>> m = hp.ma(m) >>> hp.reorder(m, n2r = True) - (masked_array(data = [0.0 1.0 -- 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0], - mask = [False False True False False False False False False False False False], - fill_value = -1.6375e+30) - , masked_array(data = [0.0 1.0 -- 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0], - mask = [False False True False False False False False False False False False], - fill_value = -1.6375e+30) - , masked_array(data = [0.0 1.0 -- 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0], - mask = [False False True False False False False False False False False False], + masked_array(data = + [[0.0 1.0 -- 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0] + [0.0 1.0 -- 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0] + [0.0 1.0 -- 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0]], + mask = + [[False False True False False False False False False False False False] + [False False True False False False False False False False False False] + [False False True False False False False False False False False False]], fill_value = -1.6375e+30) - ) + """ typ = maptype(map_in) if typ == 0: @@ -877,7 +874,7 @@ def reorder(map_in, inp=None, out=None, r2n=None, n2r=None): if typ == 0: return mapout[0] else: - return mapout + return np.array(mapout) def nside2npix(nside): """Give the number of pixels for the given nside. @@ -892,7 +889,7 @@ def nside2npix(nside): ------- npix : int corresponding number of pixels - + Notes ----- Raise a ValueError exception if nside is not valid. @@ -908,12 +905,9 @@ def nside2npix(nside): True >>> hp.nside2npix(7) - Traceback (most recent call last): - ... - ValueError: 7 is not a valid nside parameter (must be a power of 2, less than 2**30) + 588 """ - check_nside(nside) - return 12*nside**2 + return 12*nside*nside def nside2order(nside): """Give the resolution order for a given nside. @@ -948,7 +942,7 @@ def nside2order(nside): ... ValueError: 7 is not a valid nside parameter (must be a power of 2, less than 2**30) """ - check_nside(nside) + check_nside(nside, nest=True) return len('{0:b}'.format(nside)) - 1 def nside2resol(nside, arcmin=False): @@ -983,17 +977,14 @@ def nside2resol(nside, arcmin=False): 0.0039973699529159707 >>> hp.nside2resol(7) - Traceback (most recent call last): - ... - ValueError: 7 is not a valid nside parameter (must be a power of 2, less than 2**30) + 0.1461895297066412 """ - check_nside(nside) - + resol = np.sqrt(nside2pixarea(nside)) if arcmin: resol = np.rad2deg(resol) * 60 - + return resol @@ -1026,17 +1017,14 @@ def nside2pixarea(nside, degrees=False): 1.5978966540475428e-05 >>> hp.nside2pixarea(7) - Traceback (most recent call last): - ... - ValueError: 7 is not a valid nside parameter (must be a power of 2, less than 2**30) + 0.021371378595848933 """ - check_nside(nside) - + pixarea = 4*np.pi/nside2npix(nside) if degrees: pixarea = np.rad2deg(np.rad2deg(pixarea)) - + return pixarea def npix2nside(npix): @@ -1046,7 +1034,7 @@ def npix2nside(npix): ---------- npix : int the number of pixels - + Returns ------- nside : int @@ -1055,7 +1043,7 @@ def npix2nside(npix): Notes ----- Raise a ValueError exception if number of pixel does not correspond to - the number of pixel of an healpix map. + the number of pixel of a healpix map. Examples -------- @@ -1071,12 +1059,9 @@ def npix2nside(npix): ... ValueError: Wrong pixel number (it is not 12*nside**2) """ - nside = np.sqrt(npix/12.) - if nside != np.floor(nside): + if not isnpixok(npix): raise ValueError("Wrong pixel number (it is not 12*nside**2)") - nside=int(np.floor(nside)) - check_nside(nside) - return nside + return int(np.sqrt(npix/12.)) def order2nside(order): """Give the nside parameter for the given resolution order. @@ -1110,12 +1095,14 @@ def order2nside(order): ValueError: 2147483648 is not a valid nside parameter (must be a power of 2, less than 2**30) """ nside = 1<>> import healpy as hp - >>> hp.isnsideok(13) + >>> hp.isnsideok(13, nest=True) False - + + >>> hp.isnsideok(13, nest=False) + True + >>> hp.isnsideok(32) True - >>> hp.isnsideok([1, 2, 3, 4, 8, 16]) + >>> hp.isnsideok([1, 2, 3, 4, 8, 16], nest=True) array([ True, True, False, True, True, True], dtype=bool) """ # we use standard bithacks from http://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2 if hasattr(nside, '__len__'): if not isinstance(nside, np.ndarray): nside = np.asarray(nside) - return ((nside == nside.astype(np.int)) & (0 < nside) & - (nside <= max_nside) & - ((nside.astype(np.int) & (nside.astype(np.int) - 1)) == 0)) + is_nside_ok = (nside == nside.astype(np.int)) & (nside > 0) & (nside <= max_nside) + if nest: + is_nside_ok &= (nside.astype(np.int) & (nside.astype(np.int) - 1)) == 0 else: - return (nside == int(nside) and 0 < nside <= max_nside and - (int(nside) & (int(nside) - 1)) == 0) + is_nside_ok = nside == int(nside) and 0 < nside <= max_nside + if nest: + is_nside_ok = is_nside_ok and (int(nside) & (int(nside) - 1)) == 0 + return is_nside_ok -def check_nside(nside): +def check_nside(nside, nest=False): """Raises exception is nside is not valid""" - if not np.all(isnsideok(nside)): + if not np.all(isnsideok(nside, nest=nest)): raise ValueError("%s is not a valid nside parameter (must be a power of 2, less than 2**30)" % str(nside)) def isnpixok(npix): @@ -1172,19 +1164,15 @@ def isnpixok(npix): >>> import healpy as hp >>> hp.isnpixok(12) True - + >>> hp.isnpixok(768) True >>> hp.isnpixok([12, 768, 1002]) array([ True, True, False], dtype=bool) """ - if hasattr(npix,'__len__'): - nside = np.sqrt(np.asarray(npix)/12.) - return isnsideok(nside) - else: - nside = np.sqrt(npix/12.) - return isnsideok(nside) + nside = np.sqrt(np.asarray(npix)/12.) + return nside == np.floor(nside) def get_interp_val(m,theta,phi,nest=False,lonlat=False): """Return the bi-linear interpolation value of a map using 4 nearest neighbours. @@ -1192,7 +1180,7 @@ def get_interp_val(m,theta,phi,nest=False,lonlat=False): Parameters ---------- m : array-like - an healpix map, accepts masked arrays + a healpix map, accepts masked arrays theta, phi : float, scalar or array-like angular coordinates of point at which to interpolate the map nest : bool @@ -1239,9 +1227,6 @@ def get_interp_val(m,theta,phi,nest=False,lonlat=False): del r return np.sum(m2[p]*w,0) -def get_neighbours(nside, theta, phi=None, nest=False): - raise NameError("get_neighbours has been renamed to get_interp_weights") - def get_interp_weights(nside,theta,phi=None,nest=False,lonlat=False): """Return the 4 closest pixels on the two rings above and below the location and corresponding weights. @@ -1291,8 +1276,8 @@ def get_interp_weights(nside,theta,phi=None,nest=False,lonlat=False): [ 0.25, 0. ], [ 0.25, 0. ]])) """ - check_nside(nside) - if phi == None: + check_nside(nside, nest=nest) + if phi is None: theta,phi = pix2ang(nside,theta,nest=nest) elif lonlat: theta,phi = lonlat2thetaphi(theta,phi) @@ -1344,7 +1329,7 @@ def get_all_neighbours(nside, theta, phi=None, nest=False, lonlat=False): >>> hp.get_all_neighbours(1, 90, 0, lonlat=True) array([ 8, 4, 0, -1, 1, 6, 9, -1]) """ - check_nside(nside) + check_nside(nside, nest=nest) if phi is not None: theta = ang2pix(nside, theta, phi, nest=nest, lonlat=lonlat) if nest: @@ -1374,7 +1359,7 @@ def max_pixrad(nside): >>> '%.15f' % max_pixrad(16) '0.066014761432513' """ - check_nside(nside) + check_nside(nside, nest=False) return pixlib._max_pixrad(nside) def fit_dipole(m, nest=False, bad=UNSEEN, gal_cut=0): @@ -1388,7 +1373,7 @@ def fit_dipole(m, nest=False, bad=UNSEEN, gal_cut=0): if ``False`` m is assumed in RING scheme, otherwise map is NESTED bad : float bad values of pixel, default to :const:`UNSEEN`. - gal_cut : float + gal_cut : float [degrees] pixels at latitude in [-gal_cut;+gal_cut] degrees are not taken into account Returns @@ -1459,7 +1444,7 @@ def remove_dipole(m,nest=False,bad=UNSEEN,gal_cut=0,fitval=False, if ``False`` m is assumed in RING scheme, otherwise map is NESTED bad : float bad values of pixel, default to :const:`UNSEEN`. - gal_cut : float + gal_cut : float [degrees] pixels at latitude in [-gal_cut;+gal_cut] are not taken into account fitval : bool whether to return or not the fitted values of monopole and dipole @@ -1472,7 +1457,7 @@ def remove_dipole(m,nest=False,bad=UNSEEN,gal_cut=0,fitval=False, ------- res : array or tuple of length 3 if fitval is False, returns map with monopole and dipole subtracted, - otherwise, returns map (array, in res[0]), monopole (float, in res[1]), + otherwise, returns map (array, in res[0]), monopole (float, in res[1]), dipole_vector (array, in res[2]) See Also @@ -1501,7 +1486,7 @@ def remove_dipole(m,nest=False,bad=UNSEEN,gal_cut=0,fitval=False, if verbose: from . import rotator as R lon,lat = R.vec2dir(dipole,lonlat=True) - amp = np.sqrt((dipole**2).sum()) + amp = np.sqrt((dipole*dipole).sum()) print( 'monopole: {0:g} dipole: lon: {1:g}, lat: {2:g}, amp: {3:g}' .format(mono, lon, lat, amp)) @@ -1523,7 +1508,7 @@ def fit_monopole(m,nest=False,bad=UNSEEN,gal_cut=0): if ``False`` m is assumed in RING scheme, otherwise map is NESTED bad : float bad values of pixel, default to :const:`UNSEEN`. - gal_cut : float + gal_cut : float [degrees] pixels at latitude in [-gal_cut;+gal_cut] degrees are not taken into account Returns @@ -1573,7 +1558,7 @@ def remove_monopole(m,nest=False,bad=UNSEEN,gal_cut=0,fitval=False, if ``False`` m is assumed in RING scheme, otherwise map is NESTED bad : float bad values of pixel, default to :const:`UNSEEN`. - gal_cut : float + gal_cut : float [degrees] pixels at latitude in [-gal_cut;+gal_cut] are not taken into account fitval : bool whether to return or not the fitted value of monopole @@ -1620,7 +1605,7 @@ def remove_monopole(m,nest=False,bad=UNSEEN,gal_cut=0,fitval=False, def get_map_size(m): """Returns the npix of a given map (implicit or explicit pixelization). - If map is a dict type, assumes explicit pixelization: use nside key if present, or use + If map is a dict type, assumes explicit pixelization: use nside key if present, or use nside attribute if present, otherwise use the smallest valid npix given the maximum key value. otherwise assumes implicit pixelization and returns len(m). @@ -1689,7 +1674,7 @@ def get_min_valid_nside(npix): 8 """ order = 0.5 * np.log2(npix / 12.) - return 2**int(np.ceil(order)) + return 1< nside_in: rat2 = npix_out//npix_in fact = np.ones(rat2, dtype=type_out)*ratio diff --git a/src/healpy/healpy/projaxes.py b/src/healpy/healpy/projaxes.py index a2dd4e2..3ec8b98 100644 --- a/src/healpy/healpy/projaxes.py +++ b/src/healpy/healpy/projaxes.py @@ -1,22 +1,22 @@ -# +# # This file is part of Healpy. -# +# # Healpy 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 2 of the License, or # (at your option) any later version. -# +# # Healpy 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 Healpy; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# +# # For more information about Healpy, see http://code.google.com/p/healpy -# +# from . import projector as P from . import rotator as R from . import pixelfunc @@ -43,7 +43,7 @@ class SphericalProjAxes(matplotlib.axes.Axes): define coordinate system. See rotator. coordprec : number of digit after floating point for coordinates display. format : format string for value display. - + Notes ----- Other keywords from Axes (see Axes). @@ -72,13 +72,13 @@ def __init__(self, ProjClass, *args, **kwds): self._gratdef = {} self._gratdef['local'] = False self._gratdef['dpar'] = 30. - + def set_format(self,f): """Set the format string for value display """ self._format=f return f - + def set_coordprec(self,n): """Set the number of digits after floating point for coord display. """ @@ -148,14 +148,14 @@ def projmap(self,map,vec2pix_func,vmin=None,vmax=None,badval=UNSEEN, coord : {'G', 'E', 'C', None} The coordinate system of the map ('G','E' or 'C'), rotate the map if different from the axes coord syst. - + Notes ----- Other keywords are transmitted to :func:`matplotlib.Axes.imshow` """ img = self.proj.projmap(map,vec2pix_func,rot=rot,coord=coord) - w = ~( np.isnan(img) | - np.isinf(img) | + w = ~( np.isnan(img) | + np.isinf(img) | pixelfunc.mask_bad(img, badval = badval) ) try: if vmin is None: vmin = img[w].min() @@ -186,12 +186,12 @@ def projplot(self,*args,**kwds): spherical projection. You can call this function as:: - + projplot(theta, phi) # plot a line going through points at coord (theta, phi) projplot(theta, phi, 'bo') # plot 'o' in blue at coord (theta, phi) projplot(thetaphi) # plot a line going through points at coord (thetaphi[0], thetaphi[1]) projplot(thetaphi, 'bx') # idem but with blue 'x' - + Parameters ---------- theta, phi : float, array-like @@ -271,9 +271,9 @@ def projplot(self,*args,**kwds): def projscatter(self,theta, phi=None,*args,**kwds): """Projscatter is a wrapper around :func:`matplotlib.Axes.scatter` to take into account the spherical projection. - + You can call this function as:: - + projscatter(theta, phi) # plot points at coord (theta, phi) projplot(thetaphi) # plot points at coord (thetaphi[0], thetaphi[1]) @@ -454,7 +454,7 @@ def get_meridian_interval(self, vx, vy=None, vz=None): def graticule(self,dpar=None,dmer=None,coord=None,local=None,verbose=True,**kwds): """Draw a graticule. - + Input: - dpar: angular separation between parallels in degree - dmer: angular separation between meridians in degree @@ -508,10 +508,10 @@ def graticule(self,dpar=None,dmer=None,coord=None,local=None,verbose=True,**kwds fmt = '-' equator=True elif abs(t) < 1.e-10: # special case: north pole - t = 1.e-10 + t = 1.e-10 fmt = '-' elif abs(t-pi) < 1.e-10: # special case: south pole - t = pi-1.e-10 + t = pi-1.e-10 fmt = '-' else: fmt =':' @@ -545,14 +545,14 @@ def graticule(self,dpar=None,dmer=None,coord=None,local=None,verbose=True,**kwds else: self._graticules = [(gratargs,gratkwds,gratlines)] return dpar,dmer - + def delgraticules(self): """Delete all graticules previously created on the Axes. """ if hasattr(self,'_graticules'): for dum1,dum2,g in self._graticules: for gl in g: - for l in gl: + for l in gl: if l in self.lines: self.lines.remove(l) else: @@ -590,7 +590,7 @@ def set_prec(d,n,nn=2): varcmin = (dmer/dtor-vdeg)*60. if verbose: print("The interval between meridians is {0:d} deg {1:.2f}'.".format(vdeg,varcmin)) return dpar,dmer - + class GnomonicAxes(SphericalProjAxes): """Define a gnomonic Axes to handle gnomonic projection. @@ -598,7 +598,7 @@ class GnomonicAxes(SphericalProjAxes): - rot=, coord= : define rotation and coordinate system. See rotator. - coordprec= : number of digit after floating point for coordinates display. - format= : format string for value display. - + Other keywords from Axes (see Axes). """ def __init__(self,*args,**kwds): @@ -611,7 +611,7 @@ def __init__(self,*args,**kwds): def projmap(self,map,vec2pix_func,xsize=200,ysize=None,reso=1.5,**kwds): self.proj.set_proj_plane_info(xsize=xsize,ysize=ysize,reso=reso) return super(GnomonicAxes,self).projmap(map,vec2pix_func,**kwds) - + class HpxGnomonicAxes(GnomonicAxes): def projmap(self,map,nest=False,**kwds): nside = pixelfunc.npix2nside(pixelfunc.get_map_size(map)) @@ -630,7 +630,7 @@ class MollweideAxes(SphericalProjAxes): - rot=, coord= : define rotation and coordinate system. See rotator. - coordprec= : number of digit after floating point for coordinates display. - format= : format string for value display. - + Other keywords from Axes (see Axes). """ def __init__(self,*args,**kwds): @@ -645,7 +645,7 @@ def projmap(self,map,vec2pix_func,xsize=800,**kwds): self.set_xlim(-2.01,2.01) self.set_ylim(-1.01,1.01) return img - + class HpxMollweideAxes(MollweideAxes): def projmap(self,map,nest=False,**kwds): nside = pixelfunc.npix2nside(pixelfunc.get_map_size(map)) @@ -661,26 +661,26 @@ def __init__(self,*args,**kwds): self._segment_threshold = 180 self._segment_step_rad = 0.1*pi/180 self._do_border = True - + def projmap(self,map,vec2pix_func,xsize=800,ysize=None,lonra=None,latra=None,**kwds): self.proj.set_proj_plane_info(xsize=xsize,ysize=ysize,lonra=lonra,latra=latra) return super(CartesianAxes,self).projmap(map,vec2pix_func,**kwds) - + class HpxCartesianAxes(CartesianAxes): def projmap(self,map,nest=False,**kwds): nside = pixelfunc.npix2nside(pixelfunc.get_map_size(map)) f = lambda x,y,z: pixelfunc.vec2pix(nside,x,y,z,nest=nest) return super(HpxCartesianAxes,self).projmap(map,f,**kwds) - + class OrthographicAxes(SphericalProjAxes): """Define an orthographic Axes to handle orthographic projection. - + Input: - rot=, coord= : define rotation and coordinate system. See rotator. - coordprec= : num of digits after floating point for coordinates display. - format= : format string for value display. - + Other keywords from Axes (see Axes). """ def __init__(self,*args,**kwds): @@ -688,7 +688,7 @@ def __init__(self,*args,**kwds): super(OrthographicAxes,self).__init__(P.OrthographicProj, *args,**kwds) self._segment_threshold = 0.01 self._do_border = False - + def projmap(self,map,vec2pix_func,xsize=800,half_sky=False,**kwds): self.proj.set_proj_plane_info(xsize=xsize,half_sky=half_sky) img = super(OrthographicAxes,self).projmap(map,vec2pix_func,**kwds) @@ -697,7 +697,7 @@ def projmap(self,map,vec2pix_func,xsize=800,half_sky=False,**kwds): self.set_xlim(-ratio,ratio) self.set_ylim(-1.01,1.01) return img - + class HpxOrthographicAxes(OrthographicAxes): def projmap(self,map,nest=False,**kwds): nside = pixelfunc.npix2nside(len(map)) @@ -738,7 +738,7 @@ def projmap(self,map,nest=False,**kwds): ################################################################### # # Table color for mollview, gnomview, and orthview. -# Currently defined for so that the default colormap, found in +# Currently defined for so that the default colormap, found in # matplotlib.rcParams['image.cmap'], the data is displayed with # values greater than vmax as the final element of the colormap, # masked indices gray, and the background set to white. @@ -753,7 +753,7 @@ def projmap(self,map,nest=False,**kwds): # it in situ: # >>> matplotlib.rcParam['image.cmap'] = 'coolwarm' # >>> hp.mollview(m) -# Note that custom colormaps can also be used, but they need to be +# Note that custom colormaps can also be used, but they need to be # registered ahead fo time, as shown in # http://matplotlib.org/examples/pylab_examples/custom_cmap.html @@ -773,12 +773,12 @@ def get_color_table(vmin,vmax,val,cmap=None,norm=None): norm.vmin = vmin norm.vmax = vmax norm.autoscale_None(val) - + return newcmap,norm def create_colormap(cmap): if cmap is not None: - return cmap + return cmap cmap0 = matplotlib.cm.get_cmap(matplotlib.rcParams['image.cmap']) if hasattr(cmap0, '_segmentdata'): newcm = matplotlib.colors.LinearSegmentedColormap('newcm',cmap0._segmentdata, @@ -877,7 +877,7 @@ def inverse(self, value): if vtype == 'scalar': result = result[0] return result - + def autoscale_None(self, val): changed = False if self.vmin is None: @@ -888,7 +888,7 @@ def autoscale_None(self, val): changed = True if changed or self.xval is None or self.yval is None: self._set_xyvals(val) - + def autoscale(self, val): self.vmin = val.min() self.vmax = val.max() @@ -900,6 +900,10 @@ def _set_xyvals(self,val): if data.mask is not np.ma.nomask: w = w|data.mask data2 = data.data[~w] + if data2.size < 3: + self.yval = np.array([0, 1], dtype=np.float) + self.xval = np.array([self.vmin, self.vmax], dtype=np.float) + return bins = min(data2.size//20, 5000) if bins < 3: bins=data2.size try: @@ -1010,7 +1014,7 @@ def inverse(self, value): - + ################################################################## # # A normalization class to get linear color table diff --git a/src/healpy/healpy/rotator.py b/src/healpy/healpy/rotator.py index 2c8a316..d0d825f 100644 --- a/src/healpy/healpy/rotator.py +++ b/src/healpy/healpy/rotator.py @@ -1,22 +1,22 @@ -# +# # This file is part of Healpy. -# +# # Healpy 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 2 of the License, or # (at your option) any later version. -# +# # Healpy 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 Healpy; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# +# # For more information about Healpy, see http://code.google.com/p/healpy -# +# import numpy as np import six import warnings @@ -34,7 +34,7 @@ class ConsistencyWarning(Warning): class Rotator(object): """Rotation operator, including astronomical coordinate systems. - This class provides tools for spherical rotations. It is meant to be used + This class provides tools for spherical rotations. It is meant to be used in the healpy library for plotting, and for this reason reflects the convention used in the Healpix IDL library. @@ -61,7 +61,7 @@ class Rotator(object): coordoutstr rots coords - + Examples -------- >>> r = Rotator(coord=['G','E']) # Transforms galactic to ecliptic coordinates @@ -96,9 +96,9 @@ def __init__(self,rot=None,coord=None,inv=None,deg=True, - eulertype: the convention for Euler angles in rot. Note: the coord system conversion is applied first, then the rotation. """ - rot_is_seq = (hasattr(rot,'__len__') + rot_is_seq = (hasattr(rot,'__len__') and hasattr(rot[0], '__len__')) - coord_is_seq = (hasattr(coord,'__len__') + coord_is_seq = (hasattr(coord,'__len__') and hasattr(coord[0],'__len__') and type(coord[0]) is not str) if rot_is_seq and coord_is_seq: @@ -134,7 +134,7 @@ def __init__(self,rot=None,coord=None,inv=None,deg=True, # rn[1] = -rn[1] cn = normalise_coord(c) self._rots.append(rn) # append(rn) or insert(0, rn) ? - self._coords.append(cn) # append(cn) or insert(0, cn) ? + self._coords.append(cn) # append(cn) or insert(0, cn) ? self._invs.append(bool(i)) if not self.consistent: warnings.warn("The chain of coord system rotations is not consistent", @@ -171,17 +171,17 @@ def __eq__(self,a): return ( np.array(v).all() and (self._coords == a._coords) and (self._invs == a._invs) ) - + def __call__(self,*args,**kwds): """Use the rotator to rotate either spherical coordinates (theta, phi) or a vector (x,y,z). You can use lonla keyword to use longitude, latitude - (in degree) instead of theta, phi (in radian). In this case, returns + (in degree) instead of theta, phi (in radian). In this case, returns longitude, latitude in degree. Accepted forms: r(x,y,z) # x,y,z either scalars or arrays - r(theta,phi) # theta, phi scalars or arrays + r(theta,phi) # theta, phi scalars or arrays r(lon,lat,lonlat=True) # lon, lat scalars or arrays r(vec) # vec 1-D array with 3 elements, or 2-D array 3xN r(direction) # direction 1-D array with 2 elements, or 2xN array @@ -229,7 +229,7 @@ def __mul__(self,a): coords = self._coords + a._coords invs = self._invs + a._invs return Rotator(rot=rots,coord=coords,inv=invs,deg=False) - + def __rmul__(self,b): if not isinstance(b,Rotator): raise TypeError("A Rotator can only be multiplied by another Rotator " @@ -256,7 +256,7 @@ def I(self,*args,**kwds): """ kwds['inv'] = True return self.__call__(*args,**kwds) - + @property def mat(self): """The matrix representing the rotation. @@ -298,13 +298,13 @@ def rots(self): """The sequence of rots defining the rotation. """ return self._rots - + @property def coords(self): """The sequence of coords defining the rotation. """ return self._coords - + def do_rot(self,i): """Returns True if rotation is not (close to) identity. """ @@ -371,7 +371,7 @@ def __repr__(self): def rotateVector(rotmat,vec,vy=None,vz=None, do_rot=True): """Rotate a vector (or a list of vectors) using the rotation matrix given as first argument. - + Parameters ---------- rotmat : float, array-like shape (3,3) @@ -408,13 +408,13 @@ def rotateVector(rotmat,vec,vy=None,vz=None, do_rot=True): def rotateDirection(rotmat,theta,phi=None,do_rot=True,lonlat=False): """Rotate the vector described by angles theta,phi using the rotation matrix given as first argument. - + Parameters ---------- rotmat : float, array-like shape (3,3) The rotation matrix theta : float, scalar or array-like - The angle theta (scalar or shape (N,)) + The angle theta (scalar or shape (N,)) or both angles (scalar or shape (2, N)) if phi is not given. phi : float, scalar or array-like, optionnal The angle phi (scalar or shape (N,)). @@ -423,7 +423,7 @@ def rotateDirection(rotmat,theta,phi=None,do_rot=True,lonlat=False): lonlat : bool If True, input angles are assumed to be longitude and latitude in degree, otherwise, they are co-latitude and longitude in radians. - + Returns ------- angles : float, array @@ -438,7 +438,7 @@ def rotateDirection(rotmat,theta,phi=None,do_rot=True,lonlat=False): def vec2dir(vec,vy=None,vz=None,lonlat=False): """Transform a vector to angle given by theta,phi. - + Parameters ---------- vec : float, scalar or array-like @@ -455,7 +455,7 @@ def vec2dir(vec,vy=None,vz=None,lonlat=False): Returns ------- angles : float, array - The angles (unit depending on *lonlat*) in an array of + The angles (unit depending on *lonlat*) in an array of shape (2,) (if scalar input) or (2, N) See Also @@ -484,23 +484,23 @@ def vec2dir(vec,vy=None,vz=None,lonlat=False): def dir2vec(theta,phi=None,lonlat=False): """Transform a direction theta,phi to a unit vector. - + Parameters ---------- theta : float, scalar or array-like - The angle theta (scalar or shape (N,)) + The angle theta (scalar or shape (N,)) or both angles (scalar or shape (2, N)) if phi is not given. phi : float, scalar or array-like, optionnal The angle phi (scalar or shape (N,)). lonlat : bool If True, input angles are assumed to be longitude and latitude in degree, otherwise, they are co-latitude and longitude in radians. - + Returns ------- vec : array The vector(s) corresponding to given angles, shape is (3,) or (3, N). - + See Also -------- :func:`vec2dir`, :func:`pixelfunc.ang2vec`, :func:`pixelfunc.vec2ang` @@ -630,7 +630,7 @@ def normalise_coord(coord): Coord sys are either 'E','G', 'C' or 'X' if undefined. Input: either a string or a sequence of string. - + Output: a tuple of two strings, each being one of the norm coord sys name above. @@ -668,9 +668,9 @@ def normalise_rot(rot,deg=False): def get_rotation_matrix(rot, deg=False, eulertype='ZYX'): """Return the rotation matrix corresponding to angles given in rot. - + Usage: matrot,do_rot,normrot = get_rotation_matrix(rot) - + Input: - rot: either None, an angle or a tuple of 1,2 or 3 angles corresponding to Euler angles. @@ -690,9 +690,9 @@ def get_rotation_matrix(rot, deg=False, eulertype='ZYX'): matrot=euler_matrix_new(rot[0],-rot[1],rot[2],Y=True) else: matrot=euler_matrix_new(rot[0],-rot[1],rot[2],ZYX=True) - + return matrot,do_rot,rot - + def get_coordconv_matrix(coord): """Return the rotation matrix corresponding to coord systems given in coord. @@ -709,38 +709,38 @@ def get_coordconv_matrix(coord): History: adapted from CGIS IDL library. """ - + coord_norm = normalise_coord(coord) - + if coord_norm[0] == coord_norm[1]: matconv = np.identity(3) - do_conv = False + do_conv = False else: eps = 23.452294 - 0.0130125 - 1.63889E-6 + 5.02778E-7 eps = eps * np.pi / 180. - + # ecliptic to galactic e2g = np.array([[-0.054882486, -0.993821033, -0.096476249], [ 0.494116468, -0.110993846, 0.862281440], [-0.867661702, -0.000346354, 0.497154957]]) - + # ecliptic to equatorial e2q = np.array([[1., 0. , 0. ], [0., np.cos( eps ), -1. * np.sin( eps )], [0., np.sin( eps ), np.cos( eps ) ]]) - + # galactic to ecliptic g2e = np.linalg.inv(e2g) - - # galactic to equatorial + + # galactic to equatorial g2q = np.dot(e2q , g2e) - + # equatorial to ecliptic q2e = np.linalg.inv(e2q) - + # equatorial to galactic q2g = np.dot(e2g , q2e) - + if coord_norm == ('E','G'): matconv = e2g elif coord_norm == ('G','E'): @@ -756,13 +756,13 @@ def get_coordconv_matrix(coord): else: raise ValueError('Wrong coord transform :',coord_norm) do_conv = True - + return matconv,do_conv,coord_norm ################################################### ## ## -## euler functions ## +## euler functions ## ## ## ###### ####### @@ -774,35 +774,35 @@ def euler(ai, bi, select, FK4 = 0): Transform between Galactic, celestial, and ecliptic coordinates. EXPLANATION: Use the procedure ASTRO to use this routine interactively - + CALLING SEQUENCE: - EULER, AI, BI, AO, BO, [ SELECT, /FK4, SELECT = ] - + EULER, AI, BI, AO, BO, [ SELECT, /FK4, SELECT = ] + INPUTS: - AI - Input Longitude in DEGREES, scalar or vector. If only two + AI - Input Longitude in DEGREES, scalar or vector. If only two parameters are supplied, then AI and BI will be modified to contain the output longitude and latitude. BI - Input Latitude in DEGREES - + OPTIONAL INPUT: SELECT - Integer (1-6) specifying type of coordinate transformation. - + SELECT From To | SELECT From To 1 RA-Dec (2000) Galactic | 4 Ecliptic RA-Dec 2 Galactic RA-DEC | 5 Ecliptic Galactic 3 RA-Dec Ecliptic | 6 Galactic Ecliptic - + If not supplied as a parameter or keyword, then EULER will prompt for the value of SELECT - Celestial coordinates (RA, Dec) should be given in equinox J2000 + Celestial coordinates (RA, Dec) should be given in equinox J2000 unless the /FK4 keyword is set. OUTPUTS: AO - Output Longitude in DEGREES BO - Output Latitude in DEGREES - + INPUT KEYWORD: - /FK4 - If this keyword is set and non-zero, then input and output + /FK4 - If this keyword is set and non-zero, then input and output celestial and ecliptic coordinates should be given in equinox B1950. /SELECT - The coordinate conversion integer (1-6) may @@ -833,48 +833,48 @@ def euler(ai, bi, select, FK4 = 0): twopi = 2.0*PI fourpi = 4.0*PI deg_to_rad = 180.0/PI - # + # # ; J2000 coordinate conversions are based on the following constants # ; (see the Hipparcos explanatory supplement). # ; eps = 23.4392911111 # Obliquity of the ecliptic # ; alphaG = 192.85948d Right Ascension of Galactic North Pole # ; deltaG = 27.12825d Declination of Galactic North Pole - # ; lomega = 32.93192d Galactic longitude of celestial equator + # ; lomega = 32.93192d Galactic longitude of celestial equator # ; alphaE = 180.02322d Ecliptic longitude of Galactic North Pole # ; deltaE = 29.811438523d Ecliptic latitude of Galactic North Pole # ; Eomega = 6.3839743d Galactic longitude of ecliptic equator - # + # if FK4 == 1: - - equinox = '(B1950)' + + equinox = '(B1950)' psi = [ 0.57595865315, 4.9261918136, 0.00000000000, 0.0000000000, - 0.11129056012, 4.7005372834] + 0.11129056012, 4.7005372834] stheta =[ 0.88781538514,-0.88781538514, 0.39788119938,-0.39788119938, - 0.86766174755,-0.86766174755] + 0.86766174755,-0.86766174755] ctheta =[ 0.46019978478, 0.46019978478, 0.91743694670, 0.91743694670, - 0.49715499774, 0.49715499774] + 0.49715499774, 0.49715499774] phi = [ 4.9261918136, 0.57595865315, 0.0000000000, 0.00000000000, 4.7005372834, 0.11129056012] else: - + equinox = '(J2000)' - psi = [ 0.57477043300, 4.9368292465, - 0.00000000000, 0.0000000000, - 0.11142137093, 4.71279419371] - stheta =[ 0.88998808748,-0.88998808748, - 0.39777715593,-0.39777715593, - 0.86766622025,-0.86766622025] - ctheta =[ 0.45598377618, 0.45598377618, - 0.91748206207, 0.91748206207, - 0.49714719172, 0.49714719172] - phi = [ 4.9368292465, 0.57477043300, - 0.0000000000, 0.00000000000, + psi = [ 0.57477043300, 4.9368292465, + 0.00000000000, 0.0000000000, + 0.11142137093, 4.71279419371] + stheta =[ 0.88998808748,-0.88998808748, + 0.39777715593,-0.39777715593, + 0.86766622025,-0.86766622025] + ctheta =[ 0.45598377618, 0.45598377618, + 0.91748206207, 0.91748206207, + 0.49714719172, 0.49714719172] + phi = [ 4.9368292465, 0.57477043300, + 0.0000000000, 0.00000000000, 4.71279419371, 0.11142137093] - # + # i = select - 1 # IDL offset a = ai/deg_to_rad - phi[i] b = bi/deg_to_rad @@ -899,7 +899,7 @@ def euler_matrix_new(a1,a2,a3,X=True,Y=False,ZYX=False,deg=False): computes the Euler matrix of an arbitrary rotation described by 3 Euler angles correct bugs present in Euler_Matrix - + CALLING SEQUENCE: result = euler_matrix_new (a1, a2, a3 [,X, Y, ZYX, DEG ]) @@ -913,21 +913,21 @@ def euler_matrix_new(a1,a2,a3,X=True,Y=False,ZYX=False,deg=False): KEYWORD PARAMETERS: DEG : if set the angle are measured in degree - X : rotation a1 around original Z - rotation a2 around interm X - rotation a3 around final Z + X : rotation a1 around original Z + rotation a2 around interm X + rotation a3 around final Z DEFAULT, classical mechanics convention - Y : rotation a1 around original Z - rotation a2 around interm Y - rotation a3 around final Z + Y : rotation a1 around original Z + rotation a2 around interm Y + rotation a3 around final Z quantum mechanics convention (override X) - ZYX : rotation a1 around original Z - rotation a2 around interm Y - rotation a3 around final X + ZYX : rotation a1 around original Z + rotation a2 around interm Y + rotation a3 around final X aeronautics convention (override X) - + * these last three keywords are obviously mutually exclusive * OUTPUTS: @@ -946,25 +946,25 @@ def euler_matrix_new(a1,a2,a3,X=True,Y=False,ZYX=False,deg=False): Y: M_new(a,b,c,/Y) = M_old(-a, b,-c,/Y) = Transpose( M_old(c,-b, a,/Y)) ZYX: M_new(a,b,c,/Z) = M_old(-a, b,-c,/Z) """ - + t_k = 0 if ZYX: t_k = t_k + 1 #if X: t_k = t_k + 1 if Y: t_k = t_k + 1 if t_k > 1: raise ValueError('Choose either X, Y or ZYX convention') - + convert = 1.0 if deg: convert = np.pi/180. - + c1 = np.cos(a1*convert) s1 = np.sin(a1*convert) c2 = np.cos(a2*convert) s2 = np.sin(a2*convert) c3 = np.cos(a3*convert) s3 = np.sin(a3*convert) - + if ZYX: m1 = np.array([[ c1,-s1, 0], [ s1, c1, 0], @@ -1004,7 +1004,56 @@ def euler_matrix_new(a1,a2,a3,X=True,Y=False,ZYX=False,deg=False): [ s3, c3, 0], [ 0, 0, 1]]) # around z - M = np.dot(m3.T,np.dot(m2.T,m1.T)) + M = np.dot(m3.T,np.dot(m2.T,m1.T)) return M +def coordsys2euler_zyz(coord): + """Return the ZYZ Euler angles corresponding to a rotation between + the two coordinate systems. The angles can be used in rotate_alm. + + Parameters + ---------- + coord : a tuple with initial and final coord systems. + See normalise_coord. + + Returns + ------- + psi, theta, phi : floats + The Euler angles defining a ZYZ rotation between the coordinate + systems. + + Examples + -------- + >>> np.array(coordsys2euler_zyz('GE')) + array([ 1.45937485, 1.05047962, -3.14119347]) + >>> np.array(coordsys2euler_zyz('CG')) + array([-0.22443941, 1.09730866, 2.14556934]) + >>> np.array(coordsys2euler_zyz('E')) + array([ 0., 0., 0.]) + """ + + coord_norm = normalise_coord(coord) + + if coord_norm[0] == coord_norm[1]: + psi, theta, phi = np.zeros(3) + else: + # Convert basis vectors + + xin, yin, zin = np.eye(3) + rot = Rotator(coord=coord_norm) + xout, yout, zout = rot([xin, yin, zin]).T + + # Normalize + + xout /= np.sqrt(np.dot(xout, xout)) + yout /= np.sqrt(np.dot(yout, yout)) + zout /= np.sqrt(np.dot(zout, zout)) + + # Get the angles + + psi = np.arctan2(yout[2], -xout[2]) + theta = np.arccos(np.dot(zin, zout)) + phi = np.arctan2(zout[1], zout[0]) + + return psi, theta, phi diff --git a/src/healpy/healpy/sphtfunc.py b/src/healpy/healpy/sphtfunc.py index 9732602..d059c76 100644 --- a/src/healpy/healpy/sphtfunc.py +++ b/src/healpy/healpy/sphtfunc.py @@ -1,22 +1,22 @@ -# +# # This file is part of Healpy. -# +# # Healpy 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 2 of the License, or # (at your option) any later version. -# +# # Healpy 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 Healpy; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# +# # For more information about Healpy, see http://code.google.com/p/healpy -# +# import warnings import numpy as np import six @@ -25,7 +25,6 @@ import astropy.io.fits as pf from . import _healpy_sph_transform_lib as sphtlib -from . import _healpy_fitsio_lib as hfitslib from . import _sphtools as _sphtools from . import cookbook as cb @@ -40,10 +39,10 @@ class FutureChangeWarning(UserWarning): DATAPATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data') # Spherical harmonics transformation -def anafast(map1, map2 = None, nspec = None, lmax = None, mmax = None, +def anafast(map1, map2 = None, nspec = None, lmax = None, mmax = None, iter = 3, alm = False, pol = True, use_weights = False, - datapath = None): - """Computes the power spectrum of an Healpix map, or the cross-spectrum + datapath = None, gal_cut = 0): + """Computes the power spectrum of a Healpix map, or the cross-spectrum between two maps if *map2* is given. No removal of monopole or dipole is performed. @@ -74,6 +73,8 @@ def anafast(map1, map2 = None, nspec = None, lmax = None, mmax = None, If there is only one input map, it has no effect. Default: True. datapath : None or str, optional If given, the directory where to find the weights data. + gal_cut : float [degrees] + pixels at latitude in [-gal_cut;+gal_cut] are not taken into account Returns ------- @@ -86,17 +87,17 @@ def anafast(map1, map2 = None, nspec = None, lmax = None, mmax = None, """ map1 = ma_to_array(map1) - alms1 = map2alm(map1, lmax = lmax, mmax = mmax, pol = pol, iter = iter, + alms1 = map2alm(map1, lmax = lmax, mmax = mmax, pol = pol, iter = iter, use_weights = use_weights, - datapath = datapath) + datapath = datapath, gal_cut = gal_cut) if map2 is not None: map2 = ma_to_array(map2) alms2 = map2alm(map2, lmax = lmax, mmax = mmax, pol = pol, - iter = iter, use_weights = use_weights, - datapath = datapath) + iter = iter, use_weights = use_weights, + datapath = datapath, gal_cut = gal_cut) else: alms2 = None - + cls = alm2cl(alms1, alms2 = alms2, lmax = lmax, mmax = mmax, lmax_out = lmax, nspec = nspec) @@ -108,10 +109,10 @@ def anafast(map1, map2 = None, nspec = None, lmax = None, mmax = None, else: return cls -def map2alm(maps, lmax = None, mmax = None, iter = 3, pol = True, - use_weights = False, datapath = None): - """Computes the alm of an Healpix map. - +def map2alm(maps, lmax = None, mmax = None, iter = 3, pol = True, + use_weights = False, datapath = None, gal_cut = 0): + """Computes the alm of a Healpix map. + Parameters ---------- maps : array-like, shape (Npix,) or (n, Npix) @@ -132,37 +133,39 @@ def map2alm(maps, lmax = None, mmax = None, iter = 3, pol = True, If True, use the ring weighting. Default: False. datapath : None or str, optional If given, the directory where to find the weights data. - + gal_cut : float [degrees] + pixels at latitude in [-gal_cut;+gal_cut] are not taken into account + Returns ------- alms : array or tuple of array alm or a tuple of 3 alm (almT, almE, almB) if polarized input. - + Notes ----- The pixels which have the special `UNSEEN` value are replaced by zeros before spherical harmonic transform. They are converted back to `UNSEEN` - value, so that the input maps are not modified. Each map have its own, + value, so that the input maps are not modified. Each map have its own, independent mask. """ maps = ma_to_array(maps) info = maptype(maps) if pol or info in (0, 1): - alms = _sphtools.map2alm(maps, niter = iter, + alms = _sphtools.map2alm(maps, niter = iter, datapath = datapath, use_weights = use_weights, - lmax = lmax, mmax = mmax) + lmax = lmax, mmax = mmax, gal_cut = gal_cut) else: # info >= 2 and pol is False : spin 0 spht for each map alms = [_sphtools.map2alm(mm, niter = iter, datapath = datapath, use_weights = use_weights, - lmax = lmax, mmax = mmax) + lmax = lmax, mmax = mmax, gal_cut = gal_cut) for mm in maps] - return alms + return np.array(alms) def alm2map(alms, nside, lmax = None, mmax = None, pixwin = False, fwhm = 0.0, sigma = None, pol = True, inplace = False, verbose=True): - """Computes an Healpix map given the alm. + """Computes a Healpix map given the alm. The alm are given as a complex array. You can specify lmax and mmax, or they will be computed from array size (assuming @@ -198,17 +201,17 @@ def alm2map(alms, nside, lmax = None, mmax = None, pixwin = False, smoothing (if alm(s) are complex128 contiguous arrays). Otherwise, input alms are not modified. A copy is made if needed to apply beam smoothing or pixel window. - + Returns ------- maps : array or list of arrays - An Healpix map in RING scheme at nside or a list of T,Q,U maps (if + A Healpix map in RING scheme at nside or a list of T,Q,U maps (if polarized input) """ if not cb.is_seq(alms): raise TypeError("alms must be a sequence") - alms = smoothalm(alms, fwhm = fwhm, sigma = sigma, + alms = smoothalm(alms, fwhm = fwhm, sigma = sigma, pol = pol, inplace = inplace, verbose=verbose) if not cb.is_seq_of_seq(alms): @@ -216,7 +219,7 @@ def alm2map(alms, nside, lmax = None, mmax = None, pixwin = False, lonely = True else: lonely = False - + if pixwin: pw = globals()['pixwin'](nside,True) alms_new = [] @@ -231,7 +234,7 @@ def alm2map(alms, nside, lmax = None, mmax = None, pixwin = False, if mmax is None: mmax = -1 if pol: - output = sphtlib._alm2map(alms_new[0] if lonely else alms_new, + output = sphtlib._alm2map(alms_new[0] if lonely else tuple(alms_new), nside, lmax = lmax, mmax = mmax) if lonely: output = [output] @@ -241,7 +244,7 @@ def alm2map(alms, nside, lmax = None, mmax = None, pixwin = False, if lonely: return output[0] else: - return output + return np.array(output) def synalm(cls, lmax = None, mmax = None, new = False, verbose=True): """Generate a set of alm given cl. @@ -264,12 +267,12 @@ def synalm(cls, lmax = None, mmax = None, new = False, verbose=True): If True, use the new ordering of cl's, ie by diagonal (e.g. TT, EE, BB, TE, EB, TB or TT, EE, BB, TE if 4 cl as input). If False, use the old ordering, ie by row - (e.g. TT, TE, TB, EE, EB, BB or TT, TE, EE, BB if 4 cl as input). + (e.g. TT, TE, TB, EE, EB, BB or TT, TE, EE, BB if 4 cl as input). Returns ------- alms : array or list of arrays - the generated alm if one spectrum is given, or a list of n alms + the generated alm if one spectrum is given, or a list of n alms (with n(n+1)/2 the number of input cl, or n=3 if there are 4 input cl). Notes @@ -311,14 +314,14 @@ def synalm(cls, lmax = None, mmax = None, new = False, verbose=True): # From here, we interpret cls as a list of spectra cls_list = list(cls) maxsize = max([len(c) for c in cls]) - + if lmax is None or lmax < 0: lmax = maxsize-1 if mmax is None or mmax < 0: mmax = lmax - + Nspec = sphtlib._getn(len(cls_list)) - + if Nspec <= 0: if len(cls_list) == 4: if new: ## new input order: TT EE BB TE -> TT EE BB TE 0 0 @@ -329,7 +332,7 @@ def synalm(cls, lmax = None, mmax = None, new = False, verbose=True): else: raise TypeError("The sequence of arrays must have either 4 elements " "or n(n+1)/2 elements (some may be None)") - + szalm = Alm.getsize(lmax,mmax) alms_list = [] for i in six.moves.xrange(Nspec): @@ -343,7 +346,7 @@ def synalm(cls, lmax = None, mmax = None, new = False, verbose=True): cls_list = [(np.asarray(cl, dtype = np.float64) if cl is not None else None) for cl in cls_list] sphtlib._synalm(cls_list, alms_list, lmax, mmax) - return alms_list + return np.array(alms_list) def synfast(cls, nside, lmax = None, mmax = None, alm = False, pol = True, pixwin = False, fwhm = 0.0, sigma = None, @@ -405,10 +408,10 @@ def synfast(cls, nside, lmax = None, mmax = None, alm = False, maps = alm2map(alms, nside, lmax = lmax, mmax = mmax, pixwin = pixwin, pol = pol, fwhm = fwhm, sigma = sigma, inplace = True, verbose=verbose) if alm: - return maps, alms + return np.array(maps), np.array(alms) else: - return maps - + return np.array(maps) + class Alm(object): """This class provides some static methods for alm index computation. @@ -425,7 +428,7 @@ def __init__(self): @staticmethod def getlm(lmax,i=None): """Get the l and m from index and lmax. - + Parameters ---------- lmax : int @@ -443,7 +446,7 @@ def getlm(lmax,i=None): @staticmethod def getidx(lmax,l,m): """Returns index corresponding to (l,m) in an array describing alm up to lmax. - + Parameters ---------- lmax : int @@ -483,7 +486,7 @@ def getsize(lmax,mmax = None): @staticmethod def getlmax(s, mmax = None): """Returns the lmax corresponding to a given array size. - + Parameters ---------- s : int @@ -534,7 +537,7 @@ def alm2cl(alms1, alms2 = None, lmax = None, mmax = None, Returns ------- cl : array or tuple of n(n+1)/2 arrays - the spectrum <*alm* x *alm2*> if *alm* (and *alm2*) is one alm, or + the spectrum <*alm* x *alm2*> if *alm* (and *alm2*) is one alm, or the auto- and cross-spectra <*alm*[i] x *alm2*[j]> if alm (and alm2) contains more than one spectra. If more than one spectrum is returned, they are ordered by diagonal. @@ -544,11 +547,11 @@ def alm2cl(alms1, alms2 = None, lmax = None, mmax = None, cls = _sphtools.alm2cl(alms1, alms2 = alms2, lmax = lmax, mmax = mmax, lmax_out = lmax_out) if nspec is None: - return cls + return np.array(cls) else: - return cls[:nspec] + return np.array(cls[:nspec]) + - def almxfl(alm, fl, mmax = None, inplace = False): """Multiply alm by a function of l. The function is assumed to be zero where not defined. @@ -567,9 +570,10 @@ def almxfl(alm, fl, mmax = None, inplace = False): Returns ------- alm : array - The modified alm, either a new array or a reference to input alm, + The modified alm, either a new array or a reference to input alm, if inplace is True. """ + # FIXME: Should handle multidimensional input almout = _sphtools.almxfl(alm, fl, mmax = mmax, inplace = inplace) return almout @@ -628,7 +632,7 @@ def smoothalm(alms, fwhm = 0.0, sigma = None, pol = True, if not cb.is_seq_of_seq(alms): alms = [alms] lonely = True - + # we have 3 alms -> apply smoothing to each map. # polarization has different B_l from temperature # exp{-[ell(ell+1) - s**2] * sigma**2/2} @@ -656,10 +660,10 @@ def smoothalm(alms, fwhm = 0.0, sigma = None, pol = True, # Case 2a: # at least one of the alm could not be smoothed in place: # return the list of alm - return retalm + return np.array(retalm) # Case 2b: # all smoothing have been performed in place: - # return the input alms + # return the input alms. If the input was a tuple, so will the output be. return alms @accept_ma @@ -676,14 +680,14 @@ def smoothing(map_in, fwhm = 0.0, sigma = None, pol = True, Either an array representing one map, or a sequence of 3 arrays representing 3 maps, accepts masked arrays fwhm : float, optional - The full width half max parameter of the Gaussian [in + The full width half max parameter of the Gaussian [in radians]. Default:0.0 sigma : float, optional The sigma of the Gaussian [in radians]. Override fwhm. pol : bool, optional If True, assumes input maps are TQU. Output will be TQU maps. (input must be 1 or 3 alms) - If False, each map is assumed to be a spin 0 map and is + If False, each map is assumed to be a spin 0 map and is treated independently (input can be any number of alms). If there is only one input map, it has no effect. Default: True. iter : int, scalar, optional @@ -709,13 +713,13 @@ def smoothing(map_in, fwhm = 0.0, sigma = None, pol = True, raise TypeError("map_in must be a sequence") # save the masks of inputs - masks = pixelfunc.mask_bad(map_in) + masks = pixelfunc.mask_bad(map_in) if cb.is_seq_of_seq(map_in): - nside = pixelfunc.npix2nside(len(map_in[0])) + nside = pixelfunc.get_nside(map_in) n_maps = len(map_in) else: - nside = pixelfunc.npix2nside(len(map_in)) + nside = pixelfunc.get_nside(map_in) n_maps = 0 if pol or n_maps in (0, 1): @@ -723,7 +727,7 @@ def smoothing(map_in, fwhm = 0.0, sigma = None, pol = True, alms = map2alm(map_in, lmax = lmax, mmax = mmax, iter = iter, pol = pol, use_weights = use_weights, datapath = datapath) - smoothalm(alms, fwhm = fwhm, sigma = sigma, + smoothalm(alms, fwhm = fwhm, sigma = sigma, inplace = True, verbose = verbose) output_map = alm2map(alms, nside, pixwin = False, verbose=verbose) else: @@ -732,15 +736,12 @@ def smoothing(map_in, fwhm = 0.0, sigma = None, pol = True, for m in map_in: alm = map2alm(m, lmax = lmax, mmax = mmax, iter = iter, pol = pol, use_weights = use_weights, datapath = datapath) - smoothalm(alm, fwhm = fwhm, sigma = sigma, + smoothalm(alm, fwhm = fwhm, sigma = sigma, inplace = True, verbose = verbose) output_map.append(alm2map(alm, nside, pixwin = False, verbose=verbose)) - if pixelfunc.maptype(output_map) == 0: - output_map[masks.flatten()] = UNSEEN - else: - for m, mask in zip(output_map, masks): - m[mask] = UNSEEN - + output_map = np.array(output_map) + output_map[masks] = UNSEEN + return output_map def pixwin(nside, pol = False): @@ -775,7 +776,7 @@ def pixwin(nside, pol = False): return pw_temp def alm2map_der1(alm, nside, lmax = None, mmax = None): - """Computes an Healpix map and its first derivatives given the alm. + """Computes a Healpix map and its first derivatives given the alm. The alm are given as a complex array. You can specify lmax and mmax, or they will be computed from array size (assuming @@ -802,7 +803,7 @@ def alm2map_der1(alm, nside, lmax = None, mmax = None): lmax = -1 if mmax is None: mmax = -1 - return sphtlib._alm2map_der1(alm,nside,lmax=lmax,mmax=mmax) + return np.array(sphtlib._alm2map_der1(alm,nside,lmax=lmax,mmax=mmax)) def new_to_old_spectra_order(cls_new_order): """Reorder the cls from new order (by diagonal) to old order (by row). @@ -842,12 +843,12 @@ def gauss_beam(fwhm, lmax=512, pol=False): Computes the spherical transform of an axisimmetric gaussian beam - For a sky of underlying power spectrum C(l) observed with beam of - given FWHM, the measured power spectrum will be + For a sky of underlying power spectrum C(l) observed with beam of + given FWHM, the measured power spectrum will be C(l)_meas = C(l) B(l)^2 - where B(l) is given by gaussbeam(Fwhm,Lmax). - The polarization beam is also provided (when pol = True ) assuming - a perfectly co-polarized beam + where B(l) is given by gaussbeam(Fwhm,Lmax). + The polarization beam is also provided (when pol = True ) assuming + a perfectly co-polarized beam (e.g., Challinor et al 2000, astro-ph/0008228) Parameters @@ -881,4 +882,4 @@ def gauss_beam(fwhm, lmax=512, pol=False): else: # polarization beam # polarization factors [1, 2 sigma^2, 2 sigma^2, sigma^2] pol_factor = np.exp([0., 2*sigma2, 2*sigma2, sigma2]) - return g[:, np.newaxis] * pol_factor + return g[:, np.newaxis] * pol_factor diff --git a/src/healpy/healpy/src/_healpy_fitsio_lib.cc b/src/healpy/healpy/src/_healpy_fitsio_lib.cc deleted file mode 100644 index 00544ba..0000000 --- a/src/healpy/healpy/src/_healpy_fitsio_lib.cc +++ /dev/null @@ -1,122 +0,0 @@ -/* - * This file is part of Healpy. - * - * Healpy 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 2 of the License, or - * (at your option) any later version. - * - * Healpy 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 Healpy; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * For more information about Healpy, see http://code.google.com/p/healpy - */ -/* - - This module provides Healpix functions to Python. - - It uses the healpix_cxx library. - -*/ - -#include - -#include -#include - -#include "numpy/arrayobject.h" - -#include "healpix_data_io.h" -#include "arr.h" -#include "_healpy_utils.h" - -/*********************************************************************** - healpy_pixwin - - input: nside, data_path, pol=False - - output: W(l), the pixel window function -*/ -static PyObject *healpy_pixwin(PyObject *self, PyObject *args, PyObject *kwds) -{ - int nside; - char * datapath=NULL; - int polarisation = 0; /* not polarised by default */ - - static const char* kwlist[] = {"","", "pol", NULL}; - - if (!PyArg_ParseTupleAndKeywords(args, kwds, "is|i", (char **)kwlist, - &nside, &datapath, &polarisation)) - return NULL; - - healpyAssertValue((nside&(nside-1))==0, - "Wrong nside value (must be a power of 2, less than 2**30)"); - - arr pw_temp, pw_pol; - read_pixwin(datapath, nside, pw_temp, pw_pol); - - npy_intp szpw; - - szpw = pw_temp.size(); - - PyArrayObject *pixwin_temp = - (PyArrayObject*)PyArray_SimpleNew(1, (npy_intp*)&szpw, PyArray_DOUBLE); - if( !pixwin_temp ) - return NULL; - - PyArrayObject *pixwin_pol = - (PyArrayObject*)PyArray_SimpleNew(1, (npy_intp*)&szpw, PyArray_DOUBLE); - if( !pixwin_pol ) - return NULL; - - for(int i=0; i= 3 -static PyModuleDef moduledef = { - PyModuleDef_HEAD_INIT, - "_healpy_sph_transform_lib", - NULL, -1, methods -}; -#endif - -PyMODINIT_FUNC -#if PY_MAJOR_VERSION < 3 -init_healpy_fitsio_lib(void) -#else -PyInit__healpy_fitsio_lib(void) -#endif -{ - import_array(); - -#if PY_MAJOR_VERSION < 3 - Py_InitModule("_healpy_fitsio_lib", methods); -#else - return PyModule_Create(&moduledef); -#endif -} diff --git a/src/healpy/healpy/src/_pixelfunc.cpp b/src/healpy/healpy/src/_pixelfunc.cpp index 6e2bfad..f4a7b1d 100644 --- a/src/healpy/healpy/src/_pixelfunc.cpp +++ b/src/healpy/healpy/src/_pixelfunc.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.24 */ +/* Generated by Cython 0.25.2 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,7 +7,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_24" +#define CYTHON_ABI "0_25_2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -29,6 +29,11 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) + #define HAVE_LONG_LONG + #endif +#endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif @@ -37,13 +42,110 @@ #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 #else #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif #endif -#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 - #define CYTHON_USE_PYLONG_INTERNALS 1 +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" @@ -79,24 +181,44 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif +#ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #else #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY @@ -110,6 +232,9 @@ #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif @@ -118,6 +243,13 @@ #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 @@ -146,6 +278,7 @@ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type @@ -184,18 +317,20 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif -#if PY_VERSION_HEX >= 0x030500B1 -#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods -#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) -#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; -} __Pyx_PyAsyncMethodsStruct; -#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif #else -#define __Pyx_PyType_AsAsync(obj) NULL + #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) @@ -208,13 +343,44 @@ typedef struct { #define CYTHON_RESTRICT #endif #endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef __cplusplus #error "Cython files generated with the C++ option must be compiled with a C++ compiler." #endif #ifndef CYTHON_INLINE - #define CYTHON_INLINE inline + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #else + #define CYTHON_INLINE inline + #endif #endif template void __Pyx_call_destructor(T& x) { @@ -226,7 +392,10 @@ class __Pyx_FakeReference { __Pyx_FakeReference() : ptr(NULL) { } __Pyx_FakeReference(const T& ref) : ptr(const_cast(&ref)) { } T *operator->() { return ptr; } + T *operator&() { return ptr; } operator T&() { return *ptr; } + template bool operator ==(U other) { return *ptr == other; } + template bool operator !=(U other) { return *ptr != other; } private: T *ptr; }; @@ -244,6 +413,11 @@ static CYTHON_INLINE float __PYX_NAN() { return value; } #endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif #define __PYX_ERR(f_index, lineno, Ln_error) \ @@ -269,9 +443,9 @@ static CYTHON_INLINE float __PYX_NAN() { #define __PYX_HAVE__healpy___pixelfunc #define __PYX_HAVE_API__healpy___pixelfunc -#include "string.h" -#include "stdio.h" -#include "stdlib.h" +#include +#include +#include #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" #include @@ -297,26 +471,6 @@ static CYTHON_INLINE float __PYX_NAN() { #define CYTHON_WITHOUT_ASSERTIONS #endif -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON -# define CYTHON_NCP_UNUSED -# else -# define CYTHON_NCP_UNUSED CYTHON_UNUSED -# endif -#endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; @@ -394,7 +548,7 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) @@ -502,7 +656,7 @@ static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; -/* None.proto */ +/* Header.proto */ #if !defined(CYTHON_CCOMPLEX) #if defined(__cplusplus) #define CYTHON_CCOMPLEX 1 @@ -568,7 +722,7 @@ typedef struct { } __Pyx_BufFmt_Context; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":725 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":725 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -577,7 +731,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":726 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":726 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -586,7 +740,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":727 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":727 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -595,7 +749,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":728 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":728 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -604,7 +758,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":732 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":732 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -613,7 +767,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":733 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":733 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -622,7 +776,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":734 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":734 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -631,7 +785,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":735 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":735 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -640,7 +794,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":739 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":739 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -649,7 +803,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":740 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":740 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -658,7 +812,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":749 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":749 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -667,7 +821,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":750 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":750 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -676,7 +830,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":751 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":751 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -685,7 +839,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":753 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":753 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -694,7 +848,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":754 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":754 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -703,7 +857,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":755 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":755 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -712,7 +866,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":757 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":757 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -721,7 +875,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -730,7 +884,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":760 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":760 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -739,7 +893,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":761 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":761 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -748,7 +902,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":762 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":762 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -783,7 +937,7 @@ typedef size_t __pyx_t_7_common_tsize; * cdef extern from "datatypes.h": */ typedef ptrdiff_t __pyx_t_7_common_tdiff; -/* None.proto */ +/* Declarations.proto */ #if CYTHON_CCOMPLEX #ifdef __cplusplus typedef ::std::complex< float > __pyx_t_float_complex; @@ -793,8 +947,9 @@ typedef ptrdiff_t __pyx_t_7_common_tdiff; #else typedef struct { float real, imag; } __pyx_t_float_complex; #endif +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); -/* None.proto */ +/* Declarations.proto */ #if CYTHON_CCOMPLEX #ifdef __cplusplus typedef ::std::complex< double > __pyx_t_double_complex; @@ -804,11 +959,12 @@ typedef ptrdiff_t __pyx_t_7_common_tdiff; #else typedef struct { double real, imag; } __pyx_t_double_complex; #endif +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); /*--- Type declarations ---*/ -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":764 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":764 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -817,7 +973,7 @@ typedef ptrdiff_t __pyx_t_7_common_tdiff; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":765 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":765 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -826,7 +982,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":766 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":766 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -835,7 +991,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":768 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":768 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -843,6 +999,18 @@ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; * cdef inline object PyArray_MultiIterNew1(a): */ typedef npy_cdouble __pyx_t_5numpy_complex_t; +struct __pyx_opt_args_6healpy_10_pixelfunc_isnsideok; + +/* "healpy/src/_pixelfunc.pyx":98 + * + * + * cdef bool isnsideok(int nside, bool nest=False): # <<<<<<<<<<<<<< + * return (nside > 0) and ((not nest) or ((nside&(nside-1))==0)) + */ +struct __pyx_opt_args_6healpy_10_pixelfunc_isnsideok { + int __pyx_n; + bool nest; +}; /* --- Runtime support code (head) --- */ /* Refnanny.proto */ @@ -909,7 +1077,7 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t; #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyObjectGetAttrStr.proto */ -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) @@ -960,7 +1128,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg #endif /* PyThreadStateGet.proto */ -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); #else @@ -969,7 +1137,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg #endif /* PyErrFetchRestore.proto */ -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_FAST_THREAD_STATE #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) @@ -996,24 +1164,6 @@ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); static void __Pyx_RaiseBufferIndexError(int axis); #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) -/* PyObjectCallMethO.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); -#endif - -/* PyObjectCallOneArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); - -/* PyNumberPow2.proto */ -#define __Pyx_PyNumber_InPlacePowerOf2(a, b, c) __Pyx__PyNumber_PowerOf2(a, b, c, 1) -#define __Pyx_PyNumber_PowerOf2(a, b, c) __Pyx__PyNumber_PowerOf2(a, b, c, 0) -static PyObject* __Pyx__PyNumber_PowerOf2(PyObject *two, PyObject *exp, PyObject *none, int inplace); - -/* WriteUnraisableException.proto */ -static void __Pyx_WriteUnraisable(const char *name, int clineno, - int lineno, const char *filename, - int full_traceback, int nogil); - /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { @@ -1044,6 +1194,33 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + #define __Pyx_BufPtrCContig1d(type, buf, i0, s0) ((type)buf + i0) /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); @@ -1097,10 +1274,7 @@ static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1}; /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value); -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); - -/* None.proto */ +/* RealImag.proto */ #if CYTHON_CCOMPLEX #ifdef __cplusplus #define __Pyx_CREAL(z) ((z).real()) @@ -1113,7 +1287,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); #define __Pyx_CREAL(z) ((z).real) #define __Pyx_CIMAG(z) ((z).imag) #endif -#if defined(__cplusplus) && CYTHON_CCOMPLEX && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) +#if defined(__cplusplus) && CYTHON_CCOMPLEX\ + && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) #define __Pyx_SET_CREAL(z,x) ((z).real(x)) #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) #else @@ -1121,88 +1296,85 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) #endif -/* None.proto */ -static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); - -/* None.proto */ +/* Arithmetic.proto */ #if CYTHON_CCOMPLEX - #define __Pyx_c_eqf(a, b) ((a)==(b)) - #define __Pyx_c_sumf(a, b) ((a)+(b)) - #define __Pyx_c_difff(a, b) ((a)-(b)) - #define __Pyx_c_prodf(a, b) ((a)*(b)) - #define __Pyx_c_quotf(a, b) ((a)/(b)) - #define __Pyx_c_negf(a) (-(a)) + #define __Pyx_c_eq_float(a, b) ((a)==(b)) + #define __Pyx_c_sum_float(a, b) ((a)+(b)) + #define __Pyx_c_diff_float(a, b) ((a)-(b)) + #define __Pyx_c_prod_float(a, b) ((a)*(b)) + #define __Pyx_c_quot_float(a, b) ((a)/(b)) + #define __Pyx_c_neg_float(a) (-(a)) #ifdef __cplusplus - #define __Pyx_c_is_zerof(z) ((z)==(float)0) - #define __Pyx_c_conjf(z) (::std::conj(z)) + #define __Pyx_c_is_zero_float(z) ((z)==(float)0) + #define __Pyx_c_conj_float(z) (::std::conj(z)) #if 1 - #define __Pyx_c_absf(z) (::std::abs(z)) - #define __Pyx_c_powf(a, b) (::std::pow(a, b)) + #define __Pyx_c_abs_float(z) (::std::abs(z)) + #define __Pyx_c_pow_float(a, b) (::std::pow(a, b)) #endif #else - #define __Pyx_c_is_zerof(z) ((z)==0) - #define __Pyx_c_conjf(z) (conjf(z)) + #define __Pyx_c_is_zero_float(z) ((z)==0) + #define __Pyx_c_conj_float(z) (conjf(z)) #if 1 - #define __Pyx_c_absf(z) (cabsf(z)) - #define __Pyx_c_powf(a, b) (cpowf(a, b)) + #define __Pyx_c_abs_float(z) (cabsf(z)) + #define __Pyx_c_pow_float(a, b) (cpowf(a, b)) #endif #endif #else - static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); - static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex); #if 1 - static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex); #endif #endif -/* None.proto */ -static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); - -/* None.proto */ +/* Arithmetic.proto */ #if CYTHON_CCOMPLEX - #define __Pyx_c_eq(a, b) ((a)==(b)) - #define __Pyx_c_sum(a, b) ((a)+(b)) - #define __Pyx_c_diff(a, b) ((a)-(b)) - #define __Pyx_c_prod(a, b) ((a)*(b)) - #define __Pyx_c_quot(a, b) ((a)/(b)) - #define __Pyx_c_neg(a) (-(a)) + #define __Pyx_c_eq_double(a, b) ((a)==(b)) + #define __Pyx_c_sum_double(a, b) ((a)+(b)) + #define __Pyx_c_diff_double(a, b) ((a)-(b)) + #define __Pyx_c_prod_double(a, b) ((a)*(b)) + #define __Pyx_c_quot_double(a, b) ((a)/(b)) + #define __Pyx_c_neg_double(a) (-(a)) #ifdef __cplusplus - #define __Pyx_c_is_zero(z) ((z)==(double)0) - #define __Pyx_c_conj(z) (::std::conj(z)) + #define __Pyx_c_is_zero_double(z) ((z)==(double)0) + #define __Pyx_c_conj_double(z) (::std::conj(z)) #if 1 - #define __Pyx_c_abs(z) (::std::abs(z)) - #define __Pyx_c_pow(a, b) (::std::pow(a, b)) + #define __Pyx_c_abs_double(z) (::std::abs(z)) + #define __Pyx_c_pow_double(a, b) (::std::pow(a, b)) #endif #else - #define __Pyx_c_is_zero(z) ((z)==0) - #define __Pyx_c_conj(z) (conj(z)) + #define __Pyx_c_is_zero_double(z) ((z)==0) + #define __Pyx_c_conj_double(z) (conj(z)) #if 1 - #define __Pyx_c_abs(z) (cabs(z)) - #define __Pyx_c_pow(a, b) (cpow(a, b)) + #define __Pyx_c_abs_double(z) (cabs(z)) + #define __Pyx_c_pow_double(a, b) (cpow(a, b)) #endif #endif #else - static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); - static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex); #if 1 - static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex); #endif #endif +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value); @@ -1284,7 +1456,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, cha /* Module declarations from '_common' */ /* Module declarations from 'healpy._pixelfunc' */ -static bool __pyx_f_6healpy_10_pixelfunc_isnsideok(int); /*proto*/ +static bool __pyx_f_6healpy_10_pixelfunc_isnsideok(int, struct __pyx_opt_args_6healpy_10_pixelfunc_isnsideok *__pyx_optional_args); /*proto*/ static __Pyx_TypeInfo __Pyx_TypeInfo_nn_int64 = { "int64", NULL, sizeof(int64), { 0 }, 0, IS_UNSIGNED(int64) ? 'U' : 'I', IS_UNSIGNED(int64), 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn_bool = { "bool", NULL, sizeof(bool), { 0 }, 0, IS_UNSIGNED(bool) ? 'U' : 'I', IS_UNSIGNED(bool), 0 }; @@ -1296,15 +1468,14 @@ int __pyx_module_is_main_healpy___pixelfunc = 0; /* Implementation of 'healpy._pixelfunc' */ static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_range; -static PyObject *__pyx_builtin_round; static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_builtin_ImportError; static const char __pyx_k_i[] = "i"; static const char __pyx_k_hb[] = "hb"; static const char __pyx_k_np[] = "np"; static const char __pyx_k_num[] = "num"; static const char __pyx_k_pix[] = "pix"; static const char __pyx_k_bool[] = "bool"; -static const char __pyx_k_log2[] = "log2"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_nest[] = "nest"; static const char __pyx_k_ring[] = "ring"; @@ -1317,7 +1488,6 @@ static const char __pyx_k_int64[] = "int64"; static const char __pyx_k_nside[] = "nside"; static const char __pyx_k_numpy[] = "numpy"; static const char __pyx_k_range[] = "range"; -static const char __pyx_k_round[] = "round"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_scheme[] = "scheme"; static const char __pyx_k_ringpix[] = "ringpix"; @@ -1328,6 +1498,7 @@ static const char __pyx_k_ringinfo[] = "ringinfo"; static const char __pyx_k_sintheta[] = "sintheta"; static const char __pyx_k_startpix[] = "startpix"; static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_ringinfo_line_9[] = "ringinfo (line 9)"; static const char __pyx_k_pix2ring_line_58[] = "pix2ring (line 58)"; @@ -1335,21 +1506,26 @@ static const char __pyx_k_healpy__pixelfunc[] = "healpy._pixelfunc"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; static const char __pyx_k_Get_information_for_rings_Rings[] = "Get information for rings\n\n Rings are specified by a positive integer, 1 <= ring <= 4*nside-1.\n\n Parameters\n ----------\n nside : int\n The healpix nside parameter, must be a power of 2, less than 2**30\n ring : int, scalar or array-like\n The ring number\n\n Returns\n -------\n startpix : int64, length equal to that of *ring*\n Starting pixel identifier (NEST ordering)\n ringpix : int64, length equal to that of *ring*\n Number of pixels in ring\n costheta : float, length equal to that of *ring*\n Cosine of the co-latitude\n sintheta : float, length equal to that of *ring*\n Sine of the co-latitude\n shifted : bool, length equal to that of *ring*\n If True, the center of the first pixel is not at phi=0\n\n Example\n -------\n >>> import healpy as hp\n >>> import numpy as np\n >>> nside = 2\n >>> hp.ringinfo(nside, np.arange(4*nside-1))\n (array([ 0, 0, 4, 12, 20, 28, 36]), array([0, 4, 8, 8, 8, 8, 8]), array([ 1. , 0.91666667, 0.66666667, 0.33333333, 0. ,\n -0.33333333, -0.66666667]), array([ 0. , 0.39965263, 0.74535599, 0.94280904, 1. ,\n 0.94280904, 0.74535599]), array([ True, True, True, False, True, False, True], dtype=bool))\n "; static const char __pyx_k_home_zonca_zonca_p_software_hea[] = "/home/zonca/zonca/p/software/healpy/healpy/src/_pixelfunc.pyx"; +static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; static const char __pyx_k_Convert_pixel_identifier_to_ring[] = "Convert pixel identifier to ring number\n\n Rings are specified by a positive integer, 1 <= ring <= 4*nside-1.\n\n Parameters\n ----------\n nside : int\n The healpix nside parameter, must be a power of 2, less than 2**30\n pix : int64, scalar or array-like\n The pixel identifier(s)\n nest : bool\n Is *pix* specified in the NEST ordering scheme?\n\n Returns\n -------\n ring : int, length equal to that of *pix*\n Ring number\n\n Example\n -------\n >>> import healpy as hp\n >>> import numpy as np\n >>> nside = 2\n >>> hp.pix2ring(nside, np.arange(hp.nside2npix(nside)))\n array([1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4,\n 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7,\n 7, 7])\n "; static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; static const char __pyx_k_Wrong_nside_value_must_be_a_powe[] = "Wrong nside value, must be a power of 2, less than 2**30"; static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; +static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static const char __pyx_k_Wrong_nside_value_must_be_a_powe_2[] = "Wrong nside value, must be a power of 2 (for nested), less than 2**30"; static PyObject *__pyx_kp_u_Convert_pixel_identifier_to_ring; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; static PyObject *__pyx_kp_u_Get_information_for_rings_Rings; +static PyObject *__pyx_n_s_ImportError; static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_kp_s_Wrong_nside_value_must_be_a_powe; +static PyObject *__pyx_kp_s_Wrong_nside_value_must_be_a_powe_2; static PyObject *__pyx_n_s_bool; static PyObject *__pyx_n_s_costheta; static PyObject *__pyx_n_s_dtype; @@ -1361,7 +1537,6 @@ static PyObject *__pyx_kp_s_home_zonca_zonca_p_software_hea; static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_int64; -static PyObject *__pyx_n_s_log2; static PyObject *__pyx_n_s_main; static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; @@ -1370,6 +1545,8 @@ static PyObject *__pyx_n_s_np; static PyObject *__pyx_n_s_nside; static PyObject *__pyx_n_s_num; static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to; +static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor; static PyObject *__pyx_n_s_pix; static PyObject *__pyx_n_s_pix2ring; static PyObject *__pyx_kp_u_pix2ring_line_58; @@ -1378,7 +1555,6 @@ static PyObject *__pyx_n_s_ring; static PyObject *__pyx_n_s_ringinfo; static PyObject *__pyx_kp_u_ringinfo_line_9; static PyObject *__pyx_n_s_ringpix; -static PyObject *__pyx_n_s_round; static PyObject *__pyx_n_s_scheme; static PyObject *__pyx_n_s_shifted; static PyObject *__pyx_n_s_sintheta; @@ -1390,7 +1566,6 @@ static PyObject *__pyx_pf_6healpy_10_pixelfunc_ringinfo(CYTHON_UNUSED PyObject * static PyObject *__pyx_pf_6healpy_10_pixelfunc_2pix2ring(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_nside, PyArrayObject *__pyx_v_pix, PyObject *__pyx_v_nest); /* proto */ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ -static PyObject *__pyx_int_2; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; @@ -1400,9 +1575,12 @@ static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; -static PyObject *__pyx_codeobj__10; -static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_codeobj__13; +static PyObject *__pyx_codeobj__15; /* "healpy/src/_pixelfunc.pyx":9 * from _common cimport int64, Healpix_Ordering_Scheme, RING, NEST, SET_NSIDE, T_Healpix_Base @@ -1502,26 +1680,28 @@ static PyObject *__pyx_pf_6healpy_10_pixelfunc_ringinfo(CYTHON_UNUSED PyObject * PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int64 __pyx_t_4; + bool __pyx_t_2; + struct __pyx_opt_args_6healpy_10_pixelfunc_isnsideok __pyx_t_3; + int __pyx_t_4; PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; + int64 __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; - PyArrayObject *__pyx_t_9 = NULL; - PyArrayObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; PyArrayObject *__pyx_t_11 = NULL; PyArrayObject *__pyx_t_12 = NULL; PyArrayObject *__pyx_t_13 = NULL; - npy_intp __pyx_t_14; - npy_intp __pyx_t_15; - Py_ssize_t __pyx_t_16; - Py_ssize_t __pyx_t_17; + PyArrayObject *__pyx_t_14 = NULL; + PyArrayObject *__pyx_t_15 = NULL; + npy_intp __pyx_t_16; + npy_intp __pyx_t_17; Py_ssize_t __pyx_t_18; Py_ssize_t __pyx_t_19; Py_ssize_t __pyx_t_20; Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; __Pyx_RefNannySetupContext("ringinfo", 0); __pyx_pybuffer_startpix.pybuffer.buf = NULL; __pyx_pybuffer_startpix.refcount = 0; @@ -1556,38 +1736,41 @@ static PyObject *__pyx_pf_6healpy_10_pixelfunc_ringinfo(CYTHON_UNUSED PyObject * /* "healpy/src/_pixelfunc.pyx":44 * 0.94280904, 0.74535599]), array([ True, True, True, False, True, False, True], dtype=bool)) * """ - * if not isnsideok(nside): # <<<<<<<<<<<<<< + * if not isnsideok(nside, nest=False): # <<<<<<<<<<<<<< * raise ValueError('Wrong nside value, must be a power of 2, less than 2**30') * cdef Healpix_Ordering_Scheme scheme = NEST */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_nside); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L1_error) - __pyx_t_2 = ((!(__pyx_f_6healpy_10_pixelfunc_isnsideok(__pyx_t_1) != 0)) != 0); - if (__pyx_t_2) { + __pyx_t_3.__pyx_n = 1; + __pyx_t_3.nest = 0; + __pyx_t_2 = __pyx_f_6healpy_10_pixelfunc_isnsideok(__pyx_t_1, &__pyx_t_3); + __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_4) { /* "healpy/src/_pixelfunc.pyx":45 * """ - * if not isnsideok(nside): + * if not isnsideok(nside, nest=False): * raise ValueError('Wrong nside value, must be a power of 2, less than 2**30') # <<<<<<<<<<<<<< * cdef Healpix_Ordering_Scheme scheme = NEST * cdef T_Healpix_Base[int64] hb = T_Healpix_Base[int64](nside, scheme, SET_NSIDE) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(0, 45, __pyx_L1_error) /* "healpy/src/_pixelfunc.pyx":44 * 0.94280904, 0.74535599]), array([ True, True, True, False, True, False, True], dtype=bool)) * """ - * if not isnsideok(nside): # <<<<<<<<<<<<<< + * if not isnsideok(nside, nest=False): # <<<<<<<<<<<<<< * raise ValueError('Wrong nside value, must be a power of 2, less than 2**30') * cdef Healpix_Ordering_Scheme scheme = NEST */ } /* "healpy/src/_pixelfunc.pyx":46 - * if not isnsideok(nside): + * if not isnsideok(nside, nest=False): * raise ValueError('Wrong nside value, must be a power of 2, less than 2**30') * cdef Healpix_Ordering_Scheme scheme = NEST # <<<<<<<<<<<<<< * cdef T_Healpix_Base[int64] hb = T_Healpix_Base[int64](nside, scheme, SET_NSIDE) @@ -1602,8 +1785,8 @@ static PyObject *__pyx_pf_6healpy_10_pixelfunc_ringinfo(CYTHON_UNUSED PyObject * * num = ring.shape[0] * cdef np.ndarray[int64, ndim=1] startpix = np.empty(num, dtype=np.int64) */ - __pyx_t_4 = __Pyx_PyInt_As_int64(__pyx_v_nside); if (unlikely((__pyx_t_4 == (int64)-1) && PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L1_error) - __pyx_v_hb = T_Healpix_Base (__pyx_t_4, __pyx_v_scheme, SET_NSIDE); + __pyx_t_6 = __Pyx_PyInt_As_int64(__pyx_v_nside); if (unlikely((__pyx_t_6 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L1_error) + __pyx_v_hb = T_Healpix_Base (__pyx_t_6, __pyx_v_scheme, SET_NSIDE); /* "healpy/src/_pixelfunc.pyx":48 * cdef Healpix_Ordering_Scheme scheme = NEST @@ -1621,45 +1804,45 @@ static PyObject *__pyx_pf_6healpy_10_pixelfunc_ringinfo(CYTHON_UNUSED PyObject * * cdef np.ndarray[int64, ndim=1] ringpix = np.empty(num, dtype=np.int64) * cdef np.ndarray[double, ndim=1] costheta = np.empty(num, dtype=np.float) */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_num); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 49, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_num); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int64); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 49, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 49, __pyx_L1_error) - __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_11 = ((PyArrayObject *)__pyx_t_10); { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_startpix.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_startpix.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_startpix = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_startpix.rcbuffer->pybuffer.buf = NULL; __PYX_ERR(0, 49, __pyx_L1_error) } else {__pyx_pybuffernd_startpix.diminfo[0].strides = __pyx_pybuffernd_startpix.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_startpix.diminfo[0].shape = __pyx_pybuffernd_startpix.rcbuffer->pybuffer.shape[0]; } } - __pyx_t_9 = 0; - __pyx_v_startpix = ((PyArrayObject *)__pyx_t_8); - __pyx_t_8 = 0; + __pyx_t_11 = 0; + __pyx_v_startpix = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; /* "healpy/src/_pixelfunc.pyx":50 * num = ring.shape[0] @@ -1668,45 +1851,45 @@ static PyObject *__pyx_pf_6healpy_10_pixelfunc_ringinfo(CYTHON_UNUSED PyObject * * cdef np.ndarray[double, ndim=1] costheta = np.empty(num, dtype=np.float) * cdef np.ndarray[double, ndim=1] sintheta = np.empty(num, dtype=np.float) */ - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 50, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_num); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 50, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 50, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 50, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_num); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 50, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 50, __pyx_L1_error) - __pyx_t_10 = ((PyArrayObject *)__pyx_t_7); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_t_12 = ((PyArrayObject *)__pyx_t_9); { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ringpix.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ringpix.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_ringpix = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ringpix.rcbuffer->pybuffer.buf = NULL; __PYX_ERR(0, 50, __pyx_L1_error) } else {__pyx_pybuffernd_ringpix.diminfo[0].strides = __pyx_pybuffernd_ringpix.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ringpix.diminfo[0].shape = __pyx_pybuffernd_ringpix.rcbuffer->pybuffer.shape[0]; } } - __pyx_t_10 = 0; - __pyx_v_ringpix = ((PyArrayObject *)__pyx_t_7); - __pyx_t_7 = 0; + __pyx_t_12 = 0; + __pyx_v_ringpix = ((PyArrayObject *)__pyx_t_9); + __pyx_t_9 = 0; /* "healpy/src/_pixelfunc.pyx":51 * cdef np.ndarray[int64, ndim=1] startpix = np.empty(num, dtype=np.int64) @@ -1715,45 +1898,45 @@ static PyObject *__pyx_pf_6healpy_10_pixelfunc_ringinfo(CYTHON_UNUSED PyObject * * cdef np.ndarray[double, ndim=1] sintheta = np.empty(num, dtype=np.float) * cdef np.ndarray[bool, ndim=1, cast=True] shifted = np.empty(num, dtype=np.bool) */ - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 51, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_num); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_num); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 51, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 51, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 51, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 51, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 51, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 51, __pyx_L1_error) - __pyx_t_11 = ((PyArrayObject *)__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_13 = ((PyArrayObject *)__pyx_t_7); { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_costheta.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_costheta.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_costheta = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_costheta.rcbuffer->pybuffer.buf = NULL; __PYX_ERR(0, 51, __pyx_L1_error) } else {__pyx_pybuffernd_costheta.diminfo[0].strides = __pyx_pybuffernd_costheta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_costheta.diminfo[0].shape = __pyx_pybuffernd_costheta.rcbuffer->pybuffer.shape[0]; } } - __pyx_t_11 = 0; - __pyx_v_costheta = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; + __pyx_t_13 = 0; + __pyx_v_costheta = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; /* "healpy/src/_pixelfunc.pyx":52 * cdef np.ndarray[int64, ndim=1] ringpix = np.empty(num, dtype=np.int64) @@ -1762,45 +1945,45 @@ static PyObject *__pyx_pf_6healpy_10_pixelfunc_ringinfo(CYTHON_UNUSED PyObject * * cdef np.ndarray[bool, ndim=1, cast=True] shifted = np.empty(num, dtype=np.bool) * for i in range(num): */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_num); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_num); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_float); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 52, __pyx_L1_error) - __pyx_t_12 = ((PyArrayObject *)__pyx_t_3); + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_14 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sintheta.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sintheta.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_sintheta = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_sintheta.rcbuffer->pybuffer.buf = NULL; __PYX_ERR(0, 52, __pyx_L1_error) } else {__pyx_pybuffernd_sintheta.diminfo[0].strides = __pyx_pybuffernd_sintheta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sintheta.diminfo[0].shape = __pyx_pybuffernd_sintheta.rcbuffer->pybuffer.shape[0]; } } - __pyx_t_12 = 0; - __pyx_v_sintheta = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_14 = 0; + __pyx_v_sintheta = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; /* "healpy/src/_pixelfunc.pyx":53 * cdef np.ndarray[double, ndim=1] costheta = np.empty(num, dtype=np.float) @@ -1809,45 +1992,45 @@ static PyObject *__pyx_pf_6healpy_10_pixelfunc_ringinfo(CYTHON_UNUSED PyObject * * for i in range(num): * hb.get_ring_info(ring[i], startpix[i], ringpix[i], costheta[i], sintheta[i], shifted[i]) */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_num); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 53, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_bool); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_num); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_bool); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 53, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 53, __pyx_L1_error) - __pyx_t_13 = ((PyArrayObject *)__pyx_t_8); + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_15 = ((PyArrayObject *)__pyx_t_10); { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_shifted.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn_bool, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) { + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_shifted.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn_bool, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) { __pyx_v_shifted = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_shifted.rcbuffer->pybuffer.buf = NULL; __PYX_ERR(0, 53, __pyx_L1_error) } else {__pyx_pybuffernd_shifted.diminfo[0].strides = __pyx_pybuffernd_shifted.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_shifted.diminfo[0].shape = __pyx_pybuffernd_shifted.rcbuffer->pybuffer.shape[0]; } } - __pyx_t_13 = 0; - __pyx_v_shifted = ((PyArrayObject *)__pyx_t_8); - __pyx_t_8 = 0; + __pyx_t_15 = 0; + __pyx_v_shifted = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; /* "healpy/src/_pixelfunc.pyx":54 * cdef np.ndarray[double, ndim=1] sintheta = np.empty(num, dtype=np.float) @@ -1856,9 +2039,9 @@ static PyObject *__pyx_pf_6healpy_10_pixelfunc_ringinfo(CYTHON_UNUSED PyObject * * hb.get_ring_info(ring[i], startpix[i], ringpix[i], costheta[i], sintheta[i], shifted[i]) * return startpix, ringpix, costheta, sintheta, shifted */ - __pyx_t_14 = __pyx_v_num; - for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { - __pyx_v_i = __pyx_t_15; + __pyx_t_16 = __pyx_v_num; + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { + __pyx_v_i = __pyx_t_17; /* "healpy/src/_pixelfunc.pyx":55 * cdef np.ndarray[bool, ndim=1, cast=True] shifted = np.empty(num, dtype=np.bool) @@ -1867,32 +2050,12 @@ static PyObject *__pyx_pf_6healpy_10_pixelfunc_ringinfo(CYTHON_UNUSED PyObject * * return startpix, ringpix, costheta, sintheta, shifted * */ - __pyx_t_16 = __pyx_v_i; - __pyx_t_1 = -1; - if (__pyx_t_16 < 0) { - __pyx_t_16 += __pyx_pybuffernd_ring.diminfo[0].shape; - if (unlikely(__pyx_t_16 < 0)) __pyx_t_1 = 0; - } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_ring.diminfo[0].shape)) __pyx_t_1 = 0; - if (unlikely(__pyx_t_1 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_1); - __PYX_ERR(0, 55, __pyx_L1_error) - } - __pyx_t_17 = __pyx_v_i; - __pyx_t_1 = -1; - if (__pyx_t_17 < 0) { - __pyx_t_17 += __pyx_pybuffernd_startpix.diminfo[0].shape; - if (unlikely(__pyx_t_17 < 0)) __pyx_t_1 = 0; - } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_startpix.diminfo[0].shape)) __pyx_t_1 = 0; - if (unlikely(__pyx_t_1 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_1); - __PYX_ERR(0, 55, __pyx_L1_error) - } __pyx_t_18 = __pyx_v_i; __pyx_t_1 = -1; if (__pyx_t_18 < 0) { - __pyx_t_18 += __pyx_pybuffernd_ringpix.diminfo[0].shape; + __pyx_t_18 += __pyx_pybuffernd_ring.diminfo[0].shape; if (unlikely(__pyx_t_18 < 0)) __pyx_t_1 = 0; - } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_ringpix.diminfo[0].shape)) __pyx_t_1 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_ring.diminfo[0].shape)) __pyx_t_1 = 0; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); __PYX_ERR(0, 55, __pyx_L1_error) @@ -1900,9 +2063,9 @@ static PyObject *__pyx_pf_6healpy_10_pixelfunc_ringinfo(CYTHON_UNUSED PyObject * __pyx_t_19 = __pyx_v_i; __pyx_t_1 = -1; if (__pyx_t_19 < 0) { - __pyx_t_19 += __pyx_pybuffernd_costheta.diminfo[0].shape; + __pyx_t_19 += __pyx_pybuffernd_startpix.diminfo[0].shape; if (unlikely(__pyx_t_19 < 0)) __pyx_t_1 = 0; - } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_costheta.diminfo[0].shape)) __pyx_t_1 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_startpix.diminfo[0].shape)) __pyx_t_1 = 0; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); __PYX_ERR(0, 55, __pyx_L1_error) @@ -1910,9 +2073,9 @@ static PyObject *__pyx_pf_6healpy_10_pixelfunc_ringinfo(CYTHON_UNUSED PyObject * __pyx_t_20 = __pyx_v_i; __pyx_t_1 = -1; if (__pyx_t_20 < 0) { - __pyx_t_20 += __pyx_pybuffernd_sintheta.diminfo[0].shape; + __pyx_t_20 += __pyx_pybuffernd_ringpix.diminfo[0].shape; if (unlikely(__pyx_t_20 < 0)) __pyx_t_1 = 0; - } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_sintheta.diminfo[0].shape)) __pyx_t_1 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_ringpix.diminfo[0].shape)) __pyx_t_1 = 0; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); __PYX_ERR(0, 55, __pyx_L1_error) @@ -1920,14 +2083,34 @@ static PyObject *__pyx_pf_6healpy_10_pixelfunc_ringinfo(CYTHON_UNUSED PyObject * __pyx_t_21 = __pyx_v_i; __pyx_t_1 = -1; if (__pyx_t_21 < 0) { - __pyx_t_21 += __pyx_pybuffernd_shifted.diminfo[0].shape; + __pyx_t_21 += __pyx_pybuffernd_costheta.diminfo[0].shape; if (unlikely(__pyx_t_21 < 0)) __pyx_t_1 = 0; - } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_shifted.diminfo[0].shape)) __pyx_t_1 = 0; + } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_costheta.diminfo[0].shape)) __pyx_t_1 = 0; + if (unlikely(__pyx_t_1 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_1); + __PYX_ERR(0, 55, __pyx_L1_error) + } + __pyx_t_22 = __pyx_v_i; + __pyx_t_1 = -1; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_pybuffernd_sintheta.diminfo[0].shape; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_1 = 0; + } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_sintheta.diminfo[0].shape)) __pyx_t_1 = 0; + if (unlikely(__pyx_t_1 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_1); + __PYX_ERR(0, 55, __pyx_L1_error) + } + __pyx_t_23 = __pyx_v_i; + __pyx_t_1 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_pybuffernd_shifted.diminfo[0].shape; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_1 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_shifted.diminfo[0].shape)) __pyx_t_1 = 0; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); __PYX_ERR(0, 55, __pyx_L1_error) } - __pyx_v_hb.get_ring_info((*__Pyx_BufPtrStrided1d(int64 *, __pyx_pybuffernd_ring.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_ring.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(int64 *, __pyx_pybuffernd_startpix.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_startpix.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(int64 *, __pyx_pybuffernd_ringpix.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ringpix.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_costheta.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_costheta.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_sintheta.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_sintheta.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(bool *, __pyx_pybuffernd_shifted.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_shifted.diminfo[0].strides))); + __pyx_v_hb.get_ring_info((*__Pyx_BufPtrStrided1d(int64 *, __pyx_pybuffernd_ring.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ring.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(int64 *, __pyx_pybuffernd_startpix.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_startpix.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(int64 *, __pyx_pybuffernd_ringpix.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_ringpix.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_costheta.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_costheta.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_sintheta.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_sintheta.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(bool *, __pyx_pybuffernd_shifted.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_shifted.diminfo[0].strides))); } /* "healpy/src/_pixelfunc.pyx":56 @@ -1938,25 +2121,25 @@ static PyObject *__pyx_pf_6healpy_10_pixelfunc_ringinfo(CYTHON_UNUSED PyObject * * def pix2ring(nside, np.ndarray[int64, ndim=1] pix not None, nest=False): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 56, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = PyTuple_New(5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(((PyObject *)__pyx_v_startpix)); __Pyx_GIVEREF(((PyObject *)__pyx_v_startpix)); - PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_startpix)); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_startpix)); __Pyx_INCREF(((PyObject *)__pyx_v_ringpix)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ringpix)); - PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)__pyx_v_ringpix)); + PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_v_ringpix)); __Pyx_INCREF(((PyObject *)__pyx_v_costheta)); __Pyx_GIVEREF(((PyObject *)__pyx_v_costheta)); - PyTuple_SET_ITEM(__pyx_t_8, 2, ((PyObject *)__pyx_v_costheta)); + PyTuple_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_v_costheta)); __Pyx_INCREF(((PyObject *)__pyx_v_sintheta)); __Pyx_GIVEREF(((PyObject *)__pyx_v_sintheta)); - PyTuple_SET_ITEM(__pyx_t_8, 3, ((PyObject *)__pyx_v_sintheta)); + PyTuple_SET_ITEM(__pyx_t_10, 3, ((PyObject *)__pyx_v_sintheta)); __Pyx_INCREF(((PyObject *)__pyx_v_shifted)); __Pyx_GIVEREF(((PyObject *)__pyx_v_shifted)); - PyTuple_SET_ITEM(__pyx_t_8, 4, ((PyObject *)__pyx_v_shifted)); - __pyx_r = __pyx_t_8; - __pyx_t_8 = 0; + PyTuple_SET_ITEM(__pyx_t_10, 4, ((PyObject *)__pyx_v_shifted)); + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; goto __pyx_L0; /* "healpy/src/_pixelfunc.pyx":9 @@ -1969,11 +2152,11 @@ static PyObject *__pyx_pf_6healpy_10_pixelfunc_ringinfo(CYTHON_UNUSED PyObject * /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -2092,7 +2275,6 @@ static PyObject *__pyx_pw_6healpy_10_pixelfunc_3pix2ring(PyObject *__pyx_self, P } static PyObject *__pyx_pf_6healpy_10_pixelfunc_2pix2ring(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_nside, PyArrayObject *__pyx_v_pix, PyObject *__pyx_v_nest) { - enum Healpix_Ordering_Scheme __pyx_v_scheme; T_Healpix_Base __pyx_v_hb; npy_intp __pyx_v_num; PyArrayObject *__pyx_v_ring = 0; @@ -2104,18 +2286,22 @@ static PyObject *__pyx_pf_6healpy_10_pixelfunc_2pix2ring(CYTHON_UNUSED PyObject PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int64 __pyx_t_4; - PyObject *__pyx_t_5 = NULL; + bool __pyx_t_2; + bool __pyx_t_3; + struct __pyx_opt_args_6healpy_10_pixelfunc_isnsideok __pyx_t_4; + int __pyx_t_5; PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyArrayObject *__pyx_t_9 = NULL; - npy_intp __pyx_t_10; - npy_intp __pyx_t_11; - Py_ssize_t __pyx_t_12; - Py_ssize_t __pyx_t_13; + int64 __pyx_t_7; + enum Healpix_Ordering_Scheme __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyArrayObject *__pyx_t_13 = NULL; + npy_intp __pyx_t_14; + npy_intp __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; __Pyx_RefNannySetupContext("pix2ring", 0); __pyx_pybuffer_ring.pybuffer.buf = NULL; __pyx_pybuffer_ring.refcount = 0; @@ -2134,185 +2320,154 @@ static PyObject *__pyx_pf_6healpy_10_pixelfunc_2pix2ring(CYTHON_UNUSED PyObject /* "healpy/src/_pixelfunc.pyx":88 * """ * - * if not isnsideok(nside): # <<<<<<<<<<<<<< - * raise ValueError('Wrong nside value, must be a power of 2, less than 2**30') - * cdef Healpix_Ordering_Scheme scheme + * if not isnsideok(nside, nest=nest): # <<<<<<<<<<<<<< + * raise ValueError('Wrong nside value, must be a power of 2 (for nested), less than 2**30') + * cdef T_Healpix_Base[int64] hb = T_Healpix_Base[int64](nside, NEST if nest else RING, SET_NSIDE) */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_nside); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) - __pyx_t_2 = ((!(__pyx_f_6healpy_10_pixelfunc_isnsideok(__pyx_t_1) != 0)) != 0); - if (__pyx_t_2) { + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_nest); if (unlikely((__pyx_t_2 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_4.__pyx_n = 1; + __pyx_t_4.nest = __pyx_t_2; + __pyx_t_3 = __pyx_f_6healpy_10_pixelfunc_isnsideok(__pyx_t_1, &__pyx_t_4); + __pyx_t_5 = ((!(__pyx_t_3 != 0)) != 0); + if (__pyx_t_5) { /* "healpy/src/_pixelfunc.pyx":89 * - * if not isnsideok(nside): - * raise ValueError('Wrong nside value, must be a power of 2, less than 2**30') # <<<<<<<<<<<<<< - * cdef Healpix_Ordering_Scheme scheme - * if nest: + * if not isnsideok(nside, nest=nest): + * raise ValueError('Wrong nside value, must be a power of 2 (for nested), less than 2**30') # <<<<<<<<<<<<<< + * cdef T_Healpix_Base[int64] hb = T_Healpix_Base[int64](nside, NEST if nest else RING, SET_NSIDE) + * num = pix.shape[0] */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(0, 89, __pyx_L1_error) - /* "healpy/src/_pixelfunc.pyx":88 - * """ - * - * if not isnsideok(nside): # <<<<<<<<<<<<<< - * raise ValueError('Wrong nside value, must be a power of 2, less than 2**30') - * cdef Healpix_Ordering_Scheme scheme - */ - } - - /* "healpy/src/_pixelfunc.pyx":91 - * raise ValueError('Wrong nside value, must be a power of 2, less than 2**30') - * cdef Healpix_Ordering_Scheme scheme - * if nest: # <<<<<<<<<<<<<< - * scheme = NEST - * else: - */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_nest); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 91, __pyx_L1_error) - if (__pyx_t_2) { - - /* "healpy/src/_pixelfunc.pyx":92 - * cdef Healpix_Ordering_Scheme scheme - * if nest: - * scheme = NEST # <<<<<<<<<<<<<< - * else: - * scheme = RING - */ - __pyx_v_scheme = NEST; - - /* "healpy/src/_pixelfunc.pyx":91 - * raise ValueError('Wrong nside value, must be a power of 2, less than 2**30') - * cdef Healpix_Ordering_Scheme scheme - * if nest: # <<<<<<<<<<<<<< - * scheme = NEST - * else: - */ - goto __pyx_L4; - } - - /* "healpy/src/_pixelfunc.pyx":94 - * scheme = NEST - * else: - * scheme = RING # <<<<<<<<<<<<<< - * cdef T_Healpix_Base[int64] hb = T_Healpix_Base[int64](nside, scheme, SET_NSIDE) - * num = pix.shape[0] + /* "healpy/src/_pixelfunc.pyx":88 + * """ + * + * if not isnsideok(nside, nest=nest): # <<<<<<<<<<<<<< + * raise ValueError('Wrong nside value, must be a power of 2 (for nested), less than 2**30') + * cdef T_Healpix_Base[int64] hb = T_Healpix_Base[int64](nside, NEST if nest else RING, SET_NSIDE) */ - /*else*/ { - __pyx_v_scheme = RING; } - __pyx_L4:; - /* "healpy/src/_pixelfunc.pyx":95 - * else: - * scheme = RING - * cdef T_Healpix_Base[int64] hb = T_Healpix_Base[int64](nside, scheme, SET_NSIDE) # <<<<<<<<<<<<<< + /* "healpy/src/_pixelfunc.pyx":90 + * if not isnsideok(nside, nest=nest): + * raise ValueError('Wrong nside value, must be a power of 2 (for nested), less than 2**30') + * cdef T_Healpix_Base[int64] hb = T_Healpix_Base[int64](nside, NEST if nest else RING, SET_NSIDE) # <<<<<<<<<<<<<< * num = pix.shape[0] * cdef np.ndarray[int64, ndim=1] ring = np.empty(num, dtype=np.int64) */ - __pyx_t_4 = __Pyx_PyInt_As_int64(__pyx_v_nside); if (unlikely((__pyx_t_4 == (int64)-1) && PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L1_error) - __pyx_v_hb = T_Healpix_Base (__pyx_t_4, __pyx_v_scheme, SET_NSIDE); + __pyx_t_7 = __Pyx_PyInt_As_int64(__pyx_v_nside); if (unlikely((__pyx_t_7 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_nest); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 90, __pyx_L1_error) + if (__pyx_t_5) { + __pyx_t_8 = NEST; + } else { + __pyx_t_8 = RING; + } + __pyx_v_hb = T_Healpix_Base (__pyx_t_7, __pyx_t_8, SET_NSIDE); - /* "healpy/src/_pixelfunc.pyx":96 - * scheme = RING - * cdef T_Healpix_Base[int64] hb = T_Healpix_Base[int64](nside, scheme, SET_NSIDE) + /* "healpy/src/_pixelfunc.pyx":91 + * raise ValueError('Wrong nside value, must be a power of 2 (for nested), less than 2**30') + * cdef T_Healpix_Base[int64] hb = T_Healpix_Base[int64](nside, NEST if nest else RING, SET_NSIDE) * num = pix.shape[0] # <<<<<<<<<<<<<< * cdef np.ndarray[int64, ndim=1] ring = np.empty(num, dtype=np.int64) * for i in range(num): */ __pyx_v_num = (__pyx_v_pix->dimensions[0]); - /* "healpy/src/_pixelfunc.pyx":97 - * cdef T_Healpix_Base[int64] hb = T_Healpix_Base[int64](nside, scheme, SET_NSIDE) + /* "healpy/src/_pixelfunc.pyx":92 + * cdef T_Healpix_Base[int64] hb = T_Healpix_Base[int64](nside, NEST if nest else RING, SET_NSIDE) * num = pix.shape[0] * cdef np.ndarray[int64, ndim=1] ring = np.empty(num, dtype=np.int64) # <<<<<<<<<<<<<< * for i in range(num): * ring[i] = hb.pix2ring(pix[i]) */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_num); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 97, __pyx_L1_error) - __pyx_t_9 = ((PyArrayObject *)__pyx_t_8); + __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_num); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int64); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_13 = ((PyArrayObject *)__pyx_t_12); { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ring.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_int64, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ring.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn_int64, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_ring = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_ring.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 97, __pyx_L1_error) + __PYX_ERR(0, 92, __pyx_L1_error) } else {__pyx_pybuffernd_ring.diminfo[0].strides = __pyx_pybuffernd_ring.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ring.diminfo[0].shape = __pyx_pybuffernd_ring.rcbuffer->pybuffer.shape[0]; } } - __pyx_t_9 = 0; - __pyx_v_ring = ((PyArrayObject *)__pyx_t_8); - __pyx_t_8 = 0; + __pyx_t_13 = 0; + __pyx_v_ring = ((PyArrayObject *)__pyx_t_12); + __pyx_t_12 = 0; - /* "healpy/src/_pixelfunc.pyx":98 + /* "healpy/src/_pixelfunc.pyx":93 * num = pix.shape[0] * cdef np.ndarray[int64, ndim=1] ring = np.empty(num, dtype=np.int64) * for i in range(num): # <<<<<<<<<<<<<< * ring[i] = hb.pix2ring(pix[i]) * return ring */ - __pyx_t_10 = __pyx_v_num; - for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { - __pyx_v_i = __pyx_t_11; + __pyx_t_14 = __pyx_v_num; + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_i = __pyx_t_15; - /* "healpy/src/_pixelfunc.pyx":99 + /* "healpy/src/_pixelfunc.pyx":94 * cdef np.ndarray[int64, ndim=1] ring = np.empty(num, dtype=np.int64) * for i in range(num): * ring[i] = hb.pix2ring(pix[i]) # <<<<<<<<<<<<<< * return ring * */ - __pyx_t_12 = __pyx_v_i; + __pyx_t_16 = __pyx_v_i; __pyx_t_1 = -1; - if (__pyx_t_12 < 0) { - __pyx_t_12 += __pyx_pybuffernd_pix.diminfo[0].shape; - if (unlikely(__pyx_t_12 < 0)) __pyx_t_1 = 0; - } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_pix.diminfo[0].shape)) __pyx_t_1 = 0; + if (__pyx_t_16 < 0) { + __pyx_t_16 += __pyx_pybuffernd_pix.diminfo[0].shape; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_1 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_pix.diminfo[0].shape)) __pyx_t_1 = 0; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); - __PYX_ERR(0, 99, __pyx_L1_error) + __PYX_ERR(0, 94, __pyx_L1_error) } - __pyx_t_13 = __pyx_v_i; + __pyx_t_17 = __pyx_v_i; __pyx_t_1 = -1; - if (__pyx_t_13 < 0) { - __pyx_t_13 += __pyx_pybuffernd_ring.diminfo[0].shape; - if (unlikely(__pyx_t_13 < 0)) __pyx_t_1 = 0; - } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_ring.diminfo[0].shape)) __pyx_t_1 = 0; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_pybuffernd_ring.diminfo[0].shape; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_1 = 0; + } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_ring.diminfo[0].shape)) __pyx_t_1 = 0; if (unlikely(__pyx_t_1 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_1); - __PYX_ERR(0, 99, __pyx_L1_error) + __PYX_ERR(0, 94, __pyx_L1_error) } - *__Pyx_BufPtrStrided1d(int64 *, __pyx_pybuffernd_ring.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_ring.diminfo[0].strides) = __pyx_v_hb.pix2ring((*__Pyx_BufPtrStrided1d(int64 *, __pyx_pybuffernd_pix.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_pix.diminfo[0].strides))); + *__Pyx_BufPtrStrided1d(int64 *, __pyx_pybuffernd_ring.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_ring.diminfo[0].strides) = __pyx_v_hb.pix2ring((*__Pyx_BufPtrStrided1d(int64 *, __pyx_pybuffernd_pix.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_pix.diminfo[0].strides))); } - /* "healpy/src/_pixelfunc.pyx":100 + /* "healpy/src/_pixelfunc.pyx":95 * for i in range(num): * ring[i] = hb.pix2ring(pix[i]) * return ring # <<<<<<<<<<<<<< @@ -2334,11 +2489,11 @@ static PyObject *__pyx_pf_6healpy_10_pixelfunc_2pix2ring(CYTHON_UNUSED PyObject /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -2359,153 +2514,63 @@ static PyObject *__pyx_pf_6healpy_10_pixelfunc_2pix2ring(CYTHON_UNUSED PyObject return __pyx_r; } -/* "healpy/src/_pixelfunc.pyx":103 +/* "healpy/src/_pixelfunc.pyx":98 * * - * cdef bool isnsideok(int nside): # <<<<<<<<<<<<<< - * if nside < 0 or nside != 2**int(round(np.log2(nside))): - * return False + * cdef bool isnsideok(int nside, bool nest=False): # <<<<<<<<<<<<<< + * return (nside > 0) and ((not nest) or ((nside&(nside-1))==0)) */ -static bool __pyx_f_6healpy_10_pixelfunc_isnsideok(int __pyx_v_nside) { +static bool __pyx_f_6healpy_10_pixelfunc_isnsideok(int __pyx_v_nside, struct __pyx_opt_args_6healpy_10_pixelfunc_isnsideok *__pyx_optional_args) { + bool __pyx_v_nest = ((bool)0); bool __pyx_r; __Pyx_RefNannyDeclarations - int __pyx_t_1; + bool __pyx_t_1; int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("isnsideok", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_nest = __pyx_optional_args->nest; + } + } - /* "healpy/src/_pixelfunc.pyx":104 + /* "healpy/src/_pixelfunc.pyx":99 * - * cdef bool isnsideok(int nside): - * if nside < 0 or nside != 2**int(round(np.log2(nside))): # <<<<<<<<<<<<<< - * return False - * else: + * cdef bool isnsideok(int nside, bool nest=False): + * return (nside > 0) and ((not nest) or ((nside&(nside-1))==0)) # <<<<<<<<<<<<<< */ - __pyx_t_2 = ((__pyx_v_nside < 0) != 0); - if (!__pyx_t_2) { + __pyx_t_2 = (__pyx_v_nside > 0); + if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nside); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_log2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nside); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - } + goto __pyx_L3_bool_binop_done; } - if (!__pyx_t_7) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = (!(__pyx_v_nest != 0)); + if (!__pyx_t_2) { } else { - __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_1 = __pyx_t_2; + goto __pyx_L3_bool_binop_done; } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyNumber_PowerOf2(__pyx_int_2, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 104, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_2 = ((__pyx_v_nside & (__pyx_v_nside - 1)) == 0); __pyx_t_1 = __pyx_t_2; - __pyx_L4_bool_binop_done:; - if (__pyx_t_1) { - - /* "healpy/src/_pixelfunc.pyx":105 - * cdef bool isnsideok(int nside): - * if nside < 0 or nside != 2**int(round(np.log2(nside))): - * return False # <<<<<<<<<<<<<< - * else: - * return True - */ - __pyx_r = 0; - goto __pyx_L0; - - /* "healpy/src/_pixelfunc.pyx":104 - * - * cdef bool isnsideok(int nside): - * if nside < 0 or nside != 2**int(round(np.log2(nside))): # <<<<<<<<<<<<<< - * return False - * else: - */ - } - - /* "healpy/src/_pixelfunc.pyx":107 - * return False - * else: - * return True # <<<<<<<<<<<<<< - * - * - */ - /*else*/ { - __pyx_r = 1; - goto __pyx_L0; - } + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_1; + goto __pyx_L0; - /* "healpy/src/_pixelfunc.pyx":103 + /* "healpy/src/_pixelfunc.pyx":98 * * - * cdef bool isnsideok(int nside): # <<<<<<<<<<<<<< - * if nside < 0 or nside != 2**int(round(np.log2(nside))): - * return False + * cdef bool isnsideok(int nside, bool nest=False): # <<<<<<<<<<<<<< + * return (nside > 0) and ((not nest) or ((nside&(nside-1))==0)) */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_WriteUnraisable("healpy._pixelfunc.isnsideok", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":197 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -2552,7 +2617,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_GIVEREF(__pyx_v_info->obj); } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":203 * # of flags * * if info == NULL: return # <<<<<<<<<<<<<< @@ -2565,7 +2630,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L0; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":206 * * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -2574,7 +2639,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":207 * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -2583,7 +2648,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":209 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -2592,7 +2657,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":211 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -2602,7 +2667,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":212 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -2611,7 +2676,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_copy_shape = 1; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":211 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -2621,7 +2686,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L4; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":214 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -2633,7 +2698,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L4:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -2647,7 +2712,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L6_bool_binop_done; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":217 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -2658,7 +2723,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -2667,7 +2732,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -2680,7 +2745,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 218, __pyx_L1_error) - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -2689,7 +2754,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -2703,7 +2768,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L9_bool_binop_done; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":221 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -2714,7 +2779,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L9_bool_binop_done:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -2723,7 +2788,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -2736,7 +2801,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 222, __pyx_L1_error) - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -2745,7 +2810,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":224 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -2754,7 +2819,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":225 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -2763,7 +2828,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":226 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< @@ -2773,7 +2838,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (__pyx_v_copy_shape != 0); if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< @@ -2782,7 +2847,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":230 * # This is allocated as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -2791,7 +2856,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -2802,7 +2867,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":232 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -2811,7 +2876,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -2821,7 +2886,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":226 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< @@ -2831,7 +2896,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L11; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -2841,7 +2906,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":236 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -2852,7 +2917,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L11:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -2861,7 +2926,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":238 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -2870,7 +2935,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":239 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -2879,7 +2944,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -2888,7 +2953,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -2900,7 +2965,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -2909,7 +2974,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -2927,7 +2992,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_L15_bool_binop_done:; if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -2940,7 +3005,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = Py_None; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -2950,7 +3015,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L14; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -2966,7 +3031,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L14:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":255 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -2976,7 +3041,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":256 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -2986,7 +3051,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_4 = __pyx_v_descr->type_num; __pyx_v_t = __pyx_t_4; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -3006,7 +3071,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L20_next_or:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258 * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -3023,7 +3088,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L19_bool_binop_done:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -3032,7 +3097,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -3045,7 +3110,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 259, __pyx_L1_error) - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -3054,7 +3119,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -3066,7 +3131,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"b"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -3077,7 +3142,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"B"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":262 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -3088,7 +3153,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"h"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -3099,7 +3164,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"H"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":264 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -3110,7 +3175,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"i"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -3121,7 +3186,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"I"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -3132,7 +3197,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"l"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -3143,7 +3208,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"L"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -3154,7 +3219,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"q"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":269 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -3165,7 +3230,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Q"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -3176,7 +3241,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"f"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -3187,7 +3252,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"d"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -3198,7 +3263,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"g"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -3209,7 +3274,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zf"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -3220,7 +3285,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zd"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -3231,7 +3296,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zg"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -3243,7 +3308,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -3269,7 +3334,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -3278,7 +3343,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -3288,7 +3353,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_r = 0; goto __pyx_L0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":255 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -3297,7 +3362,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -3307,7 +3372,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->format = ((char *)malloc(0xFF)); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 * else: * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -3316,7 +3381,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -3325,7 +3390,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":285 * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< @@ -3335,7 +3400,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) __pyx_v_f = __pyx_t_7; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -3345,7 +3410,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":197 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -3377,7 +3442,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":290 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -3401,7 +3466,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":291 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -3411,7 +3476,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -3420,7 +3485,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ free(__pyx_v_info->format); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":291 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -3429,7 +3494,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":293 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -3439,7 +3504,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -3448,7 +3513,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ free(__pyx_v_info->strides); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":293 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -3457,7 +3522,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":290 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -3469,7 +3534,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -3483,7 +3548,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -3497,7 +3562,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -3516,7 +3581,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -3530,7 +3595,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":774 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -3544,7 +3609,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -3563,7 +3628,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -3577,7 +3642,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":777 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -3591,7 +3656,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -3610,7 +3675,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -3624,7 +3689,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":780 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -3638,7 +3703,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -3657,7 +3722,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -3671,7 +3736,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":783 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -3685,7 +3750,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -3704,7 +3769,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -3733,7 +3798,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx char *__pyx_t_9; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * * cdef dtype child * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -3742,7 +3807,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 * cdef dtype child * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -3751,7 +3816,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -3765,7 +3830,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) @@ -3774,7 +3839,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); __pyx_t_3 = 0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":795 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -3791,7 +3856,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -3800,7 +3865,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (likely(__pyx_v_fields != Py_None)) { PyObject* sequence = __pyx_v_fields; - #if CYTHON_COMPILING_IN_CPYTHON + #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); @@ -3810,7 +3875,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(1, 796, __pyx_L1_error) } - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_3); @@ -3830,7 +3895,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -3847,7 +3912,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (__pyx_t_6) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":799 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -3860,7 +3925,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 799, __pyx_L1_error) - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -3869,7 +3934,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -3889,7 +3954,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L8_next_or:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -3906,7 +3971,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = __pyx_t_7; __pyx_L7_bool_binop_done:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -3915,7 +3980,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (__pyx_t_6) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -3928,7 +3993,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 803, __pyx_L1_error) - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -3937,7 +4002,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -3953,7 +4018,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -3962,7 +4027,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 0x78; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":815 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -3971,7 +4036,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":816 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -3982,7 +4047,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":818 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -3992,7 +4057,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_8 = 0; (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":820 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -4002,7 +4067,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); if (__pyx_t_6) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -4014,7 +4079,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -4024,7 +4089,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); if (__pyx_t_6) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -4037,7 +4102,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(1, 823, __pyx_L1_error) - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -4046,7 +4111,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< @@ -4064,7 +4129,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< @@ -4082,7 +4147,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":828 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< @@ -4100,7 +4165,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< @@ -4118,7 +4183,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< @@ -4136,7 +4201,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< @@ -4154,7 +4219,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< @@ -4172,7 +4237,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< @@ -4190,7 +4255,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< @@ -4208,7 +4273,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":835 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< @@ -4226,7 +4291,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< @@ -4244,7 +4309,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< @@ -4262,7 +4327,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< @@ -4280,7 +4345,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< @@ -4300,7 +4365,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< @@ -4320,7 +4385,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< @@ -4340,7 +4405,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< @@ -4358,7 +4423,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -4382,7 +4447,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L15:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -4391,7 +4456,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":820 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -4401,7 +4466,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L13; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":849 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< @@ -4414,7 +4479,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L13:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -4424,7 +4489,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -4434,7 +4499,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -4459,7 +4524,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":966 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -4474,7 +4539,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a int __pyx_t_2; __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":968 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -4485,7 +4550,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":969 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -4494,7 +4559,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_baseptr = NULL; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":968 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -4504,7 +4569,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a goto __pyx_L3; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":971 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -4514,7 +4579,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a /*else*/ { Py_INCREF(__pyx_v_base); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":972 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -4525,7 +4590,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":973 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -4534,7 +4599,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":974 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -4543,7 +4608,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":966 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -4555,7 +4620,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -4569,7 +4634,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -4579,7 +4644,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":978 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -4591,7 +4656,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; goto __pyx_L0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -4600,29 +4665,421 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 - * return None - * else: - * return arr.base # <<<<<<<<<<<<<< + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":980 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_array", 0); + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * cdef inline int import_array() except -1: + * try: + * _import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") + */ + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * try: + * _import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 989, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L10_try_end:; + } + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_umath", 0); + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":993 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":994 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 995, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L10_try_end:; + } + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_ufunc", 0); + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":999 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 1001, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); - __pyx_r = ((PyObject *)__pyx_v_arr->base); - goto __pyx_L0; + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L10_try_end:; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() */ /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4645,7 +5102,7 @@ static CYTHON_INLINE Healpix_Map *__pyx_f_7_common_ndarray2map(PyArrayO Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; - size_t __pyx_t_4; + __pyx_t_7_common_tsize __pyx_t_4; __Pyx_RefNannySetupContext("ndarray2map", 0); __pyx_pybuffer_array.pybuffer.buf = NULL; __pyx_pybuffer_array.refcount = 0; @@ -4762,7 +5219,7 @@ static CYTHON_INLINE Alm > *__pyx_f_7_common_ndarray2alm(PyArr Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; - size_t __pyx_t_4; + __pyx_t_7_common_tsize __pyx_t_4; __Pyx_RefNannySetupContext("ndarray2alm", 0); __pyx_pybuffer_array.pybuffer.buf = NULL; __pyx_pybuffer_array.refcount = 0; @@ -4885,10 +5342,12 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, {&__pyx_kp_u_Get_information_for_rings_Rings, __pyx_k_Get_information_for_rings_Rings, sizeof(__pyx_k_Get_information_for_rings_Rings), 0, 1, 0, 0}, + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_kp_s_Wrong_nside_value_must_be_a_powe, __pyx_k_Wrong_nside_value_must_be_a_powe, sizeof(__pyx_k_Wrong_nside_value_must_be_a_powe), 0, 0, 1, 0}, + {&__pyx_kp_s_Wrong_nside_value_must_be_a_powe_2, __pyx_k_Wrong_nside_value_must_be_a_powe_2, sizeof(__pyx_k_Wrong_nside_value_must_be_a_powe_2), 0, 0, 1, 0}, {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, {&__pyx_n_s_costheta, __pyx_k_costheta, sizeof(__pyx_k_costheta), 0, 0, 1, 1}, {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, @@ -4900,7 +5359,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, - {&__pyx_n_s_log2, __pyx_k_log2, sizeof(__pyx_k_log2), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, @@ -4909,6 +5367,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_nside, __pyx_k_nside, sizeof(__pyx_k_nside), 0, 0, 1, 1}, {&__pyx_n_s_num, __pyx_k_num, sizeof(__pyx_k_num), 0, 0, 1, 1}, {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0}, + {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0}, {&__pyx_n_s_pix, __pyx_k_pix, sizeof(__pyx_k_pix), 0, 0, 1, 1}, {&__pyx_n_s_pix2ring, __pyx_k_pix2ring, sizeof(__pyx_k_pix2ring), 0, 0, 1, 1}, {&__pyx_kp_u_pix2ring_line_58, __pyx_k_pix2ring_line_58, sizeof(__pyx_k_pix2ring_line_58), 0, 1, 0, 0}, @@ -4917,7 +5377,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_ringinfo, __pyx_k_ringinfo, sizeof(__pyx_k_ringinfo), 0, 0, 1, 1}, {&__pyx_kp_u_ringinfo_line_9, __pyx_k_ringinfo_line_9, sizeof(__pyx_k_ringinfo_line_9), 0, 1, 0, 0}, {&__pyx_n_s_ringpix, __pyx_k_ringpix, sizeof(__pyx_k_ringpix), 0, 0, 1, 1}, - {&__pyx_n_s_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 0, 1, 1}, {&__pyx_n_s_scheme, __pyx_k_scheme, sizeof(__pyx_k_scheme), 0, 0, 1, 1}, {&__pyx_n_s_shifted, __pyx_k_shifted, sizeof(__pyx_k_shifted), 0, 0, 1, 1}, {&__pyx_n_s_sintheta, __pyx_k_sintheta, sizeof(__pyx_k_sintheta), 0, 0, 1, 1}, @@ -4930,8 +5389,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 45, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 54, __pyx_L1_error) - __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_n_s_round); if (!__pyx_builtin_round) __PYX_ERR(0, 104, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -4943,7 +5402,7 @@ static int __Pyx_InitCachedConstants(void) { /* "healpy/src/_pixelfunc.pyx":45 * """ - * if not isnsideok(nside): + * if not isnsideok(nside, nest=False): * raise ValueError('Wrong nside value, must be a power of 2, less than 2**30') # <<<<<<<<<<<<<< * cdef Healpix_Ordering_Scheme scheme = NEST * cdef T_Healpix_Base[int64] hb = T_Healpix_Base[int64](nside, scheme, SET_NSIDE) @@ -4954,16 +5413,16 @@ static int __Pyx_InitCachedConstants(void) { /* "healpy/src/_pixelfunc.pyx":89 * - * if not isnsideok(nside): - * raise ValueError('Wrong nside value, must be a power of 2, less than 2**30') # <<<<<<<<<<<<<< - * cdef Healpix_Ordering_Scheme scheme - * if nest: + * if not isnsideok(nside, nest=nest): + * raise ValueError('Wrong nside value, must be a power of 2 (for nested), less than 2**30') # <<<<<<<<<<<<<< + * cdef T_Healpix_Base[int64] hb = T_Healpix_Base[int64](nside, NEST if nest else RING, SET_NSIDE) + * num = pix.shape[0] */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Wrong_nside_value_must_be_a_powe); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Wrong_nside_value_must_be_a_powe_2); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -4974,7 +5433,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -4985,7 +5444,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -4996,7 +5455,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":799 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -5007,7 +5466,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -5018,7 +5477,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -5029,6 +5488,37 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + /* "healpy/src/_pixelfunc.pyx":9 * from _common cimport int64, Healpix_Ordering_Scheme, RING, NEST, SET_NSIDE, T_Healpix_Base * @@ -5036,10 +5526,10 @@ static int __Pyx_InitCachedConstants(void) { * """Get information for rings * */ - __pyx_tuple__9 = PyTuple_Pack(11, __pyx_n_s_nside, __pyx_n_s_ring, __pyx_n_s_scheme, __pyx_n_s_hb, __pyx_n_s_num, __pyx_n_s_startpix, __pyx_n_s_ringpix, __pyx_n_s_costheta, __pyx_n_s_sintheta, __pyx_n_s_shifted, __pyx_n_s_i); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); - __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_ringinfo, 9, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 9, __pyx_L1_error) + __pyx_tuple__12 = PyTuple_Pack(11, __pyx_n_s_nside, __pyx_n_s_ring, __pyx_n_s_scheme, __pyx_n_s_hb, __pyx_n_s_num, __pyx_n_s_startpix, __pyx_n_s_ringpix, __pyx_n_s_costheta, __pyx_n_s_sintheta, __pyx_n_s_shifted, __pyx_n_s_i); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_ringinfo, 9, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 9, __pyx_L1_error) /* "healpy/src/_pixelfunc.pyx":58 * return startpix, ringpix, costheta, sintheta, shifted @@ -5048,10 +5538,10 @@ static int __Pyx_InitCachedConstants(void) { * """Convert pixel identifier to ring number * */ - __pyx_tuple__11 = PyTuple_Pack(8, __pyx_n_s_nside, __pyx_n_s_pix, __pyx_n_s_nest, __pyx_n_s_scheme, __pyx_n_s_hb, __pyx_n_s_num, __pyx_n_s_ring, __pyx_n_s_i); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 58, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); - __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_pix2ring, 58, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_tuple__14 = PyTuple_Pack(7, __pyx_n_s_nside, __pyx_n_s_pix, __pyx_n_s_nest, __pyx_n_s_hb, __pyx_n_s_num, __pyx_n_s_ring, __pyx_n_s_i); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_pix2ring, 58, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -5061,7 +5551,6 @@ static int __Pyx_InitCachedConstants(void) { static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -6021,7 +6510,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg #endif /* PyErrFetchRestore */ - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; @@ -6210,7 +6699,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject /* GetModuleGlobalName */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; -#if CYTHON_COMPILING_IN_CPYTHON +#if !CYTHON_AVOID_BORROWED_REFS result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); @@ -6244,166 +6733,117 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject "Out of bounds on buffer access (axis %d)", axis); } -/* PyObjectCallMethO */ - #if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { - PyObject *self, *result; - PyCFunction cfunc; - cfunc = PyCFunction_GET_FUNCTION(func); - self = PyCFunction_GET_SELF(func); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = cfunc(self, arg); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; +/* RaiseTooManyValuesToUnpack */ + static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } -#endif -/* PyObjectCallOneArg */ - #if CYTHON_COMPILING_IN_CPYTHON -static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *result; - PyObject *args = PyTuple_New(1); - if (unlikely(!args)) return NULL; - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 0, arg); - result = __Pyx_PyObject_Call(func, args, NULL); - Py_DECREF(args); - return result; +/* RaiseNeedMoreValuesToUnpack */ + static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); } -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else - if (likely(PyCFunction_Check(func))) { -#endif - if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { - return __Pyx_PyObject_CallMethO(func, arg); - } - } - return __Pyx__PyObject_CallOneArg(func, arg); + +/* RaiseNoneIterError */ + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } -#else -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *result; - PyObject *args = PyTuple_Pack(1, arg); - if (unlikely(!args)) return NULL; - result = __Pyx_PyObject_Call(func, args, NULL); - Py_DECREF(args); - return result; + +/* SaveResetException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); } #endif -/* PyNumberPow2 */ - static PyObject* __Pyx__PyNumber_PowerOf2(PyObject *two, PyObject *exp, PyObject *none, int inplace) { -#if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t shiftby; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(exp))) { - shiftby = PyInt_AS_LONG(exp); - } else -#endif - if (likely(PyLong_CheckExact(exp))) { - #if CYTHON_USE_PYLONG_INTERNALS - const Py_ssize_t size = Py_SIZE(exp); - if (likely(size == 1)) { - shiftby = ((PyLongObject*)exp)->ob_digit[0]; - } else if (size == 0) { - return PyInt_FromLong(1L); - } else if (unlikely(size < 0)) { - goto fallback; - } else { - shiftby = PyLong_AsSsize_t(exp); - } - #else - shiftby = PyLong_AsSsize_t(exp); - #endif - } else { - goto fallback; - } - if (likely(shiftby >= 0)) { - if ((size_t)shiftby <= sizeof(long) * 8 - 2) { - long value = 1L << shiftby; - return PyInt_FromLong(value); - } else if ((size_t)shiftby <= sizeof(unsigned PY_LONG_LONG) * 8 - 1) { - unsigned PY_LONG_LONG value = ((unsigned PY_LONG_LONG)1) << shiftby; - return PyLong_FromUnsignedLongLong(value); - } else { - PyObject *one = PyInt_FromLong(1L); - if (unlikely(!one)) return NULL; - return PyNumber_Lshift(one, exp); - } - } else if (shiftby == -1 && PyErr_Occurred()) { - PyErr_Clear(); - } -fallback: -#endif - return (inplace ? PyNumber_InPlacePower : PyNumber_Power)(two, exp, none); +/* PyErrExceptionMatches */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { + PyObject *exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + return PyErr_GivenExceptionMatches(exc_type, err); } +#endif -/* WriteUnraisableException */ - static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, - CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, - int full_traceback, CYTHON_UNUSED int nogil) { - PyObject *old_exc, *old_val, *old_tb; - PyObject *ctx; - __Pyx_PyThreadState_declare -#ifdef WITH_THREAD - PyGILState_STATE state; - if (nogil) - state = PyGILState_Ensure(); -#ifdef _MSC_VER - else state = (PyGILState_STATE)-1; +/* GetException */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { #endif + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); #endif - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); - if (full_traceback) { - Py_XINCREF(old_exc); - Py_XINCREF(old_val); - Py_XINCREF(old_tb); - __Pyx_ErrRestore(old_exc, old_val, old_tb); - PyErr_PrintEx(1); + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; } - #if PY_MAJOR_VERSION < 3 - ctx = PyString_FromString(name); - #else - ctx = PyUnicode_FromString(name); #endif - __Pyx_ErrRestore(old_exc, old_val, old_tb); - if (!ctx) { - PyErr_WriteUnraisable(Py_None); - } else { - PyErr_WriteUnraisable(ctx); - Py_DECREF(ctx); - } -#ifdef WITH_THREAD - if (nogil) - PyGILState_Release(state); + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); #endif -} - -/* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { - PyErr_Format(PyExc_ValueError, - "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); -} - -/* RaiseNeedMoreValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { - PyErr_Format(PyExc_ValueError, - "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", - index, (index == 1) ? "" : "s"); -} - -/* RaiseNoneIterError */ - static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; } /* Import */ @@ -6634,7 +7074,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; - py_frame->f_lineno = py_line; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); @@ -6693,14 +7133,18 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { return PyInt_FromLong((long) value); } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif } } else { if (sizeof(Py_intptr_t) <= sizeof(long)) { return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif } } { @@ -6711,34 +7155,7 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } } -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { - const int neg_one = (int) -1, const_zero = (int) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(int) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(int) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int), - little, !is_unsigned); - } -} - -/* None */ +/* Declarations */ #if CYTHON_CCOMPLEX #ifdef __cplusplus static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { @@ -6758,61 +7175,86 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } #endif -/* None */ +/* Arithmetic */ #if CYTHON_CCOMPLEX #else - static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { return (a.real == b.real) && (a.imag == b.imag); } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { __pyx_t_float_complex z; z.real = a.real + b.real; z.imag = a.imag + b.imag; return z; } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { __pyx_t_float_complex z; z.real = a.real - b.real; z.imag = a.imag - b.imag; return z; } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { __pyx_t_float_complex z; z.real = a.real * b.real - a.imag * b.imag; z.imag = a.real * b.imag + a.imag * b.real; return z; } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - float denom = b.real * b.real + b.imag * b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; + #if 1 + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabsf(b.real) >= fabsf(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + float r = b.imag / b.real; + float s = 1.0 / (b.real + b.imag * r); + return __pyx_t_float_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + float r = b.real / b.imag; + float s = 1.0 / (b.imag + b.real * r); + return __pyx_t_float_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + float denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_float_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { + #endif + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) { __pyx_t_float_complex z; z.real = -a.real; z.imag = -a.imag; return z; } - static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) { return (a.real == 0) && (a.imag == 0); } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) { __pyx_t_float_complex z; z.real = a.real; z.imag = -a.imag; return z; } #if 1 - static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) { #if !defined(HAVE_HYPOT) || defined(_MSC_VER) return sqrtf(z.real*z.real + z.imag*z.imag); #else return hypotf(z.real, z.imag); #endif } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { __pyx_t_float_complex z; float r, lnr, theta, z_r, z_theta; if (b.imag == 0 && b.real == (int)b.real) { @@ -6830,24 +7272,32 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { case 1: return a; case 2: - z = __Pyx_c_prodf(a, a); - return __Pyx_c_prodf(a, a); + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(a, a); case 3: - z = __Pyx_c_prodf(a, a); - return __Pyx_c_prodf(z, a); + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, a); case 4: - z = __Pyx_c_prodf(a, a); - return __Pyx_c_prodf(z, z); + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, z); } } if (a.imag == 0) { if (a.real == 0) { return a; + } else if (b.imag == 0) { + z.real = powf(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2f(0, -1); } - r = a.real; - theta = 0; } else { - r = __Pyx_c_absf(a); + r = __Pyx_c_abs_float(a); theta = atan2f(a.imag, a.real); } lnr = logf(r); @@ -6860,7 +7310,7 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif #endif -/* None */ +/* Declarations */ #if CYTHON_CCOMPLEX #ifdef __cplusplus static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { @@ -6880,61 +7330,86 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } #endif -/* None */ +/* Arithmetic */ #if CYTHON_CCOMPLEX #else - static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { return (a.real == b.real) && (a.imag == b.imag); } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { __pyx_t_double_complex z; z.real = a.real + b.real; z.imag = a.imag + b.imag; return z; } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { __pyx_t_double_complex z; z.real = a.real - b.real; z.imag = a.imag - b.imag; return z; } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { __pyx_t_double_complex z; z.real = a.real * b.real - a.imag * b.imag; z.imag = a.real * b.imag + a.imag * b.real; return z; } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - double denom = b.real * b.real + b.imag * b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; + #if 1 + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabs(b.real) >= fabs(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + double r = b.imag / b.real; + double s = 1.0 / (b.real + b.imag * r); + return __pyx_t_double_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + double r = b.real / b.imag; + double s = 1.0 / (b.imag + b.real * r); + return __pyx_t_double_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { + #else + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + double denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_double_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) { __pyx_t_double_complex z; z.real = -a.real; z.imag = -a.imag; return z; } - static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) { return (a.real == 0) && (a.imag == 0); } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) { __pyx_t_double_complex z; z.real = a.real; z.imag = -a.imag; return z; } #if 1 - static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) { #if !defined(HAVE_HYPOT) || defined(_MSC_VER) return sqrt(z.real*z.real + z.imag*z.imag); #else return hypot(z.real, z.imag); #endif } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { __pyx_t_double_complex z; double r, lnr, theta, z_r, z_theta; if (b.imag == 0 && b.real == (int)b.real) { @@ -6952,24 +7427,32 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { case 1: return a; case 2: - z = __Pyx_c_prod(a, a); - return __Pyx_c_prod(a, a); + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(a, a); case 3: - z = __Pyx_c_prod(a, a); - return __Pyx_c_prod(z, a); + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, a); case 4: - z = __Pyx_c_prod(a, a); - return __Pyx_c_prod(z, z); + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, z); } } if (a.imag == 0) { if (a.real == 0) { return a; + } else if (b.imag == 0) { + z.real = pow(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2(0, -1); } - r = a.real; - theta = 0; } else { - r = __Pyx_c_abs(a); + r = __Pyx_c_abs_double(a); theta = atan2(a.imag, a.real); } lnr = log(r); @@ -6982,6 +7465,37 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif #endif +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0; @@ -6991,14 +7505,18 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { return PyInt_FromLong((long) value); } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif } } else { if (sizeof(enum NPY_TYPES) <= sizeof(long)) { return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif } } { @@ -7077,8 +7595,10 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif } } else { #if CYTHON_USE_PYLONG_INTERNALS @@ -7145,8 +7665,10 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif } } { @@ -7262,8 +7784,10 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif if (sizeof(int64) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int64, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG } else if (sizeof(int64) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif } } else { #if CYTHON_USE_PYLONG_INTERNALS @@ -7330,8 +7854,10 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif if (sizeof(int64) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int64, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG } else if (sizeof(int64) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int64, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif } } { @@ -7447,8 +7973,10 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif } } else { #if CYTHON_USE_PYLONG_INTERNALS @@ -7515,8 +8043,10 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif if (sizeof(Py_intptr_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif } } { @@ -7632,8 +8162,10 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif if (sizeof(size_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif } } else { #if CYTHON_USE_PYLONG_INTERNALS @@ -7700,8 +8232,10 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif if (sizeof(size_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif } } { @@ -7758,14 +8292,18 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif } } { @@ -7844,8 +8382,10 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif } } else { #if CYTHON_USE_PYLONG_INTERNALS @@ -7912,8 +8452,10 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif } } { @@ -8162,7 +8704,9 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; +#endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 @@ -8171,8 +8715,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; -#if PY_MAJOR_VERSION < 3 + #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); @@ -8181,11 +8726,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { name = "long"; res = PyNumber_Long(x); } -#else + #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } + #endif +#else + res = PyNumber_Int(x); #endif if (res) { #if PY_MAJOR_VERSION < 3 diff --git a/src/healpy/healpy/src/_pixelfunc.pyx b/src/healpy/healpy/src/_pixelfunc.pyx index 8e2d905..5e3d758 100644 --- a/src/healpy/healpy/src/_pixelfunc.pyx +++ b/src/healpy/healpy/src/_pixelfunc.pyx @@ -41,7 +41,7 @@ def ringinfo(nside, np.ndarray[int64, ndim=1] ring not None): -0.33333333, -0.66666667]), array([ 0. , 0.39965263, 0.74535599, 0.94280904, 1. , 0.94280904, 0.74535599]), array([ True, True, True, False, True, False, True], dtype=bool)) """ - if not isnsideok(nside): + if not isnsideok(nside, nest=False): raise ValueError('Wrong nside value, must be a power of 2, less than 2**30') cdef Healpix_Ordering_Scheme scheme = NEST cdef T_Healpix_Base[int64] hb = T_Healpix_Base[int64](nside, scheme, SET_NSIDE) @@ -85,14 +85,9 @@ def pix2ring(nside, np.ndarray[int64, ndim=1] pix not None, nest=False): 7, 7]) """ - if not isnsideok(nside): - raise ValueError('Wrong nside value, must be a power of 2, less than 2**30') - cdef Healpix_Ordering_Scheme scheme - if nest: - scheme = NEST - else: - scheme = RING - cdef T_Healpix_Base[int64] hb = T_Healpix_Base[int64](nside, scheme, SET_NSIDE) + if not isnsideok(nside, nest=nest): + raise ValueError('Wrong nside value, must be a power of 2 (for nested), less than 2**30') + cdef T_Healpix_Base[int64] hb = T_Healpix_Base[int64](nside, NEST if nest else RING, SET_NSIDE) num = pix.shape[0] cdef np.ndarray[int64, ndim=1] ring = np.empty(num, dtype=np.int64) for i in range(num): @@ -100,10 +95,5 @@ def pix2ring(nside, np.ndarray[int64, ndim=1] pix not None, nest=False): return ring -cdef bool isnsideok(int nside): - if nside < 0 or nside != 2**int(round(np.log2(nside))): - return False - else: - return True - - +cdef bool isnsideok(int nside, bool nest=False): + return (nside > 0) and ((not nest) or ((nside&(nside-1))==0)) diff --git a/src/healpy/healpy/src/_query_disc.cpp b/src/healpy/healpy/src/_query_disc.cpp index 6b57261..81cd42d 100644 --- a/src/healpy/healpy/src/_query_disc.cpp +++ b/src/healpy/healpy/src/_query_disc.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.24 */ +/* Generated by Cython 0.25.2 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,7 +7,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_24" +#define CYTHON_ABI "0_25_2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -29,6 +29,11 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) + #define HAVE_LONG_LONG + #endif +#endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif @@ -37,13 +42,110 @@ #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 #else #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif #endif -#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 - #define CYTHON_USE_PYLONG_INTERNALS 1 +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" @@ -79,24 +181,44 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif +#ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #else #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY @@ -110,6 +232,9 @@ #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif @@ -118,6 +243,13 @@ #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 @@ -146,6 +278,7 @@ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type @@ -184,18 +317,20 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif -#if PY_VERSION_HEX >= 0x030500B1 -#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods -#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) -#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; -} __Pyx_PyAsyncMethodsStruct; -#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif #else -#define __Pyx_PyType_AsAsync(obj) NULL + #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) @@ -208,13 +343,44 @@ typedef struct { #define CYTHON_RESTRICT #endif #endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef __cplusplus #error "Cython files generated with the C++ option must be compiled with a C++ compiler." #endif #ifndef CYTHON_INLINE - #define CYTHON_INLINE inline + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #else + #define CYTHON_INLINE inline + #endif #endif template void __Pyx_call_destructor(T& x) { @@ -226,7 +392,10 @@ class __Pyx_FakeReference { __Pyx_FakeReference() : ptr(NULL) { } __Pyx_FakeReference(const T& ref) : ptr(const_cast(&ref)) { } T *operator->() { return ptr; } + T *operator&() { return ptr; } operator T&() { return *ptr; } + template bool operator ==(U other) { return *ptr == other; } + template bool operator !=(U other) { return *ptr != other; } private: T *ptr; }; @@ -244,6 +413,11 @@ static CYTHON_INLINE float __PYX_NAN() { return value; } #endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif #define __PYX_ERR(f_index, lineno, Ln_error) \ @@ -269,9 +443,9 @@ static CYTHON_INLINE float __PYX_NAN() { #define __PYX_HAVE__healpy___query_disc #define __PYX_HAVE_API__healpy___query_disc -#include "string.h" -#include "stdio.h" -#include "stdlib.h" +#include +#include +#include #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" #include @@ -297,26 +471,6 @@ static CYTHON_INLINE float __PYX_NAN() { #define CYTHON_WITHOUT_ASSERTIONS #endif -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON -# define CYTHON_NCP_UNUSED -# else -# define CYTHON_NCP_UNUSED CYTHON_UNUSED -# endif -#endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; @@ -394,7 +548,7 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) @@ -502,7 +656,7 @@ static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; -/* None.proto */ +/* Header.proto */ #if !defined(CYTHON_CCOMPLEX) #if defined(__cplusplus) #define CYTHON_CCOMPLEX 1 @@ -568,7 +722,7 @@ typedef struct { } __Pyx_BufFmt_Context; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":725 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":725 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -577,7 +731,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":726 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":726 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -586,7 +740,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":727 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":727 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -595,7 +749,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":728 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":728 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -604,7 +758,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":732 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":732 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -613,7 +767,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":733 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":733 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -622,7 +776,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":734 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":734 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -631,7 +785,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":735 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":735 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -640,7 +794,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":739 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":739 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -649,7 +803,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":740 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":740 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -658,7 +812,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":749 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":749 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -667,7 +821,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":750 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":750 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -676,7 +830,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":751 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":751 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -685,7 +839,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":753 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":753 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -694,7 +848,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":754 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":754 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -703,7 +857,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":755 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":755 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -712,7 +866,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":757 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":757 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -721,7 +875,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":758 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -730,7 +884,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":760 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":760 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -739,7 +893,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":761 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":761 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -748,7 +902,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":762 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":762 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -783,7 +937,7 @@ typedef size_t __pyx_t_7_common_tsize; * cdef extern from "datatypes.h": */ typedef ptrdiff_t __pyx_t_7_common_tdiff; -/* None.proto */ +/* Declarations.proto */ #if CYTHON_CCOMPLEX #ifdef __cplusplus typedef ::std::complex< float > __pyx_t_float_complex; @@ -793,8 +947,9 @@ typedef ptrdiff_t __pyx_t_7_common_tdiff; #else typedef struct { float real, imag; } __pyx_t_float_complex; #endif +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); -/* None.proto */ +/* Declarations.proto */ #if CYTHON_CCOMPLEX #ifdef __cplusplus typedef ::std::complex< double > __pyx_t_double_complex; @@ -804,11 +959,12 @@ typedef ptrdiff_t __pyx_t_7_common_tdiff; #else typedef struct { double real, imag; } __pyx_t_double_complex; #endif +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); /*--- Type declarations ---*/ -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":764 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":764 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -817,7 +973,7 @@ typedef ptrdiff_t __pyx_t_7_common_tdiff; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":765 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":765 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -826,7 +982,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":766 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":766 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -835,7 +991,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":768 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":768 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -922,7 +1078,7 @@ struct __pyx_opt_args_6healpy_11_query_disc_pixset_to_array { #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyObjectGetAttrStr.proto */ -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) @@ -973,7 +1129,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg #endif /* PyThreadStateGet.proto */ -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); #else @@ -982,7 +1138,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg #endif /* PyErrFetchRestore.proto */ -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_FAST_THREAD_STATE #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) @@ -1032,6 +1188,24 @@ static void __Pyx_RaiseBufferIndexError(int axis); #define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1) #define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2) +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#endif + /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); @@ -1080,6 +1254,33 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + #define __Pyx_BufPtrCContig1d(type, buf, i0, s0) ((type)buf + i0) /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); @@ -1149,6 +1350,8 @@ static void __Pyx_CppExn2PyErr() { PyErr_SetString(PyExc_MemoryError, exn.what()); } catch (const std::bad_cast& exn) { PyErr_SetString(PyExc_TypeError, exn.what()); + } catch (const std::bad_typeid& exn) { + PyErr_SetString(PyExc_TypeError, exn.what()); } catch (const std::domain_error& exn) { PyErr_SetString(PyExc_ValueError, exn.what()); } catch (const std::invalid_argument& exn) { @@ -1176,7 +1379,7 @@ static void __Pyx_CppExn2PyErr() { /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64(int64 value); -/* None.proto */ +/* RealImag.proto */ #if CYTHON_CCOMPLEX #ifdef __cplusplus #define __Pyx_CREAL(z) ((z).real()) @@ -1189,7 +1392,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64(int64 value); #define __Pyx_CREAL(z) ((z).real) #define __Pyx_CIMAG(z) ((z).imag) #endif -#if defined(__cplusplus) && CYTHON_CCOMPLEX && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) +#if defined(__cplusplus) && CYTHON_CCOMPLEX\ + && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) #define __Pyx_SET_CREAL(z,x) ((z).real(x)) #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) #else @@ -1197,85 +1401,79 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64(int64 value); #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) #endif -/* None.proto */ -static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); - -/* None.proto */ +/* Arithmetic.proto */ #if CYTHON_CCOMPLEX - #define __Pyx_c_eqf(a, b) ((a)==(b)) - #define __Pyx_c_sumf(a, b) ((a)+(b)) - #define __Pyx_c_difff(a, b) ((a)-(b)) - #define __Pyx_c_prodf(a, b) ((a)*(b)) - #define __Pyx_c_quotf(a, b) ((a)/(b)) - #define __Pyx_c_negf(a) (-(a)) + #define __Pyx_c_eq_float(a, b) ((a)==(b)) + #define __Pyx_c_sum_float(a, b) ((a)+(b)) + #define __Pyx_c_diff_float(a, b) ((a)-(b)) + #define __Pyx_c_prod_float(a, b) ((a)*(b)) + #define __Pyx_c_quot_float(a, b) ((a)/(b)) + #define __Pyx_c_neg_float(a) (-(a)) #ifdef __cplusplus - #define __Pyx_c_is_zerof(z) ((z)==(float)0) - #define __Pyx_c_conjf(z) (::std::conj(z)) + #define __Pyx_c_is_zero_float(z) ((z)==(float)0) + #define __Pyx_c_conj_float(z) (::std::conj(z)) #if 1 - #define __Pyx_c_absf(z) (::std::abs(z)) - #define __Pyx_c_powf(a, b) (::std::pow(a, b)) + #define __Pyx_c_abs_float(z) (::std::abs(z)) + #define __Pyx_c_pow_float(a, b) (::std::pow(a, b)) #endif #else - #define __Pyx_c_is_zerof(z) ((z)==0) - #define __Pyx_c_conjf(z) (conjf(z)) + #define __Pyx_c_is_zero_float(z) ((z)==0) + #define __Pyx_c_conj_float(z) (conjf(z)) #if 1 - #define __Pyx_c_absf(z) (cabsf(z)) - #define __Pyx_c_powf(a, b) (cpowf(a, b)) + #define __Pyx_c_abs_float(z) (cabsf(z)) + #define __Pyx_c_pow_float(a, b) (cpowf(a, b)) #endif #endif #else - static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); - static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex); #if 1 - static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex); #endif #endif -/* None.proto */ -static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); - -/* None.proto */ +/* Arithmetic.proto */ #if CYTHON_CCOMPLEX - #define __Pyx_c_eq(a, b) ((a)==(b)) - #define __Pyx_c_sum(a, b) ((a)+(b)) - #define __Pyx_c_diff(a, b) ((a)-(b)) - #define __Pyx_c_prod(a, b) ((a)*(b)) - #define __Pyx_c_quot(a, b) ((a)/(b)) - #define __Pyx_c_neg(a) (-(a)) + #define __Pyx_c_eq_double(a, b) ((a)==(b)) + #define __Pyx_c_sum_double(a, b) ((a)+(b)) + #define __Pyx_c_diff_double(a, b) ((a)-(b)) + #define __Pyx_c_prod_double(a, b) ((a)*(b)) + #define __Pyx_c_quot_double(a, b) ((a)/(b)) + #define __Pyx_c_neg_double(a) (-(a)) #ifdef __cplusplus - #define __Pyx_c_is_zero(z) ((z)==(double)0) - #define __Pyx_c_conj(z) (::std::conj(z)) + #define __Pyx_c_is_zero_double(z) ((z)==(double)0) + #define __Pyx_c_conj_double(z) (::std::conj(z)) #if 1 - #define __Pyx_c_abs(z) (::std::abs(z)) - #define __Pyx_c_pow(a, b) (::std::pow(a, b)) + #define __Pyx_c_abs_double(z) (::std::abs(z)) + #define __Pyx_c_pow_double(a, b) (::std::pow(a, b)) #endif #else - #define __Pyx_c_is_zero(z) ((z)==0) - #define __Pyx_c_conj(z) (conj(z)) + #define __Pyx_c_is_zero_double(z) ((z)==0) + #define __Pyx_c_conj_double(z) (conj(z)) #if 1 - #define __Pyx_c_abs(z) (cabs(z)) - #define __Pyx_c_pow(a, b) (cpow(a, b)) + #define __Pyx_c_abs_double(z) (cabs(z)) + #define __Pyx_c_pow_double(a, b) (cpow(a, b)) #endif #endif #else - static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); - static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex); #if 1 - static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex); #endif #endif @@ -1370,6 +1568,7 @@ int __pyx_module_is_main_healpy___query_disc = 0; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_builtin_ImportError; static const char __pyx_k_i[] = "i"; static const char __pyx_k_j[] = "j"; static const char __pyx_k_n[] = "n"; @@ -1416,6 +1615,7 @@ static const char __pyx_k_inclusive[] = "inclusive"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_boundaries[] = "boundaries"; static const char __pyx_k_query_disc[] = "query_disc"; +static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_query_strip[] = "query_strip"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_query_polygon[] = "query_polygon"; @@ -1427,6 +1627,7 @@ static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C cont static const char __pyx_k_Pixel_identifier_is_too_large[] = "Pixel identifier is too large"; static const char __pyx_k_Array_has_to_be_one_dimensional[] = "Array has to be one dimensional"; static const char __pyx_k_home_zonca_zonca_p_software_hea[] = "/home/zonca/zonca/p/software/healpy/healpy/src/_query_disc.pyx"; +static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; static const char __pyx_k_Array_of_pixels_has_to_be_intege[] = "Array of pixels has to be integers"; static const char __pyx_k_Buffer_too_small_to_contain_retu[] = "Buffer too small to contain return value"; @@ -1436,12 +1637,14 @@ static const char __pyx_k_Returns_an_array_containing_vect[] = "Returns an array static const char __pyx_k_Wrong_nside_value_must_be_a_powe[] = "Wrong nside value, must be a power of 2, less than 2**30"; static const char __pyx_k_fact_must_be_a_power_of_2_less_t[] = "fact must be a power of 2, less than 2**30 when nest is True (fact=%d)"; static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; +static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; static PyObject *__pyx_kp_s_Array_has_to_be_one_dimensional; static PyObject *__pyx_kp_s_Array_of_pixels_has_to_be_intege; static PyObject *__pyx_kp_s_Buffer_too_small_to_contain_retu; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; +static PyObject *__pyx_n_s_ImportError; static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; static PyObject *__pyx_kp_s_Pixel_identifier_is_too_large; static PyObject *__pyx_kp_u_Returns_an_array_containing_vect; @@ -1484,6 +1687,8 @@ static PyObject *__pyx_n_s_np; static PyObject *__pyx_n_s_npix; static PyObject *__pyx_n_s_nside; static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to; +static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor; static PyObject *__pyx_n_s_out; static PyObject *__pyx_n_s_pix; static PyObject *__pyx_n_s_pixset; @@ -1533,17 +1738,20 @@ static PyObject *__pyx_tuple__14; static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__19; -static PyObject *__pyx_tuple__21; -static PyObject *__pyx_tuple__23; -static PyObject *__pyx_tuple__25; -static PyObject *__pyx_tuple__27; -static PyObject *__pyx_codeobj__18; -static PyObject *__pyx_codeobj__20; -static PyObject *__pyx_codeobj__22; -static PyObject *__pyx_codeobj__24; -static PyObject *__pyx_codeobj__26; -static PyObject *__pyx_codeobj__28; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_codeobj__21; +static PyObject *__pyx_codeobj__23; +static PyObject *__pyx_codeobj__25; +static PyObject *__pyx_codeobj__27; +static PyObject *__pyx_codeobj__29; +static PyObject *__pyx_codeobj__31; /* "healpy/src/_query_disc.pyx":13 * @cython.boundscheck(False) @@ -1803,7 +2011,7 @@ static PyObject *__pyx_pf_6healpy_11_query_disc_query_disc(CYTHON_UNUSED PyObjec * cdef rangeset[int64] pixset * cdef int factor = fact */ - __pyx_t_7 = __Pyx_PyInt_As_int64(__pyx_v_nside); if (unlikely((__pyx_t_7 == (int64)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int64(__pyx_v_nside); if (unlikely((__pyx_t_7 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error) __pyx_v_hb = T_Healpix_Base (__pyx_t_7, __pyx_v_scheme, SET_NSIDE); /* "healpy/src/_query_disc.pyx":63 @@ -2199,7 +2407,7 @@ static PyObject *__pyx_pf_6healpy_11_query_disc_2query_polygon(CYTHON_UNUSED PyO if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 121, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 121, __pyx_L1_error) @@ -2207,7 +2415,7 @@ static PyObject *__pyx_pf_6healpy_11_query_disc_2query_polygon(CYTHON_UNUSED PyO #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 121, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 121, __pyx_L1_error) @@ -2331,7 +2539,7 @@ static PyObject *__pyx_pf_6healpy_11_query_disc_2query_polygon(CYTHON_UNUSED PyO * # Call query_polygon * cdef rangeset[int64] pixset */ - __pyx_t_10 = __Pyx_PyInt_As_int64(__pyx_v_nside); if (unlikely((__pyx_t_10 == (int64)-1) && PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_As_int64(__pyx_v_nside); if (unlikely((__pyx_t_10 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L1_error) __pyx_v_hb = T_Healpix_Base (__pyx_t_10, __pyx_v_scheme, SET_NSIDE); /* "healpy/src/_query_disc.pyx":135 @@ -2634,7 +2842,8 @@ static PyObject *__pyx_pf_6healpy_11_query_disc_4query_strip(CYTHON_UNUSED PyObj int64 __pyx_t_4; double __pyx_t_5; double __pyx_t_6; - struct __pyx_opt_args_6healpy_11_query_disc_pixset_to_array __pyx_t_7; + bool __pyx_t_7; + struct __pyx_opt_args_6healpy_11_query_disc_pixset_to_array __pyx_t_8; __Pyx_RefNannySetupContext("query_strip", 0); __pyx_pybuffer_buff.pybuffer.buf = NULL; __pyx_pybuffer_buff.refcount = 0; @@ -2727,7 +2936,7 @@ static PyObject *__pyx_pf_6healpy_11_query_disc_4query_strip(CYTHON_UNUSED PyObj * # Call query_polygon * cdef rangeset[int64] pixset */ - __pyx_t_4 = __Pyx_PyInt_As_int64(__pyx_v_nside); if (unlikely((__pyx_t_4 == (int64)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int64(__pyx_v_nside); if (unlikely((__pyx_t_4 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error) __pyx_v_hb = T_Healpix_Base (__pyx_t_4, __pyx_v_scheme, SET_NSIDE); /* "healpy/src/_query_disc.pyx":188 @@ -2739,8 +2948,8 @@ static PyObject *__pyx_pf_6healpy_11_query_disc_4query_strip(CYTHON_UNUSED PyObj */ __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_theta1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L1_error) __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_theta2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_inclusive); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L1_error) - __pyx_v_hb.query_strip(__pyx_t_5, __pyx_t_6, __pyx_t_2, __pyx_v_pixset); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_inclusive); if (unlikely((__pyx_t_7 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_v_hb.query_strip(__pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_v_pixset); /* "healpy/src/_query_disc.pyx":190 * hb.query_strip(theta1, theta2, inclusive, pixset) @@ -2750,9 +2959,9 @@ static PyObject *__pyx_pf_6healpy_11_query_disc_4query_strip(CYTHON_UNUSED PyObj * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_7.__pyx_n = 1; - __pyx_t_7.buff = ((PyObject *)__pyx_v_buff); - __pyx_t_3 = __pyx_f_6healpy_11_query_disc_pixset_to_array(__pyx_v_pixset, &__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_8.__pyx_n = 1; + __pyx_t_8.buff = ((PyObject *)__pyx_v_buff); + __pyx_t_3 = __pyx_f_6healpy_11_query_disc_pixset_to_array(__pyx_v_pixset, &__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -2959,7 +3168,7 @@ static PyObject *__pyx_pf_6healpy_11_query_disc_6_boundaries_single(CYTHON_UNUSE * cdef vector[vec3] bounds * if pix >= (12*nside*nside): */ - __pyx_t_2 = __Pyx_PyInt_As_int64(__pyx_v_nside); if (unlikely((__pyx_t_2 == (int64)-1) && PyErr_Occurred())) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int64(__pyx_v_nside); if (unlikely((__pyx_t_2 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 199, __pyx_L1_error) __pyx_v_hb = T_Healpix_Base (__pyx_t_2, __pyx_v_scheme, SET_NSIDE); /* "healpy/src/_query_disc.pyx":201 @@ -3009,7 +3218,7 @@ static PyObject *__pyx_pf_6healpy_11_query_disc_6_boundaries_single(CYTHON_UNUSE * cdef size_t n = bounds.size() * cdef np.ndarray[double, ndim = 2] out = np.empty((3, n), dtype=np.float) */ - __pyx_t_2 = __Pyx_PyInt_As_int64(__pyx_v_pix); if (unlikely((__pyx_t_2 == (int64)-1) && PyErr_Occurred())) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int64(__pyx_v_pix); if (unlikely((__pyx_t_2 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 203, __pyx_L1_error) __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_v_step); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 203, __pyx_L1_error) __pyx_v_hb.boundaries(__pyx_t_2, __pyx_t_5, __pyx_v_bounds); @@ -3382,7 +3591,7 @@ static PyObject *__pyx_pf_6healpy_11_query_disc_8_boundaries_multiple(CYTHON_UNU * cdef size_t npix = len(pix) * cdef size_t n = step * 4 */ - __pyx_t_2 = __Pyx_PyInt_As_int64(__pyx_v_nside); if (unlikely((__pyx_t_2 == (int64)-1) && PyErr_Occurred())) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int64(__pyx_v_nside); if (unlikely((__pyx_t_2 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 218, __pyx_L1_error) __pyx_v_hb = T_Healpix_Base (__pyx_t_2, __pyx_v_scheme, SET_NSIDE); /* "healpy/src/_query_disc.pyx":219 @@ -3544,7 +3753,7 @@ static PyObject *__pyx_pf_6healpy_11_query_disc_8_boundaries_multiple(CYTHON_UNU */ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_pix, __pyx_v_j, size_t, 0, __Pyx_PyInt_FromSize_t, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyInt_As_int64(__pyx_t_7); if (unlikely((__pyx_t_2 == (int64)-1) && PyErr_Occurred())) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int64(__pyx_t_7); if (unlikely((__pyx_t_2 == ((int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_12 = __Pyx_PyInt_As_size_t(__pyx_v_step); if (unlikely((__pyx_t_12 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 229, __pyx_L1_error) __pyx_v_hb.boundaries(__pyx_t_2, __pyx_t_12, __pyx_v_bounds); @@ -3778,10 +3987,9 @@ static PyObject *__pyx_pf_6healpy_11_query_disc_10boundaries(CYTHON_UNUSED PyObj PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - Py_ssize_t __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; __Pyx_RefNannySetupContext("boundaries", 0); __Pyx_INCREF(__pyx_v_pix); @@ -3831,7 +4039,7 @@ static PyObject *__pyx_pf_6healpy_11_query_disc_10boundaries(CYTHON_UNUSED PyObj __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); @@ -3844,15 +4052,33 @@ static PyObject *__pyx_pf_6healpy_11_query_disc_10boundaries(CYTHON_UNUSED PyObj __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_pix); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } else { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; - __Pyx_INCREF(__pyx_v_pix); - __Pyx_GIVEREF(__pyx_v_pix); - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_pix); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pix}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pix}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + { + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + __Pyx_INCREF(__pyx_v_pix); + __Pyx_GIVEREF(__pyx_v_pix); + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_pix); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 280, __pyx_L1_error) @@ -3877,36 +4103,56 @@ static PyObject *__pyx_pf_6healpy_11_query_disc_10boundaries(CYTHON_UNUSED PyObj __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; - __pyx_t_7 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_1 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_7 = 1; + __pyx_t_1 = 1; } } - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_pix))); - __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_pix))); - PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, ((PyObject *)Py_TYPE(__pyx_v_pix))); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)Py_TYPE(__pyx_v_pix)), __pyx_t_4}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)Py_TYPE(__pyx_v_pix)), __pyx_t_4}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_pix))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_pix))); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_1, ((PyObject *)Py_TYPE(__pyx_v_pix))); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = ((!__pyx_t_2) != 0); - if (__pyx_t_9) { + __pyx_t_8 = ((!__pyx_t_2) != 0); + if (__pyx_t_8) { /* "healpy/src/_query_disc.pyx":282 * if np.isscalar(pix): @@ -3948,15 +4194,15 @@ static PyObject *__pyx_pf_6healpy_11_query_disc_10boundaries(CYTHON_UNUSED PyObj __Pyx_INCREF(__pyx_v_pix); __Pyx_GIVEREF(__pyx_v_pix); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_pix); - __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_step, __pyx_v_step) < 0) __PYX_ERR(0, 283, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_nest, __pyx_v_nest) < 0) __PYX_ERR(0, 283, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_step, __pyx_v_step) < 0) __PYX_ERR(0, 283, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_nest, __pyx_v_nest) < 0) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; @@ -3978,34 +4224,52 @@ static PyObject *__pyx_pf_6healpy_11_query_disc_10boundaries(CYTHON_UNUSED PyObj * if pix.ndim!=1: */ /*else*/ { - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 285, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_8)) { + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } - if (!__pyx_t_8) { + if (!__pyx_t_7) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_pix); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { - __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); __pyx_t_8 = NULL; - __Pyx_INCREF(__pyx_v_pix); - __Pyx_GIVEREF(__pyx_v_pix); - PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_pix); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 285, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pix}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_pix}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + { + __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL; + __Pyx_INCREF(__pyx_v_pix); + __Pyx_GIVEREF(__pyx_v_pix); + PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_pix); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_pix, __pyx_t_4); @@ -4025,41 +4289,63 @@ static PyObject *__pyx_pf_6healpy_11_query_disc_10boundaries(CYTHON_UNUSED PyObj __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_pix, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = NULL; - __pyx_t_7 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_8)) { + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = NULL; + __pyx_t_1 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_7 = 1; + __pyx_t_1 = 1; } } - __pyx_t_10 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (__pyx_t_8) { - __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_t_5}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_t_5}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_1, __pyx_t_5); + __pyx_t_6 = 0; + __pyx_t_5 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_7, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_7, __pyx_t_5); - __pyx_t_6 = 0; - __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_9) { + if (__pyx_t_8) { /* "healpy/src/_query_disc.pyx":287 * pix = np.asarray(pix) @@ -4072,9 +4358,9 @@ static PyObject *__pyx_pf_6healpy_11_query_disc_10boundaries(CYTHON_UNUSED PyObj __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 287, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_9) { + if (__pyx_t_8) { /* "healpy/src/_query_disc.pyx":288 * if np.can_cast(pix.dtype, np.int): @@ -4108,58 +4394,78 @@ static PyObject *__pyx_pf_6healpy_11_query_disc_10boundaries(CYTHON_UNUSED PyObj __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_boundaries_multiple); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_pix, __pyx_n_s_astype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 289, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_pix, __pyx_n_s_astype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10); + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); + __Pyx_DECREF_SET(__pyx_t_9, function); } } if (!__pyx_t_5) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); } else { - __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 289, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_9)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 289, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_nside); __Pyx_GIVEREF(__pyx_v_nside); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_nside); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_nside); __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_step, __pyx_v_step) < 0) __PYX_ERR(0, 289, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_nest, __pyx_v_nest) < 0) __PYX_ERR(0, 289, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 289, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_r = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; /* "healpy/src/_query_disc.pyx":286 @@ -4179,10 +4485,10 @@ static PyObject *__pyx_pf_6healpy_11_query_disc_10boundaries(CYTHON_UNUSED PyObj * # Try to implement pix2ang */ /*else*/ { - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(0, 291, __pyx_L1_error) } } @@ -4201,8 +4507,8 @@ static PyObject *__pyx_pf_6healpy_11_query_disc_10boundaries(CYTHON_UNUSED PyObj __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("healpy._query_disc.boundaries", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -4586,7 +4892,7 @@ static bool __pyx_f_6healpy_11_query_disc_isnsideok(int __pyx_v_nside) { return __pyx_r; } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -4633,7 +4939,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_GIVEREF(__pyx_v_info->obj); } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 * # of flags * * if info == NULL: return # <<<<<<<<<<<<<< @@ -4646,7 +4952,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L0; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 * * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -4655,7 +4961,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -4664,7 +4970,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -4673,7 +4979,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -4683,7 +4989,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -4692,7 +4998,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_copy_shape = 1; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -4702,7 +5008,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L4; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -4714,7 +5020,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L4:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -4728,7 +5034,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L6_bool_binop_done; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -4739,7 +5045,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -4748,7 +5054,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -4761,7 +5067,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 218, __pyx_L1_error) - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -4770,7 +5076,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -4784,7 +5090,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L9_bool_binop_done; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -4795,7 +5101,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L9_bool_binop_done:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -4804,7 +5110,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -4817,7 +5123,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 222, __pyx_L1_error) - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -4826,7 +5132,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -4835,7 +5141,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -4844,7 +5150,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< @@ -4854,7 +5160,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (__pyx_v_copy_shape != 0); if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< @@ -4863,7 +5169,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 * # This is allocated as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -4872,7 +5178,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -4883,7 +5189,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -4892,7 +5198,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -4902,7 +5208,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< @@ -4912,7 +5218,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L11; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -4922,7 +5228,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -4933,7 +5239,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L11:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -4942,7 +5248,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -4951,7 +5257,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -4960,7 +5266,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -4969,7 +5275,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -4981,7 +5287,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -4990,7 +5296,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -5008,7 +5314,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_L15_bool_binop_done:; if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -5021,7 +5327,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = Py_None; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -5031,7 +5337,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L14; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -5047,7 +5353,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L14:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -5057,7 +5363,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -5067,7 +5373,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_4 = __pyx_v_descr->type_num; __pyx_v_t = __pyx_t_4; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -5087,7 +5393,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L20_next_or:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -5104,7 +5410,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L19_bool_binop_done:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -5113,7 +5419,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -5126,7 +5432,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 259, __pyx_L1_error) - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -5135,7 +5441,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -5147,7 +5453,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"b"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -5158,7 +5464,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"B"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -5169,7 +5475,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"h"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -5180,7 +5486,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"H"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -5191,7 +5497,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"i"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -5202,7 +5508,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"I"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -5213,7 +5519,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"l"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -5224,7 +5530,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"L"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -5235,7 +5541,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"q"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -5246,7 +5552,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Q"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -5257,7 +5563,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"f"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -5268,7 +5574,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"d"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -5279,7 +5585,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"g"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -5290,7 +5596,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zf"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -5301,7 +5607,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zd"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -5312,7 +5618,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zg"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -5324,7 +5630,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -5350,7 +5656,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -5359,7 +5665,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -5369,7 +5675,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_r = 0; goto __pyx_L0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -5378,7 +5684,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -5388,7 +5694,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->format = ((char *)malloc(0xFF)); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 * else: * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -5397,7 +5703,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -5406,7 +5712,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< @@ -5416,7 +5722,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) __pyx_v_f = __pyx_t_7; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -5426,7 +5732,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -5458,7 +5764,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -5482,7 +5788,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -5492,7 +5798,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -5501,7 +5807,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ free(__pyx_v_info->format); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -5510,7 +5816,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -5520,7 +5826,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -5529,7 +5835,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ free(__pyx_v_info->strides); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -5538,7 +5844,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -5550,7 +5856,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -5564,7 +5870,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -5578,7 +5884,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -5597,7 +5903,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -5611,7 +5917,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -5625,7 +5931,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -5644,7 +5950,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -5658,7 +5964,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -5672,7 +5978,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -5691,7 +5997,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -5705,7 +6011,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -5719,7 +6025,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -5738,7 +6044,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -5752,7 +6058,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -5766,7 +6072,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -5785,7 +6091,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -5814,7 +6120,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx char *__pyx_t_9; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 * * cdef dtype child * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -5823,7 +6129,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 * cdef dtype child * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -5832,7 +6138,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -5846,7 +6152,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) @@ -5855,7 +6161,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); __pyx_t_3 = 0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -5872,7 +6178,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -5881,7 +6187,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (likely(__pyx_v_fields != Py_None)) { PyObject* sequence = __pyx_v_fields; - #if CYTHON_COMPILING_IN_CPYTHON + #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); @@ -5891,7 +6197,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(1, 796, __pyx_L1_error) } - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_3); @@ -5911,7 +6217,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -5928,7 +6234,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (__pyx_t_6) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -5941,7 +6247,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 799, __pyx_L1_error) - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -5950,7 +6256,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -5970,7 +6276,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L8_next_or:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -5987,7 +6293,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = __pyx_t_7; __pyx_L7_bool_binop_done:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -5996,7 +6302,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (__pyx_t_6) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -6009,7 +6315,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 803, __pyx_L1_error) - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -6018,7 +6324,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -6034,7 +6340,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -6043,7 +6349,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 0x78; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -6052,7 +6358,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -6063,7 +6369,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -6073,7 +6379,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_8 = 0; (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -6083,7 +6389,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); if (__pyx_t_6) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -6095,7 +6401,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -6105,7 +6411,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); if (__pyx_t_6) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -6118,7 +6424,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(1, 823, __pyx_L1_error) - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -6127,7 +6433,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< @@ -6145,7 +6451,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< @@ -6163,7 +6469,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< @@ -6181,7 +6487,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< @@ -6199,7 +6505,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< @@ -6217,7 +6523,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< @@ -6235,7 +6541,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< @@ -6253,7 +6559,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< @@ -6271,7 +6577,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< @@ -6289,7 +6595,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< @@ -6307,7 +6613,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< @@ -6325,7 +6631,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< @@ -6343,7 +6649,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< @@ -6361,7 +6667,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< @@ -6381,7 +6687,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< @@ -6401,7 +6707,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< @@ -6421,7 +6727,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< @@ -6439,7 +6745,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -6463,7 +6769,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L15:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -6472,7 +6778,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -6482,7 +6788,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L13; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< @@ -6495,7 +6801,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L13:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -6505,7 +6811,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -6515,7 +6821,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -6540,7 +6846,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -6555,7 +6861,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a int __pyx_t_2; __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -6566,7 +6872,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -6575,7 +6881,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_baseptr = NULL; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -6585,7 +6891,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a goto __pyx_L3; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -6595,7 +6901,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a /*else*/ { Py_INCREF(__pyx_v_base); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -6606,7 +6912,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -6615,7 +6921,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -6624,7 +6930,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -6636,7 +6942,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -6650,7 +6956,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -6660,7 +6966,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -6672,7 +6978,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; goto __pyx_L0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -6681,10 +6987,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 * return None * else: * return arr.base # <<<<<<<<<<<<<< + * + * */ /*else*/ { __Pyx_XDECREF(__pyx_r); @@ -6693,7 +7001,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py goto __pyx_L0; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -6708,32 +7016,422 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "_common.pxd":124 - * tsize Num_Alms (int l, int m) - * - * cdef inline Healpix_Map[double]* ndarray2map(np.ndarray[np.float64_t, ndim=1, mode='c'] array, Healpix_Ordering_Scheme scheme) except *: # <<<<<<<<<<<<<< - * """ View a contiguous ndarray as a Healpix Map. """ - * # To ensure that the output map is a view of the input array, the latter +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() */ -static CYTHON_INLINE Healpix_Map *__pyx_f_7_common_ndarray2map(PyArrayObject *__pyx_v_array, enum Healpix_Ordering_Scheme __pyx_v_scheme) { - arr *__pyx_v_a; - Healpix_Map *__pyx_v_map; - __Pyx_LocalBuf_ND __pyx_pybuffernd_array; - __Pyx_Buffer __pyx_pybuffer_array; - Healpix_Map *__pyx_r; +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; __Pyx_RefNannyDeclarations - Py_ssize_t __pyx_t_1; - int __pyx_t_2; + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - size_t __pyx_t_4; - __Pyx_RefNannySetupContext("ndarray2map", 0); - __pyx_pybuffer_array.pybuffer.buf = NULL; - __pyx_pybuffer_array.refcount = 0; - __pyx_pybuffernd_array.data = NULL; - __pyx_pybuffernd_array.rcbuffer = &__pyx_pybuffer_array; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_array", 0); + + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * cdef inline int import_array() except -1: + * try: + * _import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") + */ + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) + + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * try: + * _import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 989, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L10_try_end:; + } + + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_umath", 0); + + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":993 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) + + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":994 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 995, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L10_try_end:; + } + + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_ufunc", 0); + + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":999 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) + + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 1001, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L10_try_end:; + } + + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_common.pxd":124 + * tsize Num_Alms (int l, int m) + * + * cdef inline Healpix_Map[double]* ndarray2map(np.ndarray[np.float64_t, ndim=1, mode='c'] array, Healpix_Ordering_Scheme scheme) except *: # <<<<<<<<<<<<<< + * """ View a contiguous ndarray as a Healpix Map. """ + * # To ensure that the output map is a view of the input array, the latter + */ + +static CYTHON_INLINE Healpix_Map *__pyx_f_7_common_ndarray2map(PyArrayObject *__pyx_v_array, enum Healpix_Ordering_Scheme __pyx_v_scheme) { + arr *__pyx_v_a; + Healpix_Map *__pyx_v_map; + __Pyx_LocalBuf_ND __pyx_pybuffernd_array; + __Pyx_Buffer __pyx_pybuffer_array; + Healpix_Map *__pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __pyx_t_7_common_tsize __pyx_t_4; + __Pyx_RefNannySetupContext("ndarray2map", 0); + __pyx_pybuffer_array.pybuffer.buf = NULL; + __pyx_pybuffer_array.refcount = 0; + __pyx_pybuffernd_array.data = NULL; + __pyx_pybuffernd_array.rcbuffer = &__pyx_pybuffer_array; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_array.rcbuffer->pybuffer, (PyObject*)__pyx_v_array, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(2, 124, __pyx_L1_error) } __pyx_pybuffernd_array.diminfo[0].strides = __pyx_pybuffernd_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_array.diminfo[0].shape = __pyx_pybuffernd_array.rcbuffer->pybuffer.shape[0]; @@ -6843,7 +7541,7 @@ static CYTHON_INLINE Alm > *__pyx_f_7_common_ndarray2alm(PyArr Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; - size_t __pyx_t_4; + __pyx_t_7_common_tsize __pyx_t_4; __Pyx_RefNannySetupContext("ndarray2alm", 0); __pyx_pybuffer_array.pybuffer.buf = NULL; __pyx_pybuffer_array.refcount = 0; @@ -6967,6 +7665,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_Buffer_too_small_to_contain_retu, __pyx_k_Buffer_too_small_to_contain_retu, sizeof(__pyx_k_Buffer_too_small_to_contain_retu), 0, 0, 1, 0}, {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, {&__pyx_kp_s_Pixel_identifier_is_too_large, __pyx_k_Pixel_identifier_is_too_large, sizeof(__pyx_k_Pixel_identifier_is_too_large), 0, 0, 1, 0}, {&__pyx_kp_u_Returns_an_array_containing_vect, __pyx_k_Returns_an_array_containing_vect, sizeof(__pyx_k_Returns_an_array_containing_vect), 0, 1, 0, 0}, @@ -7009,6 +7708,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_npix, __pyx_k_npix, sizeof(__pyx_k_npix), 0, 0, 1, 1}, {&__pyx_n_s_nside, __pyx_k_nside, sizeof(__pyx_k_nside), 0, 0, 1, 1}, {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0}, + {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0}, {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1}, {&__pyx_n_s_pix, __pyx_k_pix, sizeof(__pyx_k_pix), 0, 0, 1, 1}, {&__pyx_n_s_pixset, __pyx_k_pixset, sizeof(__pyx_k_pixset), 0, 0, 1, 1}, @@ -7035,6 +7736,7 @@ static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 54, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 206, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -7154,7 +7856,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -7165,7 +7867,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -7176,7 +7878,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -7187,7 +7889,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -7198,7 +7900,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -7209,7 +7911,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -7220,6 +7922,37 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "../../../../anaconda/envs/testhealpy/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + /* "healpy/src/_query_disc.pyx":13 * @cython.boundscheck(False) * @cython.wraparound(False) @@ -7227,10 +7960,10 @@ static int __Pyx_InitCachedConstants(void) { * """Returns pixels whose centers lie within the disk defined by * *vec* and *radius* (in radians) (if *inclusive* is False), or which */ - __pyx_tuple__17 = PyTuple_Pack(13, __pyx_n_s_nside, __pyx_n_s_vec, __pyx_n_s_radius, __pyx_n_s_inclusive, __pyx_n_s_fact, __pyx_n_s_nest, __pyx_n_s_buff, __pyx_n_s_v, __pyx_n_s_scheme, __pyx_n_s_hb, __pyx_n_s_pixset, __pyx_n_s_factor, __pyx_n_s_ptg); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); - __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(7, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_query_disc, 13, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 13, __pyx_L1_error) + __pyx_tuple__20 = PyTuple_Pack(13, __pyx_n_s_nside, __pyx_n_s_vec, __pyx_n_s_radius, __pyx_n_s_inclusive, __pyx_n_s_fact, __pyx_n_s_nest, __pyx_n_s_buff, __pyx_n_s_v, __pyx_n_s_scheme, __pyx_n_s_hb, __pyx_n_s_pixset, __pyx_n_s_factor, __pyx_n_s_ptg); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(7, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_query_disc, 13, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 13, __pyx_L1_error) /* "healpy/src/_query_disc.pyx":78 * @@ -7239,10 +7972,10 @@ static int __Pyx_InitCachedConstants(void) { * """ Returns the pixels whose centers lie within the convex polygon * defined by the *vertices* array (if *inclusive* is False), or which */ - __pyx_tuple__19 = PyTuple_Pack(13, __pyx_n_s_nside, __pyx_n_s_vertices, __pyx_n_s_inclusive, __pyx_n_s_fact, __pyx_n_s_nest, __pyx_n_s_buff, __pyx_n_s_vert, __pyx_n_s_ptg, __pyx_n_s_v, __pyx_n_s_scheme, __pyx_n_s_hb, __pyx_n_s_pixset, __pyx_n_s_factor); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 78, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); - __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(6, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_query_polygon, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_tuple__22 = PyTuple_Pack(13, __pyx_n_s_nside, __pyx_n_s_vertices, __pyx_n_s_inclusive, __pyx_n_s_fact, __pyx_n_s_nest, __pyx_n_s_buff, __pyx_n_s_vert, __pyx_n_s_ptg, __pyx_n_s_v, __pyx_n_s_scheme, __pyx_n_s_hb, __pyx_n_s_pixset, __pyx_n_s_factor); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(6, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_query_polygon, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 78, __pyx_L1_error) /* "healpy/src/_query_disc.pyx":146 * return pixset_to_array(pixset, buff) @@ -7251,10 +7984,10 @@ static int __Pyx_InitCachedConstants(void) { * """Returns pixels whose centers lie within the colatitude range * defined by *theta1* and *theta2* (if inclusive is False), or which */ - __pyx_tuple__21 = PyTuple_Pack(9, __pyx_n_s_nside, __pyx_n_s_theta1, __pyx_n_s_theta2, __pyx_n_s_inclusive, __pyx_n_s_nest, __pyx_n_s_buff, __pyx_n_s_scheme, __pyx_n_s_hb, __pyx_n_s_pixset); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); - __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(6, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_query_strip, 146, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_tuple__24 = PyTuple_Pack(9, __pyx_n_s_nside, __pyx_n_s_theta1, __pyx_n_s_theta2, __pyx_n_s_inclusive, __pyx_n_s_nest, __pyx_n_s_buff, __pyx_n_s_scheme, __pyx_n_s_hb, __pyx_n_s_pixset); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(6, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_query_strip, 146, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 146, __pyx_L1_error) /* "healpy/src/_query_disc.pyx":193 * @@ -7263,10 +7996,10 @@ static int __Pyx_InitCachedConstants(void) { * cdef Healpix_Ordering_Scheme scheme * if nest: */ - __pyx_tuple__23 = PyTuple_Pack(10, __pyx_n_s_nside, __pyx_n_s_pix, __pyx_n_s_step, __pyx_n_s_nest, __pyx_n_s_scheme, __pyx_n_s_hb, __pyx_n_s_bounds, __pyx_n_s_n, __pyx_n_s_out, __pyx_n_s_i); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); - __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_boundaries_single, 193, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_tuple__26 = PyTuple_Pack(10, __pyx_n_s_nside, __pyx_n_s_pix, __pyx_n_s_step, __pyx_n_s_nest, __pyx_n_s_scheme, __pyx_n_s_hb, __pyx_n_s_bounds, __pyx_n_s_n, __pyx_n_s_out, __pyx_n_s_i); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_boundaries_single, 193, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 193, __pyx_L1_error) /* "healpy/src/_query_disc.pyx":212 * return out @@ -7275,10 +8008,10 @@ static int __Pyx_InitCachedConstants(void) { * cdef Healpix_Ordering_Scheme scheme * if nest: */ - __pyx_tuple__25 = PyTuple_Pack(13, __pyx_n_s_nside, __pyx_n_s_pix, __pyx_n_s_step, __pyx_n_s_nest, __pyx_n_s_scheme, __pyx_n_s_hb, __pyx_n_s_npix, __pyx_n_s_n, __pyx_n_s_maxnpix, __pyx_n_s_out, __pyx_n_s_bounds, __pyx_n_s_j, __pyx_n_s_i); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); - __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_boundaries_multiple, 212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_tuple__28 = PyTuple_Pack(13, __pyx_n_s_nside, __pyx_n_s_pix, __pyx_n_s_step, __pyx_n_s_nest, __pyx_n_s_scheme, __pyx_n_s_hb, __pyx_n_s_npix, __pyx_n_s_n, __pyx_n_s_maxnpix, __pyx_n_s_out, __pyx_n_s_bounds, __pyx_n_s_j, __pyx_n_s_i); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_boundaries_multiple, 212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 212, __pyx_L1_error) /* "healpy/src/_query_disc.pyx":236 * return out @@ -7287,10 +8020,10 @@ static int __Pyx_InitCachedConstants(void) { * """Returns an array containing vectors to the boundary of * the nominated pixel. */ - __pyx_tuple__27 = PyTuple_Pack(4, __pyx_n_s_nside, __pyx_n_s_pix, __pyx_n_s_step, __pyx_n_s_nest); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 236, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); - __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_boundaries, 236, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_tuple__30 = PyTuple_Pack(4, __pyx_n_s_nside, __pyx_n_s_pix, __pyx_n_s_step, __pyx_n_s_nest); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_boundaries, 236, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -8310,7 +9043,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg #endif /* PyErrFetchRestore */ - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; @@ -8507,7 +9240,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); @@ -8522,7 +9255,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); @@ -8537,7 +9270,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { @@ -8580,7 +9313,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, /* GetModuleGlobalName */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; -#if CYTHON_COMPILING_IN_CPYTHON +#if !CYTHON_AVOID_BORROWED_REFS result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); @@ -8614,6 +9347,144 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, "Out of bounds on buffer access (axis %d)", axis); } +/* PyCFunctionFastCall */ + #if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); +} +#endif // CYTHON_FAST_PYCCALL + +/* PyFunctionFastCall */ + #if CYTHON_FAST_PYCALL +#include "frameobject.h" +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = PyThreadState_GET(); + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = f->f_localsplus; + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif // CPython < 3.6 +#endif // CYTHON_FAST_PYCALL + /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { @@ -8647,6 +9518,11 @@ static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else @@ -8654,6 +9530,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif } } return __Pyx__PyObject_CallOneArg(func, arg); @@ -8680,7 +9560,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_USE_TYPE_SLOTS PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; @@ -8756,7 +9636,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_USE_TYPE_SLOTS result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); @@ -8790,8 +9670,103 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } +/* SaveResetException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { + PyObject *exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + return PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetException */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { +#endif + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -8865,7 +9840,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec } /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; @@ -8945,7 +9920,7 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -9018,7 +9993,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; - py_frame->f_lineno = py_line; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); @@ -9046,8 +10021,8 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif - /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + /* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) @@ -9069,7 +10044,7 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -9077,14 +10052,18 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif } } { @@ -9096,7 +10075,7 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64(int64 value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64(int64 value) { const int64 neg_one = (int64) -1, const_zero = (int64) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -9104,14 +10083,18 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { return PyInt_FromLong((long) value); } else if (sizeof(int64) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG } else if (sizeof(int64) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif } } else { if (sizeof(int64) <= sizeof(long)) { return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG } else if (sizeof(int64) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif } } { @@ -9122,8 +10105,8 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } } -/* None */ - #if CYTHON_CCOMPLEX +/* Declarations */ + #if CYTHON_CCOMPLEX #ifdef __cplusplus static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { return ::std::complex< float >(x, y); @@ -9142,61 +10125,86 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } #endif -/* None */ - #if CYTHON_CCOMPLEX +/* Arithmetic */ + #if CYTHON_CCOMPLEX #else - static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { return (a.real == b.real) && (a.imag == b.imag); } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { __pyx_t_float_complex z; z.real = a.real + b.real; z.imag = a.imag + b.imag; return z; } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { __pyx_t_float_complex z; z.real = a.real - b.real; z.imag = a.imag - b.imag; return z; } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { __pyx_t_float_complex z; z.real = a.real * b.real - a.imag * b.imag; z.imag = a.real * b.imag + a.imag * b.real; return z; } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - float denom = b.real * b.real + b.imag * b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; + #if 1 + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabsf(b.real) >= fabsf(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + float r = b.imag / b.real; + float s = 1.0 / (b.real + b.imag * r); + return __pyx_t_float_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + float r = b.real / b.imag; + float s = 1.0 / (b.imag + b.real * r); + return __pyx_t_float_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + float denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_float_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { + #endif + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) { __pyx_t_float_complex z; z.real = -a.real; z.imag = -a.imag; return z; } - static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) { return (a.real == 0) && (a.imag == 0); } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) { __pyx_t_float_complex z; z.real = a.real; z.imag = -a.imag; return z; } #if 1 - static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) { #if !defined(HAVE_HYPOT) || defined(_MSC_VER) return sqrtf(z.real*z.real + z.imag*z.imag); #else return hypotf(z.real, z.imag); #endif } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { __pyx_t_float_complex z; float r, lnr, theta, z_r, z_theta; if (b.imag == 0 && b.real == (int)b.real) { @@ -9214,24 +10222,32 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { case 1: return a; case 2: - z = __Pyx_c_prodf(a, a); - return __Pyx_c_prodf(a, a); + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(a, a); case 3: - z = __Pyx_c_prodf(a, a); - return __Pyx_c_prodf(z, a); + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, a); case 4: - z = __Pyx_c_prodf(a, a); - return __Pyx_c_prodf(z, z); + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, z); } } if (a.imag == 0) { if (a.real == 0) { return a; + } else if (b.imag == 0) { + z.real = powf(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2f(0, -1); } - r = a.real; - theta = 0; } else { - r = __Pyx_c_absf(a); + r = __Pyx_c_abs_float(a); theta = atan2f(a.imag, a.real); } lnr = logf(r); @@ -9244,8 +10260,8 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif #endif -/* None */ - #if CYTHON_CCOMPLEX +/* Declarations */ + #if CYTHON_CCOMPLEX #ifdef __cplusplus static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { return ::std::complex< double >(x, y); @@ -9264,61 +10280,86 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } #endif -/* None */ - #if CYTHON_CCOMPLEX +/* Arithmetic */ + #if CYTHON_CCOMPLEX #else - static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { return (a.real == b.real) && (a.imag == b.imag); } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { __pyx_t_double_complex z; z.real = a.real + b.real; z.imag = a.imag + b.imag; return z; } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { __pyx_t_double_complex z; z.real = a.real - b.real; z.imag = a.imag - b.imag; return z; } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { __pyx_t_double_complex z; z.real = a.real * b.real - a.imag * b.imag; z.imag = a.real * b.imag + a.imag * b.real; return z; } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - double denom = b.real * b.real + b.imag * b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; + #if 1 + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabs(b.real) >= fabs(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + double r = b.imag / b.real; + double s = 1.0 / (b.real + b.imag * r); + return __pyx_t_double_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + double r = b.real / b.imag; + double s = 1.0 / (b.imag + b.real * r); + return __pyx_t_double_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { + #else + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + double denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_double_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) { __pyx_t_double_complex z; z.real = -a.real; z.imag = -a.imag; return z; } - static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) { return (a.real == 0) && (a.imag == 0); } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) { __pyx_t_double_complex z; z.real = a.real; z.imag = -a.imag; return z; } #if 1 - static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) { #if !defined(HAVE_HYPOT) || defined(_MSC_VER) return sqrt(z.real*z.real + z.imag*z.imag); #else return hypot(z.real, z.imag); #endif } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { __pyx_t_double_complex z; double r, lnr, theta, z_r, z_theta; if (b.imag == 0 && b.real == (int)b.real) { @@ -9336,24 +10377,32 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { case 1: return a; case 2: - z = __Pyx_c_prod(a, a); - return __Pyx_c_prod(a, a); + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(a, a); case 3: - z = __Pyx_c_prod(a, a); - return __Pyx_c_prod(z, a); + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, a); case 4: - z = __Pyx_c_prod(a, a); - return __Pyx_c_prod(z, z); + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, z); } } if (a.imag == 0) { if (a.real == 0) { return a; + } else if (b.imag == 0) { + z.real = pow(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2(0, -1); } - r = a.real; - theta = 0; } else { - r = __Pyx_c_abs(a); + r = __Pyx_c_abs_double(a); theta = atan2(a.imag, a.real); } lnr = log(r); @@ -9367,7 +10416,7 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -9375,14 +10424,18 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif } } { @@ -9394,7 +10447,7 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -9402,14 +10455,18 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { return PyInt_FromLong((long) value); } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif } } else { if (sizeof(enum NPY_TYPES) <= sizeof(long)) { return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif } } { @@ -9421,7 +10478,7 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 @@ -9488,8 +10545,10 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif } } else { #if CYTHON_USE_PYLONG_INTERNALS @@ -9556,8 +10615,10 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif } } { @@ -9606,7 +10667,7 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } /* CIntFromPy */ - static CYTHON_INLINE int64 __Pyx_PyInt_As_int64(PyObject *x) { + static CYTHON_INLINE int64 __Pyx_PyInt_As_int64(PyObject *x) { const int64 neg_one = (int64) -1, const_zero = (int64) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 @@ -9673,8 +10734,10 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif if (sizeof(int64) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int64, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG } else if (sizeof(int64) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif } } else { #if CYTHON_USE_PYLONG_INTERNALS @@ -9741,8 +10804,10 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif if (sizeof(int64) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int64, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG } else if (sizeof(int64) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int64, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif } } { @@ -9791,7 +10856,7 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } /* CIntFromPy */ - static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { + static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 @@ -9858,8 +10923,10 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif if (sizeof(size_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif } } else { #if CYTHON_USE_PYLONG_INTERNALS @@ -9926,8 +10993,10 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif if (sizeof(size_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif } } { @@ -9976,7 +11045,7 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 @@ -10043,8 +11112,10 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif } } else { #if CYTHON_USE_PYLONG_INTERNALS @@ -10111,8 +11182,10 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif } } { @@ -10161,7 +11234,7 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); @@ -10177,7 +11250,7 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -10195,7 +11268,7 @@ static PyObject *__Pyx_ImportModule(const char *name) { #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) @@ -10260,7 +11333,7 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -10361,7 +11434,9 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; +#endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 @@ -10370,8 +11445,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; -#if PY_MAJOR_VERSION < 3 + #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); @@ -10380,11 +11456,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { name = "long"; res = PyNumber_Long(x); } -#else + #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } + #endif +#else + res = PyNumber_Int(x); #endif if (res) { #if PY_MAJOR_VERSION < 3 diff --git a/src/healpy/healpy/src/_sphtools.cpp b/src/healpy/healpy/src/_sphtools.cpp index ca3572a..00af63c 100644 --- a/src/healpy/healpy/src/_sphtools.cpp +++ b/src/healpy/healpy/src/_sphtools.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.24 */ +/* Generated by Cython 0.25.2 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,7 +7,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_24" +#define CYTHON_ABI "0_25_2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -29,6 +29,11 @@ #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) + #define HAVE_LONG_LONG + #endif +#endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif @@ -37,13 +42,110 @@ #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 #else #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif #endif -#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 - #define CYTHON_USE_PYLONG_INTERNALS 1 +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" @@ -79,24 +181,44 @@ #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif +#ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #else #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY @@ -110,6 +232,9 @@ #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif @@ -118,6 +243,13 @@ #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 @@ -146,6 +278,7 @@ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type @@ -184,18 +317,20 @@ #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif -#if PY_VERSION_HEX >= 0x030500B1 -#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods -#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) -#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; -} __Pyx_PyAsyncMethodsStruct; -#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif #else -#define __Pyx_PyType_AsAsync(obj) NULL + #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) @@ -208,13 +343,44 @@ typedef struct { #define CYTHON_RESTRICT #endif #endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef __cplusplus #error "Cython files generated with the C++ option must be compiled with a C++ compiler." #endif #ifndef CYTHON_INLINE - #define CYTHON_INLINE inline + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #else + #define CYTHON_INLINE inline + #endif #endif template void __Pyx_call_destructor(T& x) { @@ -226,7 +392,10 @@ class __Pyx_FakeReference { __Pyx_FakeReference() : ptr(NULL) { } __Pyx_FakeReference(const T& ref) : ptr(const_cast(&ref)) { } T *operator->() { return ptr; } + T *operator&() { return ptr; } operator T&() { return *ptr; } + template bool operator ==(U other) { return *ptr == other; } + template bool operator !=(U other) { return *ptr != other; } private: T *ptr; }; @@ -244,6 +413,11 @@ static CYTHON_INLINE float __PYX_NAN() { return value; } #endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif #define __PYX_ERR(f_index, lineno, Ln_error) \ @@ -269,9 +443,9 @@ static CYTHON_INLINE float __PYX_NAN() { #define __PYX_HAVE__healpy___sphtools #define __PYX_HAVE_API__healpy___sphtools -#include "string.h" -#include "stdio.h" -#include "stdlib.h" +#include +#include +#include #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" #include @@ -279,7 +453,7 @@ static CYTHON_INLINE float __PYX_NAN() { #include "new" #include "stdexcept" #include "typeinfo" -#include "math.h" +#include #include #include "stddef.h" #include "datatypes.h" @@ -302,26 +476,6 @@ static CYTHON_INLINE float __PYX_NAN() { #define CYTHON_WITHOUT_ASSERTIONS #endif -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON -# define CYTHON_NCP_UNUSED -# else -# define CYTHON_NCP_UNUSED CYTHON_UNUSED -# endif -#endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; @@ -399,7 +553,7 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) @@ -507,7 +661,7 @@ static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; -/* None.proto */ +/* Header.proto */ #if !defined(CYTHON_CCOMPLEX) #if defined(__cplusplus) #define CYTHON_CCOMPLEX 1 @@ -532,8 +686,8 @@ static const char *__pyx_filename; static const char *__pyx_f[] = { "healpy/src/_sphtools.pyx", - "healpy/src/_common.pxd", "__init__.pxd", + "healpy/src/_common.pxd", "type.pxd", }; /* BufferFormatStructs.proto */ @@ -573,7 +727,7 @@ typedef struct { } __Pyx_BufFmt_Context; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":725 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":725 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -582,7 +736,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":726 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":726 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -591,7 +745,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":727 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":727 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -600,7 +754,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":728 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":728 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -609,7 +763,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":732 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":732 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -618,7 +772,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":733 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":733 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -627,7 +781,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":734 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":734 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -636,7 +790,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":735 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":735 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -645,7 +799,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":739 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":739 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -654,7 +808,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":740 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":740 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -663,7 +817,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":749 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":749 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -672,7 +826,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":750 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":750 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -681,7 +835,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":751 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":751 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -690,7 +844,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":753 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":753 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -699,7 +853,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":754 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":754 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -708,7 +862,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":755 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":755 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -717,7 +871,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":757 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":757 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -726,7 +880,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -735,7 +889,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":760 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":760 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -744,7 +898,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":761 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":761 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -753,7 +907,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":762 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":762 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -788,7 +942,7 @@ typedef size_t __pyx_t_7_common_tsize; * cdef extern from "datatypes.h": */ typedef ptrdiff_t __pyx_t_7_common_tdiff; -/* None.proto */ +/* Declarations.proto */ #if CYTHON_CCOMPLEX #ifdef __cplusplus typedef ::std::complex< double > __pyx_t_double_complex; @@ -798,8 +952,9 @@ typedef ptrdiff_t __pyx_t_7_common_tdiff; #else typedef struct { double real, imag; } __pyx_t_double_complex; #endif +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); -/* None.proto */ +/* Declarations.proto */ #if CYTHON_CCOMPLEX #ifdef __cplusplus typedef ::std::complex< float > __pyx_t_float_complex; @@ -809,11 +964,12 @@ typedef ptrdiff_t __pyx_t_7_common_tdiff; #else typedef struct { float real, imag; } __pyx_t_float_complex; #endif +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); /*--- Type declarations ---*/ -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":764 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":764 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -822,7 +978,7 @@ typedef ptrdiff_t __pyx_t_7_common_tdiff; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":765 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":765 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -831,7 +987,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":766 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":766 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -840,7 +996,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":768 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":768 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -914,7 +1070,7 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t; #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyObjectGetAttrStr.proto */ -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) @@ -935,6 +1091,24 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* GetModuleGlobalName.proto */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#endif + /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); @@ -963,7 +1137,7 @@ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ const char* function_name); /* ListCompAppend.proto */ -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); @@ -1005,7 +1179,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* PyThreadStateGet.proto */ -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); #else @@ -1014,7 +1188,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, #endif /* PyErrFetchRestore.proto */ -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_FAST_THREAD_STATE #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) @@ -1044,7 +1218,7 @@ static CYTHON_INLINE int __Pyx_IterFinish(void); static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* PyIntBinop.proto */ -#if CYTHON_COMPILING_IN_CPYTHON +#if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\ @@ -1062,7 +1236,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #endif /* PyIntBinop.proto */ -#if CYTHON_COMPILING_IN_CPYTHON +#if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\ @@ -1086,7 +1260,7 @@ static void __Pyx_RaiseBufferIndexError(int axis); #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) /* ListAppend.proto */ -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); @@ -1117,7 +1291,7 @@ static void __Pyx_WriteUnraisable(const char *name, int clineno, int full_traceback, int nogil); /* PyIntBinop.proto */ -#if CYTHON_COMPILING_IN_CPYTHON +#if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_AddCObj(op1, op2, intval, inplace)\ @@ -1125,7 +1299,7 @@ static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, #endif /* PyObjectSetAttrStr.proto */ -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); @@ -1146,7 +1320,6 @@ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); -#define __Pyx_BufPtrCContig1d(type, buf, i0, s0) ((type)buf + i0) /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { @@ -1171,6 +1344,34 @@ static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +#define __Pyx_BufPtrCContig1d(type, buf, i0, s0) ((type)buf + i0) /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); @@ -1245,6 +1446,8 @@ static void __Pyx_CppExn2PyErr() { PyErr_SetString(PyExc_MemoryError, exn.what()); } catch (const std::bad_cast& exn) { PyErr_SetString(PyExc_TypeError, exn.what()); + } catch (const std::bad_typeid& exn) { + PyErr_SetString(PyExc_TypeError, exn.what()); } catch (const std::domain_error& exn) { PyErr_SetString(PyExc_ValueError, exn.what()); } catch (const std::invalid_argument& exn) { @@ -1269,7 +1472,7 @@ static void __Pyx_CppExn2PyErr() { } #endif -/* None.proto */ +/* RealImag.proto */ #if CYTHON_CCOMPLEX #ifdef __cplusplus #define __Pyx_CREAL(z) ((z).real()) @@ -1282,7 +1485,8 @@ static void __Pyx_CppExn2PyErr() { #define __Pyx_CREAL(z) ((z).real) #define __Pyx_CIMAG(z) ((z).imag) #endif -#if defined(__cplusplus) && CYTHON_CCOMPLEX && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) +#if defined(__cplusplus) && CYTHON_CCOMPLEX\ + && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) #define __Pyx_SET_CREAL(z,x) ((z).real(x)) #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) #else @@ -1290,88 +1494,82 @@ static void __Pyx_CppExn2PyErr() { #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) #endif -/* None.proto */ -static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); - -/* None.proto */ +/* Arithmetic.proto */ #if CYTHON_CCOMPLEX - #define __Pyx_c_eq(a, b) ((a)==(b)) - #define __Pyx_c_sum(a, b) ((a)+(b)) - #define __Pyx_c_diff(a, b) ((a)-(b)) - #define __Pyx_c_prod(a, b) ((a)*(b)) - #define __Pyx_c_quot(a, b) ((a)/(b)) - #define __Pyx_c_neg(a) (-(a)) + #define __Pyx_c_eq_double(a, b) ((a)==(b)) + #define __Pyx_c_sum_double(a, b) ((a)+(b)) + #define __Pyx_c_diff_double(a, b) ((a)-(b)) + #define __Pyx_c_prod_double(a, b) ((a)*(b)) + #define __Pyx_c_quot_double(a, b) ((a)/(b)) + #define __Pyx_c_neg_double(a) (-(a)) #ifdef __cplusplus - #define __Pyx_c_is_zero(z) ((z)==(double)0) - #define __Pyx_c_conj(z) (::std::conj(z)) + #define __Pyx_c_is_zero_double(z) ((z)==(double)0) + #define __Pyx_c_conj_double(z) (::std::conj(z)) #if 1 - #define __Pyx_c_abs(z) (::std::abs(z)) - #define __Pyx_c_pow(a, b) (::std::pow(a, b)) + #define __Pyx_c_abs_double(z) (::std::abs(z)) + #define __Pyx_c_pow_double(a, b) (::std::pow(a, b)) #endif #else - #define __Pyx_c_is_zero(z) ((z)==0) - #define __Pyx_c_conj(z) (conj(z)) + #define __Pyx_c_is_zero_double(z) ((z)==0) + #define __Pyx_c_conj_double(z) (conj(z)) #if 1 - #define __Pyx_c_abs(z) (cabs(z)) - #define __Pyx_c_pow(a, b) (cpow(a, b)) + #define __Pyx_c_abs_double(z) (cabs(z)) + #define __Pyx_c_pow_double(a, b) (cpow(a, b)) #endif #endif #else - static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); - static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex); #if 1 - static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex); #endif #endif /* None.proto */ static CYTHON_INLINE long __Pyx_pow_long(long, long); -/* None.proto */ -static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); - -/* None.proto */ +/* Arithmetic.proto */ #if CYTHON_CCOMPLEX - #define __Pyx_c_eqf(a, b) ((a)==(b)) - #define __Pyx_c_sumf(a, b) ((a)+(b)) - #define __Pyx_c_difff(a, b) ((a)-(b)) - #define __Pyx_c_prodf(a, b) ((a)*(b)) - #define __Pyx_c_quotf(a, b) ((a)/(b)) - #define __Pyx_c_negf(a) (-(a)) + #define __Pyx_c_eq_float(a, b) ((a)==(b)) + #define __Pyx_c_sum_float(a, b) ((a)+(b)) + #define __Pyx_c_diff_float(a, b) ((a)-(b)) + #define __Pyx_c_prod_float(a, b) ((a)*(b)) + #define __Pyx_c_quot_float(a, b) ((a)/(b)) + #define __Pyx_c_neg_float(a) (-(a)) #ifdef __cplusplus - #define __Pyx_c_is_zerof(z) ((z)==(float)0) - #define __Pyx_c_conjf(z) (::std::conj(z)) + #define __Pyx_c_is_zero_float(z) ((z)==(float)0) + #define __Pyx_c_conj_float(z) (::std::conj(z)) #if 1 - #define __Pyx_c_absf(z) (::std::abs(z)) - #define __Pyx_c_powf(a, b) (::std::pow(a, b)) + #define __Pyx_c_abs_float(z) (::std::abs(z)) + #define __Pyx_c_pow_float(a, b) (::std::pow(a, b)) #endif #else - #define __Pyx_c_is_zerof(z) ((z)==0) - #define __Pyx_c_conjf(z) (conjf(z)) + #define __Pyx_c_is_zero_float(z) ((z)==0) + #define __Pyx_c_conj_float(z) (conjf(z)) #if 1 - #define __Pyx_c_absf(z) (cabsf(z)) - #define __Pyx_c_powf(a, b) (cpowf(a, b)) + #define __Pyx_c_abs_float(z) (cabsf(z)) + #define __Pyx_c_pow_float(a, b) (cpowf(a, b)) #endif #endif #else - static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); - static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex); #if 1 - static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex); #endif #endif @@ -1477,6 +1675,8 @@ static PyObject *__pyx_builtin_IOError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_xrange; static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_builtin_ImportError; +static const char __pyx_k_C[] = "C"; static const char __pyx_k_a[] = "a"; static const char __pyx_k_f[] = "f"; static const char __pyx_k_i[] = "i"; @@ -1503,6 +1703,7 @@ static const char __pyx_k_mq[] = "mq"; static const char __pyx_k_mu[] = "mu"; static const char __pyx_k_np[] = "np"; static const char __pyx_k_os[] = "os"; +static const char __pyx_k_abs[] = "abs"; static const char __pyx_k_alm[] = "alm"; static const char __pyx_k_len[] = "__len__"; static const char __pyx_k_phi[] = "phi"; @@ -1535,6 +1736,7 @@ static const char __pyx_k_spin[] = "spin"; static const char __pyx_k_sqrt[] = "sqrt"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_Nspec[] = "Nspec"; +static const char __pyx_k_UTF_8[] = "UTF-8"; static const char __pyx_k_alm_2[] = "alm_"; static const char __pyx_k_alms2[] = "alms2"; static const char __pyx_k_array[] = "array"; @@ -1546,6 +1748,7 @@ static const char __pyx_k_n_alm[] = "n_alm"; static const char __pyx_k_niter[] = "niter"; static const char __pyx_k_nside[] = "nside"; static const char __pyx_k_numpy[] = "numpy"; +static const char __pyx_k_order[] = "order"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_theta[] = "theta"; static const char __pyx_k_w_arr[] = "w_arr"; @@ -1555,11 +1758,16 @@ static const char __pyx_k_alm2cl[] = "alm2cl"; static const char __pyx_k_alms_c[] = "alms_c"; static const char __pyx_k_almxfl[] = "almxfl"; static const char __pyx_k_append[] = "append"; +static const char __pyx_k_arange[] = "arange"; +static const char __pyx_k_astype[] = "astype"; +static const char __pyx_k_decode[] = "decode"; +static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_flsize[] = "flsize"; static const char __pyx_k_healpy[] = "healpy"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_isfile[] = "isfile"; static const char __pyx_k_lmax_2[] = "lmax_"; +static const char __pyx_k_lonlat[] = "lonlat"; static const char __pyx_k_maps_c[] = "maps_c"; static const char __pyx_k_mmax_2[] = "mmax_"; static const char __pyx_k_xrange[] = "xrange"; @@ -1568,17 +1776,18 @@ static const char __pyx_k_abspath[] = "abspath"; static const char __pyx_k_almsize[] = "almsize"; static const char __pyx_k_dirname[] = "dirname"; static const char __pyx_k_float64[] = "float64"; +static const char __pyx_k_gal_cut[] = "gal_cut"; static const char __pyx_k_inplace[] = "inplace"; static const char __pyx_k_map2alm[] = "map2alm"; static const char __pyx_k_maptype[] = "maptype"; -static const char __pyx_k_mask_mi[] = "mask_mi"; -static const char __pyx_k_mask_mq[] = "mask_mq"; -static const char __pyx_k_mask_mu[] = "mask_mu"; +static const char __pyx_k_pix2ang[] = "pix2ang"; static const char __pyx_k_powspec[] = "powspec_"; static const char __pyx_k_spectra[] = "spectra"; static const char __pyx_k_DATAPATH[] = "DATAPATH"; static const char __pyx_k_datapath[] = "datapath"; static const char __pyx_k_lmax_out[] = "lmax_out"; +static const char __pyx_k_mask_gal[] = "mask_gal"; +static const char __pyx_k_bdatapath[] = "bdatapath"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_c_datapath[] = "c_datapath"; static const char __pyx_k_complex128[] = "complex128"; @@ -1587,6 +1796,7 @@ static const char __pyx_k_npix2nside[] = "npix2nside"; static const char __pyx_k_nside2npix[] = "nside2npix"; static const char __pyx_k_rotate_alm[] = "rotate_alm"; static const char __pyx_k_weightfile[] = "weightfile"; +static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_alms_lonely[] = "alms_lonely"; static const char __pyx_k_use_weights[] = "use_weights"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; @@ -1607,6 +1817,7 @@ static const char __pyx_k_all_alms_must_have_same_size[] = "all alms must have s static const char __pyx_k_Input_maps_must_have_same_size[] = "Input maps must have same size"; static const char __pyx_k_Wrong_input_map_must_be_a_valid[] = "Wrong input map (must be a valid healpix map or a sequence of 1 or 3 maps)"; static const char __pyx_k_home_zonca_zonca_p_software_hea[] = "/home/zonca/zonca/p/software/healpy/healpy/src/_sphtools.pyx"; +static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; @@ -1614,16 +1825,19 @@ static const char __pyx_k_alms2_must_be_an_array_or_a_sequ[] = "alms2 must be an static const char __pyx_k_alms_and_alms2_must_have_same_nu[] = "alms and alms2 must have same number of spectra"; static const char __pyx_k_alms_must_be_an_array_or_a_seque[] = "alms must be an array or a sequence of arrays"; static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; +static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; static PyObject *__pyx_n_s_A1; static PyObject *__pyx_n_s_A2; static PyObject *__pyx_n_s_AC; static PyObject *__pyx_n_s_AG; static PyObject *__pyx_n_s_AI; +static PyObject *__pyx_n_s_C; static PyObject *__pyx_n_s_DATAPATH; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; static PyObject *__pyx_n_s_IOError; +static PyObject *__pyx_n_s_ImportError; static PyObject *__pyx_kp_s_Input_maps_must_have_same_size; static PyObject *__pyx_kp_s_Invalid_input; static PyObject *__pyx_n_s_M1; @@ -1635,10 +1849,12 @@ static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; static PyObject *__pyx_n_s_Nspec; static PyObject *__pyx_n_s_Nspec2; static PyObject *__pyx_n_s_RuntimeError; +static PyObject *__pyx_kp_s_UTF_8; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_kp_s_Weight_file_not_found_in_s; static PyObject *__pyx_kp_s_Wrong_input_map_must_be_a_valid; static PyObject *__pyx_n_s_a; +static PyObject *__pyx_n_s_abs; static PyObject *__pyx_n_s_abspath; static PyObject *__pyx_n_s_ac; static PyObject *__pyx_n_s_ag; @@ -1664,22 +1880,28 @@ static PyObject *__pyx_kp_s_alms_must_be_an_array_or_a_seque; static PyObject *__pyx_n_s_almsize; static PyObject *__pyx_n_s_almxfl; static PyObject *__pyx_n_s_append; +static PyObject *__pyx_n_s_arange; static PyObject *__pyx_n_s_array; static PyObject *__pyx_n_s_ascontiguousarray; +static PyObject *__pyx_n_s_astype; +static PyObject *__pyx_n_s_bdatapath; static PyObject *__pyx_n_s_c_datapath; static PyObject *__pyx_n_s_complex128; static PyObject *__pyx_n_s_copy; static PyObject *__pyx_n_s_data; static PyObject *__pyx_n_s_datapath; +static PyObject *__pyx_n_s_decode; static PyObject *__pyx_n_s_dirname; static PyObject *__pyx_n_s_dtype; static PyObject *__pyx_n_s_empty; +static PyObject *__pyx_n_s_encode; static PyObject *__pyx_n_s_f; static PyObject *__pyx_n_s_file; static PyObject *__pyx_n_s_fl; static PyObject *__pyx_n_s_fl_2; static PyObject *__pyx_n_s_float64; static PyObject *__pyx_n_s_flsize; +static PyObject *__pyx_n_s_gal_cut; static PyObject *__pyx_n_s_get_datapath; static PyObject *__pyx_n_s_healpy; static PyObject *__pyx_n_s_healpy__sphtools; @@ -1700,6 +1922,7 @@ static PyObject *__pyx_n_s_lmax; static PyObject *__pyx_n_s_lmax_2; static PyObject *__pyx_n_s_lmax_out; static PyObject *__pyx_n_s_lmax_out_2; +static PyObject *__pyx_n_s_lonlat; static PyObject *__pyx_n_s_m; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_map2alm; @@ -1708,9 +1931,7 @@ static PyObject *__pyx_n_s_maps; static PyObject *__pyx_n_s_maps_c; static PyObject *__pyx_n_s_maptype; static PyObject *__pyx_n_s_mask; -static PyObject *__pyx_n_s_mask_mi; -static PyObject *__pyx_n_s_mask_mq; -static PyObject *__pyx_n_s_mask_mu; +static PyObject *__pyx_n_s_mask_gal; static PyObject *__pyx_n_s_masks; static PyObject *__pyx_n_s_maxm; static PyObject *__pyx_n_s_mi; @@ -1731,9 +1952,13 @@ static PyObject *__pyx_n_s_npix2nside; static PyObject *__pyx_n_s_nside; static PyObject *__pyx_n_s_nside2npix; static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to; +static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor; +static PyObject *__pyx_n_s_order; static PyObject *__pyx_n_s_os; static PyObject *__pyx_n_s_path; static PyObject *__pyx_n_s_phi; +static PyObject *__pyx_n_s_pix2ang; static PyObject *__pyx_n_s_polarization; static PyObject *__pyx_n_s_powspec; static PyObject *__pyx_n_s_psi; @@ -1756,7 +1981,7 @@ static PyObject *__pyx_n_s_zip; static PyObject *__pyx_pf_6healpy_9_sphtools_get_datapath(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_6healpy_9_sphtools_2map2alm_spin_healpy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_maps, PyObject *__pyx_v_spin, PyObject *__pyx_v_lmax, PyObject *__pyx_v_mmax); /* proto */ static PyObject *__pyx_pf_6healpy_9_sphtools_4alm2map_spin_healpy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_alms, PyObject *__pyx_v_nside, PyObject *__pyx_v_spin, PyObject *__pyx_v_lmax, PyObject *__pyx_v_mmax); /* proto */ -static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_m, PyObject *__pyx_v_lmax, PyObject *__pyx_v_mmax, PyObject *__pyx_v_niter, PyObject *__pyx_v_use_weights, PyObject *__pyx_v_datapath); /* proto */ +static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_m, PyObject *__pyx_v_lmax, PyObject *__pyx_v_mmax, PyObject *__pyx_v_niter, PyObject *__pyx_v_use_weights, PyObject *__pyx_v_datapath, PyObject *__pyx_v_gal_cut); /* proto */ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_alms, PyObject *__pyx_v_alms2, PyObject *__pyx_v_lmax, PyObject *__pyx_v_mmax, PyObject *__pyx_v_lmax_out); /* proto */ static PyObject *__pyx_pf_6healpy_9_sphtools_10almxfl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_alm, PyObject *__pyx_v_fl, PyObject *__pyx_v_mmax, PyObject *__pyx_v_inplace); /* proto */ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_alm, double __pyx_v_psi, double __pyx_v_theta, double __pyx_v_phi, PyObject *__pyx_v_lmax, PyObject *__pyx_v_mmax); /* proto */ @@ -1786,21 +2011,26 @@ static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__13; static PyObject *__pyx_tuple__14; static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__19; -static PyObject *__pyx_tuple__21; -static PyObject *__pyx_tuple__23; -static PyObject *__pyx_tuple__25; -static PyObject *__pyx_tuple__27; -static PyObject *__pyx_tuple__29; -static PyObject *__pyx_codeobj__16; -static PyObject *__pyx_codeobj__18; -static PyObject *__pyx_codeobj__20; -static PyObject *__pyx_codeobj__22; -static PyObject *__pyx_codeobj__24; -static PyObject *__pyx_codeobj__26; -static PyObject *__pyx_codeobj__28; -static PyObject *__pyx_codeobj__30; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_codeobj__21; +static PyObject *__pyx_codeobj__23; +static PyObject *__pyx_codeobj__25; +static PyObject *__pyx_codeobj__27; +static PyObject *__pyx_codeobj__29; +static PyObject *__pyx_codeobj__31; +static PyObject *__pyx_codeobj__33; +static PyObject *__pyx_codeobj__35; /* "healpy/src/_sphtools.pyx":54 * DATAPATH = None @@ -1839,7 +2069,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_get_datapath(CYTHON_UNUSED PyObject PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; - Py_ssize_t __pyx_t_12; + int __pyx_t_12; __Pyx_RefNannySetupContext("get_datapath", 0); /* "healpy/src/_sphtools.pyx":56 @@ -1890,7 +2120,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_get_datapath(CYTHON_UNUSED PyObject __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_file); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) { + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); @@ -1904,19 +2134,39 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_get_datapath(CYTHON_UNUSED PyObject __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_7); } else { - __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_9}; + __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_9}; + __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else + #endif + { + __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); @@ -1930,20 +2180,40 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_get_datapath(CYTHON_UNUSED PyObject __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); } else { - __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __pyx_t_8 = NULL; - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7}; + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7}; + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + { + __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __pyx_t_8 = NULL; + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_12 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); @@ -1953,20 +2223,40 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_get_datapath(CYTHON_UNUSED PyObject __pyx_t_12 = 1; } } - __pyx_t_11 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (__pyx_t_6) { - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_n_s_data}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_n_s_data}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + { + __pyx_t_11 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_12, __pyx_t_5); + __Pyx_INCREF(__pyx_n_s_data); + __Pyx_GIVEREF(__pyx_n_s_data); + PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_12, __pyx_n_s_data); + __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_12, __pyx_t_5); - __Pyx_INCREF(__pyx_n_s_data); - __Pyx_GIVEREF(__pyx_n_s_data); - PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_12, __pyx_n_s_data); - __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_DATAPATH, __pyx_t_1) < 0) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -2031,7 +2321,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_get_datapath(CYTHON_UNUSED PyObject /* Python wrapper */ static PyObject *__pyx_pw_6healpy_9_sphtools_3map2alm_spin_healpy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6healpy_9_sphtools_2map2alm_spin_healpy[] = "map2alm_spin_healpy(maps, spin, lmax=None, mmax=None)\nComputes the spinned alm of a 2 Healpix maps.\n\n Parameters\n ----------\n m : list of 2 arrays\n list of 2 input maps as numpy arrays\n spin : int\n spin of the alms (either 1, 2 or 3)\n lmax : int, scalar, optional\n Maximum l of the power spectrum. Default: 3*nside-1\n mmax : int, scalar, optional\n Maximum m of the alm. Default: lmax\n \n Returns\n -------\n alms : list of 2 arrays\n list of 2 alms\n "; +static char __pyx_doc_6healpy_9_sphtools_2map2alm_spin_healpy[] = "map2alm_spin_healpy(maps, spin, lmax=None, mmax=None)\nComputes the spinned alm of a 2 Healpix maps.\n\n Parameters\n ----------\n m : list of 2 arrays\n list of 2 input maps as numpy arrays\n spin : int\n spin of the alms (either 1, 2 or 3)\n lmax : int, scalar, optional\n Maximum l of the power spectrum. Default: 3*nside-1\n mmax : int, scalar, optional\n Maximum m of the alm. Default: lmax\n\n Returns\n -------\n alms : list of 2 arrays\n list of 2 alms\n "; static PyMethodDef __pyx_mdef_6healpy_9_sphtools_3map2alm_spin_healpy = {"map2alm_spin_healpy", (PyCFunction)__pyx_pw_6healpy_9_sphtools_3map2alm_spin_healpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6healpy_9_sphtools_2map2alm_spin_healpy}; static PyObject *__pyx_pw_6healpy_9_sphtools_3map2alm_spin_healpy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_maps = 0; @@ -2167,7 +2457,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_2map2alm_spin_healpy(CYTHON_UNUSED if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 79, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error) @@ -2175,7 +2465,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_2map2alm_spin_healpy(CYTHON_UNUSED #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 79, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error) @@ -2239,7 +2529,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_2map2alm_spin_healpy(CYTHON_UNUSED __pyx_t_2 = __pyx_v_maps_c; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; for (;;) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_9); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 82, __pyx_L1_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 82, __pyx_L1_error) @@ -2293,7 +2583,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_2map2alm_spin_healpy(CYTHON_UNUSED __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_npix); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); @@ -2307,15 +2597,35 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_2map2alm_spin_healpy(CYTHON_UNUSED __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL; - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_9}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_9}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else + #endif + { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL; + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L1_error) @@ -2510,7 +2820,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_2map2alm_spin_healpy(CYTHON_UNUSED if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break; - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 106, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) @@ -2518,7 +2828,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_2map2alm_spin_healpy(CYTHON_UNUSED #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_5)) break; - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 106, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) @@ -2539,7 +2849,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_2map2alm_spin_healpy(CYTHON_UNUSED } if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; - #if CYTHON_COMPILING_IN_CPYTHON + #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); @@ -2549,7 +2859,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_2map2alm_spin_healpy(CYTHON_UNUSED else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 106, __pyx_L1_error) } - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); @@ -2660,7 +2970,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_2map2alm_spin_healpy(CYTHON_UNUSED if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_9); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 112, __pyx_L1_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 112, __pyx_L1_error) @@ -2668,7 +2978,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_2map2alm_spin_healpy(CYTHON_UNUSED #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_9); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 112, __pyx_L1_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 112, __pyx_L1_error) @@ -2809,7 +3119,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_2map2alm_spin_healpy(CYTHON_UNUSED if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break; - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 128, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) @@ -2817,7 +3127,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_2map2alm_spin_healpy(CYTHON_UNUSED #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_5)) break; - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 128, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) @@ -2838,7 +3148,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_2map2alm_spin_healpy(CYTHON_UNUSED } if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; - #if CYTHON_COMPILING_IN_CPYTHON + #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); @@ -2848,7 +3158,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_2map2alm_spin_healpy(CYTHON_UNUSED else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 128, __pyx_L1_error) } - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); @@ -3005,7 +3315,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_2map2alm_spin_healpy(CYTHON_UNUSED /* Python wrapper */ static PyObject *__pyx_pw_6healpy_9_sphtools_5alm2map_spin_healpy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6healpy_9_sphtools_4alm2map_spin_healpy[] = "alm2map_spin_healpy(alms, nside, spin, lmax, mmax=None)\nComputes maps from a set of 2 spinned alm\n\n Parameters\n ----------\n alms : list of 2 arrays\n list of 2 alms\n nside : int\n requested nside of the output map \n spin : int\n spin of the alms (either 1, 2 or 3)\n lmax : int, scalar\n Maximum l of the power spectrum.\n mmax : int, scalar, optional\n Maximum m of the alm. Default: lmax\n \n Returns\n -------\n m : list of 2 arrays\n list of 2 out maps in RING scheme as numpy arrays\n "; +static char __pyx_doc_6healpy_9_sphtools_4alm2map_spin_healpy[] = "alm2map_spin_healpy(alms, nside, spin, lmax, mmax=None)\nComputes maps from a set of 2 spinned alm\n\n Parameters\n ----------\n alms : list of 2 arrays\n list of 2 alms\n nside : int\n requested nside of the output map\n spin : int\n spin of the alms (either 1, 2 or 3)\n lmax : int, scalar\n Maximum l of the power spectrum.\n mmax : int, scalar, optional\n Maximum m of the alm. Default: lmax\n\n Returns\n -------\n m : list of 2 arrays\n list of 2 out maps in RING scheme as numpy arrays\n "; static PyMethodDef __pyx_mdef_6healpy_9_sphtools_5alm2map_spin_healpy = {"alm2map_spin_healpy", (PyCFunction)__pyx_pw_6healpy_9_sphtools_5alm2map_spin_healpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6healpy_9_sphtools_4alm2map_spin_healpy}; static PyObject *__pyx_pw_6healpy_9_sphtools_5alm2map_spin_healpy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_alms = 0; @@ -3143,7 +3453,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_4alm2map_spin_healpy(CYTHON_UNUSED if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 157, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error) @@ -3151,7 +3461,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_4alm2map_spin_healpy(CYTHON_UNUSED #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 157, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error) @@ -3213,7 +3523,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_4alm2map_spin_healpy(CYTHON_UNUSED __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_nside2npix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); @@ -3226,15 +3536,33 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_4alm2map_spin_healpy(CYTHON_UNUSED __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_nside); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL; - __Pyx_INCREF(__pyx_v_nside); - __Pyx_GIVEREF(__pyx_v_nside); - PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_nside); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_nside}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_nside}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL; + __Pyx_INCREF(__pyx_v_nside); + __Pyx_GIVEREF(__pyx_v_nside); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_nside); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_npix = __pyx_t_1; @@ -3261,7 +3589,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_4alm2map_spin_healpy(CYTHON_UNUSED if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 160, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 160, __pyx_L1_error) @@ -3269,7 +3597,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_4alm2map_spin_healpy(CYTHON_UNUSED #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 160, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 160, __pyx_L1_error) @@ -3479,13 +3807,13 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_4alm2map_spin_healpy(CYTHON_UNUSED * return maps * * def map2alm(m, lmax = None, mmax = None, niter = 3, use_weights = False, # <<<<<<<<<<<<<< - * datapath = None): + * datapath = None, gal_cut = 0): * """Computes the alm of a Healpix map. */ /* Python wrapper */ static PyObject *__pyx_pw_6healpy_9_sphtools_7map2alm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6healpy_9_sphtools_6map2alm[] = "map2alm(m, lmax=None, mmax=None, niter=3, use_weights=False, datapath=None)\nComputes the alm of a Healpix map.\n\n Parameters\n ----------\n m : array-like, shape (Npix,) or (3, Npix)\n The input map or a list of 3 input maps (polariztion).\n lmax : int, scalar, optional\n Maximum l of the power spectrum. Default: 3*nside-1\n mmax : int, scalar, optional\n Maximum m of the alm. Default: lmax\n iter : int, scalar, optional\n Number of iteration (default: 1)\n use_weights: bool, scalar, optional\n If True, use the ring weighting. Default: False.\n \n Returns\n -------\n alm : array or tuple of arrays\n alm or a tuple of 3 alm (almT, almE, almB) if polarized input.\n "; +static char __pyx_doc_6healpy_9_sphtools_6map2alm[] = "map2alm(m, lmax=None, mmax=None, niter=3, use_weights=False, datapath=None, gal_cut=0)\nComputes the alm of a Healpix map.\n\n Parameters\n ----------\n m : array-like, shape (Npix,) or (3, Npix)\n The input map or a list of 3 input maps (polarization).\n lmax : int, scalar, optional\n Maximum l of the power spectrum. Default: 3*nside-1\n mmax : int, scalar, optional\n Maximum m of the alm. Default: lmax\n iter : int, scalar, optional\n Number of iteration (default: 1)\n use_weights: bool, scalar, optional\n If True, use the ring weighting. Default: False.\n gal_cut : float [degrees]\n pixels at latitude in [-gal_cut;+gal_cut] are not taken into account\n\n Returns\n -------\n alm : array or tuple of arrays\n alm or a tuple of 3 alm (almT, almE, almB) if polarized input.\n "; static PyMethodDef __pyx_mdef_6healpy_9_sphtools_7map2alm = {"map2alm", (PyCFunction)__pyx_pw_6healpy_9_sphtools_7map2alm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6healpy_9_sphtools_6map2alm}; static PyObject *__pyx_pw_6healpy_9_sphtools_7map2alm(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_m = 0; @@ -3494,12 +3822,13 @@ static PyObject *__pyx_pw_6healpy_9_sphtools_7map2alm(PyObject *__pyx_self, PyOb PyObject *__pyx_v_niter = 0; PyObject *__pyx_v_use_weights = 0; PyObject *__pyx_v_datapath = 0; + PyObject *__pyx_v_gal_cut = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("map2alm (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_m,&__pyx_n_s_lmax,&__pyx_n_s_mmax,&__pyx_n_s_niter,&__pyx_n_s_use_weights,&__pyx_n_s_datapath,0}; - PyObject* values[6] = {0,0,0,0,0,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_m,&__pyx_n_s_lmax,&__pyx_n_s_mmax,&__pyx_n_s_niter,&__pyx_n_s_use_weights,&__pyx_n_s_datapath,&__pyx_n_s_gal_cut,0}; + PyObject* values[7] = {0,0,0,0,0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)__pyx_int_3); @@ -3508,15 +3837,17 @@ static PyObject *__pyx_pw_6healpy_9_sphtools_7map2alm(PyObject *__pyx_self, PyOb /* "healpy/src/_sphtools.pyx":179 * * def map2alm(m, lmax = None, mmax = None, niter = 3, use_weights = False, - * datapath = None): # <<<<<<<<<<<<<< + * datapath = None, gal_cut = 0): # <<<<<<<<<<<<<< * """Computes the alm of a Healpix map. * */ values[5] = ((PyObject *)Py_None); + values[6] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); @@ -3556,12 +3887,18 @@ static PyObject *__pyx_pw_6healpy_9_sphtools_7map2alm(PyObject *__pyx_self, PyOb PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_datapath); if (value) { values[5] = value; kw_args--; } } + case 6: + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gal_cut); + if (value) { values[6] = value; kw_args--; } + } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map2alm") < 0)) __PYX_ERR(0, 178, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); @@ -3578,22 +3915,23 @@ static PyObject *__pyx_pw_6healpy_9_sphtools_7map2alm(PyObject *__pyx_self, PyOb __pyx_v_niter = values[3]; __pyx_v_use_weights = values[4]; __pyx_v_datapath = values[5]; + __pyx_v_gal_cut = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("map2alm", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 178, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("map2alm", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 178, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("healpy._sphtools.map2alm", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6healpy_9_sphtools_6map2alm(__pyx_self, __pyx_v_m, __pyx_v_lmax, __pyx_v_mmax, __pyx_v_niter, __pyx_v_use_weights, __pyx_v_datapath); + __pyx_r = __pyx_pf_6healpy_9_sphtools_6map2alm(__pyx_self, __pyx_v_m, __pyx_v_lmax, __pyx_v_mmax, __pyx_v_niter, __pyx_v_use_weights, __pyx_v_datapath, __pyx_v_gal_cut); /* "healpy/src/_sphtools.pyx":178 * return maps * * def map2alm(m, lmax = None, mmax = None, niter = 3, use_weights = False, # <<<<<<<<<<<<<< - * datapath = None): + * datapath = None, gal_cut = 0): * """Computes the alm of a Healpix map. */ @@ -3602,19 +3940,18 @@ static PyObject *__pyx_pw_6healpy_9_sphtools_7map2alm(PyObject *__pyx_self, PyOb return __pyx_r; } -static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_m, PyObject *__pyx_v_lmax, PyObject *__pyx_v_mmax, PyObject *__pyx_v_niter, PyObject *__pyx_v_use_weights, PyObject *__pyx_v_datapath) { +static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_m, PyObject *__pyx_v_lmax, PyObject *__pyx_v_mmax, PyObject *__pyx_v_niter, PyObject *__pyx_v_use_weights, PyObject *__pyx_v_datapath, PyObject *__pyx_v_gal_cut) { PyObject *__pyx_v_info = NULL; int __pyx_v_polarization; PyObject *__pyx_v_mi = NULL; PyObject *__pyx_v_mq = NULL; PyObject *__pyx_v_mu = NULL; - PyObject *__pyx_v_mask_mi = NULL; - PyObject *__pyx_v_mask_mq = NULL; - PyObject *__pyx_v_mask_mu = NULL; - int __pyx_v_lmax_; - int __pyx_v_mmax_; + PyObject *__pyx_v_mask = NULL; int __pyx_v_nside; int __pyx_v_npix; + PyObject *__pyx_v_mask_gal = NULL; + int __pyx_v_lmax_; + int __pyx_v_mmax_; Healpix_Map *__pyx_v_MI; Healpix_Map *__pyx_v_MQ; Healpix_Map *__pyx_v_MU; @@ -3628,6 +3965,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__ arr *__pyx_v_w_arr; int __pyx_v_i; char *__pyx_v_c_datapath; + PyObject *__pyx_v_bdatapath = NULL; PyObject *__pyx_v_weightfile = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -3636,32 +3974,33 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__ PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; + int __pyx_t_6; int __pyx_t_7; - int __pyx_t_8; - Healpix_Map *__pyx_t_9; - Alm > *__pyx_t_10; - char *__pyx_t_11; - Py_ssize_t __pyx_t_12; - PyObject *__pyx_t_13 = NULL; - std::string __pyx_t_14; - size_t __pyx_t_15; - long __pyx_t_16; - int __pyx_t_17; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + Healpix_Map *__pyx_t_12; + Alm > *__pyx_t_13; + char *__pyx_t_14; + std::string __pyx_t_15; + __pyx_t_7_common_tsize __pyx_t_16; + long __pyx_t_17; + int __pyx_t_18; __Pyx_RefNannySetupContext("map2alm", 0); __Pyx_INCREF(__pyx_v_datapath); - /* "healpy/src/_sphtools.pyx":201 + /* "healpy/src/_sphtools.pyx":203 * """ * # Check if the input map is polarized or not * info = maptype(m) # <<<<<<<<<<<<<< * if info == 0: * polarization = False */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_maptype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_maptype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); @@ -3671,508 +4010,832 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__ } } if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; - __Pyx_INCREF(__pyx_v_m); - __Pyx_GIVEREF(__pyx_v_m); - PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_m); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_m}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_m}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; + __Pyx_INCREF(__pyx_v_m); + __Pyx_GIVEREF(__pyx_v_m); + PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_m); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_info = __pyx_t_1; __pyx_t_1 = 0; - /* "healpy/src/_sphtools.pyx":202 + /* "healpy/src/_sphtools.pyx":204 * # Check if the input map is polarized or not * info = maptype(m) * if info == 0: # <<<<<<<<<<<<<< * polarization = False - * mi = np.ascontiguousarray(m, dtype=np.float64) + * mi = m.astype(np.float64, order='C', copy=True) */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_info, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_info, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "healpy/src/_sphtools.pyx":203 + /* "healpy/src/_sphtools.pyx":205 * info = maptype(m) * if info == 0: * polarization = False # <<<<<<<<<<<<<< - * mi = np.ascontiguousarray(m, dtype=np.float64) + * mi = m.astype(np.float64, order='C', copy=True) * elif info == 1: */ __pyx_v_polarization = 0; - /* "healpy/src/_sphtools.pyx":204 + /* "healpy/src/_sphtools.pyx":206 * if info == 0: * polarization = False - * mi = np.ascontiguousarray(m, dtype=np.float64) # <<<<<<<<<<<<<< + * mi = m.astype(np.float64, order='C', copy=True) # <<<<<<<<<<<<<< * elif info == 1: * polarization = False */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_m); - __Pyx_GIVEREF(__pyx_v_m); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_m); - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 206, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_copy, Py_True) < 0) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_mi = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_v_mi = __pyx_t_3; + __pyx_t_3 = 0; - /* "healpy/src/_sphtools.pyx":202 + /* "healpy/src/_sphtools.pyx":204 * # Check if the input map is polarized or not * info = maptype(m) * if info == 0: # <<<<<<<<<<<<<< * polarization = False - * mi = np.ascontiguousarray(m, dtype=np.float64) + * mi = m.astype(np.float64, order='C', copy=True) */ goto __pyx_L3; } - /* "healpy/src/_sphtools.pyx":205 + /* "healpy/src/_sphtools.pyx":207 * polarization = False - * mi = np.ascontiguousarray(m, dtype=np.float64) + * mi = m.astype(np.float64, order='C', copy=True) * elif info == 1: # <<<<<<<<<<<<<< * polarization = False - * mi = np.ascontiguousarray(m[0], dtype=np.float64) + * mi = m[0].astype(np.float64, order='C', copy=True) */ - __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_info, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 205, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 205, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_info, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { - /* "healpy/src/_sphtools.pyx":206 - * mi = np.ascontiguousarray(m, dtype=np.float64) + /* "healpy/src/_sphtools.pyx":208 + * mi = m.astype(np.float64, order='C', copy=True) * elif info == 1: * polarization = False # <<<<<<<<<<<<<< - * mi = np.ascontiguousarray(m[0], dtype=np.float64) + * mi = m[0].astype(np.float64, order='C', copy=True) * elif info == 3: */ __pyx_v_polarization = 0; - /* "healpy/src/_sphtools.pyx":207 + /* "healpy/src/_sphtools.pyx":209 * elif info == 1: * polarization = False - * mi = np.ascontiguousarray(m[0], dtype=np.float64) # <<<<<<<<<<<<<< + * mi = m[0].astype(np.float64, order='C', copy=True) # <<<<<<<<<<<<<< * elif info == 3: * polarization = True */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_m, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_m, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 209, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_True) < 0) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_v_mi = __pyx_t_3; - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_mi = __pyx_t_1; + __pyx_t_1 = 0; - /* "healpy/src/_sphtools.pyx":205 + /* "healpy/src/_sphtools.pyx":207 * polarization = False - * mi = np.ascontiguousarray(m, dtype=np.float64) + * mi = m.astype(np.float64, order='C', copy=True) * elif info == 1: # <<<<<<<<<<<<<< * polarization = False - * mi = np.ascontiguousarray(m[0], dtype=np.float64) + * mi = m[0].astype(np.float64, order='C', copy=True) */ goto __pyx_L3; } - /* "healpy/src/_sphtools.pyx":208 + /* "healpy/src/_sphtools.pyx":210 * polarization = False - * mi = np.ascontiguousarray(m[0], dtype=np.float64) + * mi = m[0].astype(np.float64, order='C', copy=True) * elif info == 3: # <<<<<<<<<<<<<< * polarization = True - * mi = np.ascontiguousarray(m[0], dtype=np.float64) + * mi = m[0].astype(np.float64, order='C', copy=True) */ - __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_info, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 208, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_info, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 210, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "healpy/src/_sphtools.pyx":209 - * mi = np.ascontiguousarray(m[0], dtype=np.float64) + /* "healpy/src/_sphtools.pyx":211 + * mi = m[0].astype(np.float64, order='C', copy=True) * elif info == 3: * polarization = True # <<<<<<<<<<<<<< - * mi = np.ascontiguousarray(m[0], dtype=np.float64) - * mq = np.ascontiguousarray(m[1], dtype=np.float64) + * mi = m[0].astype(np.float64, order='C', copy=True) + * mq = m[1].astype(np.float64, order='C', copy=True) */ __pyx_v_polarization = 1; - /* "healpy/src/_sphtools.pyx":210 + /* "healpy/src/_sphtools.pyx":212 * elif info == 3: * polarization = True - * mi = np.ascontiguousarray(m[0], dtype=np.float64) # <<<<<<<<<<<<<< - * mq = np.ascontiguousarray(m[1], dtype=np.float64) - * mu = np.ascontiguousarray(m[2], dtype=np.float64) + * mi = m[0].astype(np.float64, order='C', copy=True) # <<<<<<<<<<<<<< + * mq = m[1].astype(np.float64, order='C', copy=True) + * mu = m[2].astype(np.float64, order='C', copy=True) */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_m, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_m, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 212, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_True) < 0) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_mi = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_mi = __pyx_t_4; + __pyx_t_4 = 0; - /* "healpy/src/_sphtools.pyx":211 + /* "healpy/src/_sphtools.pyx":213 * polarization = True - * mi = np.ascontiguousarray(m[0], dtype=np.float64) - * mq = np.ascontiguousarray(m[1], dtype=np.float64) # <<<<<<<<<<<<<< - * mu = np.ascontiguousarray(m[2], dtype=np.float64) + * mi = m[0].astype(np.float64, order='C', copy=True) + * mq = m[1].astype(np.float64, order='C', copy=True) # <<<<<<<<<<<<<< + * mu = m[2].astype(np.float64, order='C', copy=True) * else: */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_m, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_astype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_m, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 213, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_True) < 0) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_mq = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_mq = __pyx_t_2; + __pyx_t_2 = 0; - /* "healpy/src/_sphtools.pyx":212 - * mi = np.ascontiguousarray(m[0], dtype=np.float64) - * mq = np.ascontiguousarray(m[1], dtype=np.float64) - * mu = np.ascontiguousarray(m[2], dtype=np.float64) # <<<<<<<<<<<<<< + /* "healpy/src/_sphtools.pyx":214 + * mi = m[0].astype(np.float64, order='C', copy=True) + * mq = m[1].astype(np.float64, order='C', copy=True) + * mu = m[2].astype(np.float64, order='C', copy=True) # <<<<<<<<<<<<<< * else: * raise ValueError("Wrong input map (must be a valid healpix map " */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_m, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_m, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 214, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_copy, Py_True) < 0) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 212, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_mu = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_v_mu = __pyx_t_3; + __pyx_t_3 = 0; - /* "healpy/src/_sphtools.pyx":208 + /* "healpy/src/_sphtools.pyx":210 * polarization = False - * mi = np.ascontiguousarray(m[0], dtype=np.float64) + * mi = m[0].astype(np.float64, order='C', copy=True) * elif info == 3: # <<<<<<<<<<<<<< * polarization = True - * mi = np.ascontiguousarray(m[0], dtype=np.float64) + * mi = m[0].astype(np.float64, order='C', copy=True) */ goto __pyx_L3; } - /* "healpy/src/_sphtools.pyx":214 - * mu = np.ascontiguousarray(m[2], dtype=np.float64) + /* "healpy/src/_sphtools.pyx":216 + * mu = m[2].astype(np.float64, order='C', copy=True) * else: * raise ValueError("Wrong input map (must be a valid healpix map " # <<<<<<<<<<<<<< * "or a sequence of 1 or 3 maps)") * */ /*else*/ { - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 214, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 216, __pyx_L1_error) } __pyx_L3:; - /* "healpy/src/_sphtools.pyx":218 + /* "healpy/src/_sphtools.pyx":220 * - * # create UNSEEN mask for I map - * mask_mi = False if count_bad(mi) == 0 else mkmask(mi) # <<<<<<<<<<<<<< - * # same for polarization maps if needed + * # replace UNSEEN pixels with zeros + * mask = mkmask(mi) # <<<<<<<<<<<<<< + * if mask is not False: + * mi[mask] = 0 + */ + if (!(likely(((__pyx_v_mi) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_mi, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 220, __pyx_L1_error) + __pyx_t_3 = __pyx_f_6healpy_9_sphtools_mkmask(((PyArrayObject *)__pyx_v_mi), 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_mask = __pyx_t_3; + __pyx_t_3 = 0; + + /* "healpy/src/_sphtools.pyx":221 + * # replace UNSEEN pixels with zeros + * mask = mkmask(mi) + * if mask is not False: # <<<<<<<<<<<<<< + * mi[mask] = 0 + * if polarization: + */ + __pyx_t_5 = (__pyx_v_mask != Py_False); + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "healpy/src/_sphtools.pyx":222 + * mask = mkmask(mi) + * if mask is not False: + * mi[mask] = 0 # <<<<<<<<<<<<<< + * if polarization: + * mask = mkmask(mq) + */ + if (unlikely(PyObject_SetItem(__pyx_v_mi, __pyx_v_mask, __pyx_int_0) < 0)) __PYX_ERR(0, 222, __pyx_L1_error) + + /* "healpy/src/_sphtools.pyx":221 + * # replace UNSEEN pixels with zeros + * mask = mkmask(mi) + * if mask is not False: # <<<<<<<<<<<<<< + * mi[mask] = 0 * if polarization: */ - if (!(likely(((__pyx_v_mi) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_mi, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 218, __pyx_L1_error) - if (((__pyx_f_6healpy_9_sphtools_count_bad(((PyArrayObject *)__pyx_v_mi), 0) == 0) != 0)) { - __Pyx_INCREF(Py_False); - __pyx_t_6 = Py_False; - } else { - if (!(likely(((__pyx_v_mi) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_mi, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 218, __pyx_L1_error) - __pyx_t_4 = __pyx_f_6healpy_9_sphtools_mkmask(((PyArrayObject *)__pyx_v_mi), 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __pyx_t_4; - __pyx_t_4 = 0; } - __pyx_v_mask_mi = __pyx_t_6; - __pyx_t_6 = 0; - /* "healpy/src/_sphtools.pyx":220 - * mask_mi = False if count_bad(mi) == 0 else mkmask(mi) - * # same for polarization maps if needed + /* "healpy/src/_sphtools.pyx":223 + * if mask is not False: + * mi[mask] = 0 * if polarization: # <<<<<<<<<<<<<< - * mask_mq = False if count_bad(mq) == 0 else mkmask(mq) - * mask_mu = False if count_bad(mu) == 0 else mkmask(mu) + * mask = mkmask(mq) + * if mask is not False: */ - __pyx_t_5 = (__pyx_v_polarization != 0); - if (__pyx_t_5) { + __pyx_t_6 = (__pyx_v_polarization != 0); + if (__pyx_t_6) { - /* "healpy/src/_sphtools.pyx":221 - * # same for polarization maps if needed + /* "healpy/src/_sphtools.pyx":224 + * mi[mask] = 0 * if polarization: - * mask_mq = False if count_bad(mq) == 0 else mkmask(mq) # <<<<<<<<<<<<<< - * mask_mu = False if count_bad(mu) == 0 else mkmask(mu) - * + * mask = mkmask(mq) # <<<<<<<<<<<<<< + * if mask is not False: + * mq[mask] = 0 */ - if (unlikely(!__pyx_v_mq)) { __Pyx_RaiseUnboundLocalError("mq"); __PYX_ERR(0, 221, __pyx_L1_error) } - if (!(likely(((__pyx_v_mq) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_mq, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 221, __pyx_L1_error) - if (((__pyx_f_6healpy_9_sphtools_count_bad(((PyArrayObject *)__pyx_v_mq), 0) == 0) != 0)) { - __Pyx_INCREF(Py_False); - __pyx_t_6 = Py_False; - } else { - if (unlikely(!__pyx_v_mq)) { __Pyx_RaiseUnboundLocalError("mq"); __PYX_ERR(0, 221, __pyx_L1_error) } - if (!(likely(((__pyx_v_mq) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_mq, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 221, __pyx_L1_error) - __pyx_t_4 = __pyx_f_6healpy_9_sphtools_mkmask(((PyArrayObject *)__pyx_v_mq), 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __pyx_t_4; - __pyx_t_4 = 0; - } - __pyx_v_mask_mq = __pyx_t_6; - __pyx_t_6 = 0; + if (unlikely(!__pyx_v_mq)) { __Pyx_RaiseUnboundLocalError("mq"); __PYX_ERR(0, 224, __pyx_L1_error) } + if (!(likely(((__pyx_v_mq) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_mq, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_3 = __pyx_f_6healpy_9_sphtools_mkmask(((PyArrayObject *)__pyx_v_mq), 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_mask, __pyx_t_3); + __pyx_t_3 = 0; - /* "healpy/src/_sphtools.pyx":222 + /* "healpy/src/_sphtools.pyx":225 + * if polarization: + * mask = mkmask(mq) + * if mask is not False: # <<<<<<<<<<<<<< + * mq[mask] = 0 + * mask = mkmask(mu) + */ + __pyx_t_6 = (__pyx_v_mask != Py_False); + __pyx_t_5 = (__pyx_t_6 != 0); + if (__pyx_t_5) { + + /* "healpy/src/_sphtools.pyx":226 + * mask = mkmask(mq) + * if mask is not False: + * mq[mask] = 0 # <<<<<<<<<<<<<< + * mask = mkmask(mu) + * if mask is not False: + */ + if (unlikely(!__pyx_v_mq)) { __Pyx_RaiseUnboundLocalError("mq"); __PYX_ERR(0, 226, __pyx_L1_error) } + if (unlikely(PyObject_SetItem(__pyx_v_mq, __pyx_v_mask, __pyx_int_0) < 0)) __PYX_ERR(0, 226, __pyx_L1_error) + + /* "healpy/src/_sphtools.pyx":225 * if polarization: - * mask_mq = False if count_bad(mq) == 0 else mkmask(mq) - * mask_mu = False if count_bad(mu) == 0 else mkmask(mu) # <<<<<<<<<<<<<< + * mask = mkmask(mq) + * if mask is not False: # <<<<<<<<<<<<<< + * mq[mask] = 0 + * mask = mkmask(mu) + */ + } + + /* "healpy/src/_sphtools.pyx":227 + * if mask is not False: + * mq[mask] = 0 + * mask = mkmask(mu) # <<<<<<<<<<<<<< + * if mask is not False: + * mu[mask] = 0 + */ + if (unlikely(!__pyx_v_mu)) { __Pyx_RaiseUnboundLocalError("mu"); __PYX_ERR(0, 227, __pyx_L1_error) } + if (!(likely(((__pyx_v_mu) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_mu, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_3 = __pyx_f_6healpy_9_sphtools_mkmask(((PyArrayObject *)__pyx_v_mu), 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_mask, __pyx_t_3); + __pyx_t_3 = 0; + + /* "healpy/src/_sphtools.pyx":228 + * mq[mask] = 0 + * mask = mkmask(mu) + * if mask is not False: # <<<<<<<<<<<<<< + * mu[mask] = 0 + * + */ + __pyx_t_5 = (__pyx_v_mask != Py_False); + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "healpy/src/_sphtools.pyx":229 + * mask = mkmask(mu) + * if mask is not False: + * mu[mask] = 0 # <<<<<<<<<<<<<< + * + * cdef int nside, npix + */ + if (unlikely(!__pyx_v_mu)) { __Pyx_RaiseUnboundLocalError("mu"); __PYX_ERR(0, 229, __pyx_L1_error) } + if (unlikely(PyObject_SetItem(__pyx_v_mu, __pyx_v_mask, __pyx_int_0) < 0)) __PYX_ERR(0, 229, __pyx_L1_error) + + /* "healpy/src/_sphtools.pyx":228 + * mq[mask] = 0 + * mask = mkmask(mu) + * if mask is not False: # <<<<<<<<<<<<<< + * mu[mask] = 0 * - * # Adjust lmax and mmax */ - if (unlikely(!__pyx_v_mu)) { __Pyx_RaiseUnboundLocalError("mu"); __PYX_ERR(0, 222, __pyx_L1_error) } - if (!(likely(((__pyx_v_mu) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_mu, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 222, __pyx_L1_error) - if (((__pyx_f_6healpy_9_sphtools_count_bad(((PyArrayObject *)__pyx_v_mu), 0) == 0) != 0)) { - __Pyx_INCREF(Py_False); - __pyx_t_6 = Py_False; - } else { - if (unlikely(!__pyx_v_mu)) { __Pyx_RaiseUnboundLocalError("mu"); __PYX_ERR(0, 222, __pyx_L1_error) } - if (!(likely(((__pyx_v_mu) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_mu, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 222, __pyx_L1_error) - __pyx_t_4 = __pyx_f_6healpy_9_sphtools_mkmask(((PyArrayObject *)__pyx_v_mu), 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __pyx_t_4; - __pyx_t_4 = 0; } - __pyx_v_mask_mu = __pyx_t_6; - __pyx_t_6 = 0; - /* "healpy/src/_sphtools.pyx":220 - * mask_mi = False if count_bad(mi) == 0 else mkmask(mi) - * # same for polarization maps if needed + /* "healpy/src/_sphtools.pyx":223 + * if mask is not False: + * mi[mask] = 0 * if polarization: # <<<<<<<<<<<<<< - * mask_mq = False if count_bad(mq) == 0 else mkmask(mq) - * mask_mu = False if count_bad(mu) == 0 else mkmask(mu) + * mask = mkmask(mq) + * if mask is not False: */ } - /* "healpy/src/_sphtools.pyx":226 - * # Adjust lmax and mmax - * cdef int lmax_, mmax_, nside, npix + /* "healpy/src/_sphtools.pyx":232 + * + * cdef int nside, npix * npix = mi.size # <<<<<<<<<<<<<< * nside = npix2nside(npix) - * if lmax is None: + * */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_mi, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_mi, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_npix = __pyx_t_7; - /* "healpy/src/_sphtools.pyx":227 - * cdef int lmax_, mmax_, nside, npix + /* "healpy/src/_sphtools.pyx":233 + * cdef int nside, npix * npix = mi.size * nside = npix2nside(npix) # <<<<<<<<<<<<<< - * if lmax is None: - * lmax_ = 3 * nside - 1 + * + * # Optionally apply a galactic cut */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_npix2nside); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_npix2nside); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_npix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_2)) { + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_npix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } - if (!__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 227, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_t_6); - } else { - __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error) + if (!__pyx_t_1) { + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL; - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 227, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_2}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_2}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __pyx_t_1 = NULL; + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_nside = __pyx_t_7; - /* "healpy/src/_sphtools.pyx":228 - * npix = mi.size - * nside = npix2nside(npix) - * if lmax is None: # <<<<<<<<<<<<<< - * lmax_ = 3 * nside - 1 - * else: - */ - __pyx_t_5 = (__pyx_v_lmax == Py_None); - __pyx_t_8 = (__pyx_t_5 != 0); - if (__pyx_t_8) { - - /* "healpy/src/_sphtools.pyx":229 - * nside = npix2nside(npix) - * if lmax is None: - * lmax_ = 3 * nside - 1 # <<<<<<<<<<<<<< - * else: - * lmax_ = lmax - */ - __pyx_v_lmax_ = ((3 * __pyx_v_nside) - 1); - - /* "healpy/src/_sphtools.pyx":228 - * npix = mi.size - * nside = npix2nside(npix) - * if lmax is None: # <<<<<<<<<<<<<< - * lmax_ = 3 * nside - 1 - * else: - */ - goto __pyx_L5; - } - - /* "healpy/src/_sphtools.pyx":231 - * lmax_ = 3 * nside - 1 - * else: - * lmax_ = lmax # <<<<<<<<<<<<<< - * if mmax is None: - * mmax_ = lmax_ + /* "healpy/src/_sphtools.pyx":236 + * + * # Optionally apply a galactic cut + * if gal_cut is not None and gal_cut > 0: # <<<<<<<<<<<<<< + * mask_gal = pix2ang(nside, np.arange(npix), lonlat=True)[1] + * mask_gal = np.abs(mask_gal) < gal_cut */ - /*else*/ { - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_lmax); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 231, __pyx_L1_error) - __pyx_v_lmax_ = __pyx_t_7; + __pyx_t_5 = (__pyx_v_gal_cut != Py_None); + __pyx_t_9 = (__pyx_t_5 != 0); + if (__pyx_t_9) { + } else { + __pyx_t_6 = __pyx_t_9; + goto __pyx_L9_bool_binop_done; } - __pyx_L5:; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_gal_cut, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __pyx_t_9; + __pyx_L9_bool_binop_done:; + if (__pyx_t_6) { - /* "healpy/src/_sphtools.pyx":232 - * else: - * lmax_ = lmax - * if mmax is None: # <<<<<<<<<<<<<< - * mmax_ = lmax_ - * else: + /* "healpy/src/_sphtools.pyx":237 + * # Optionally apply a galactic cut + * if gal_cut is not None and gal_cut > 0: + * mask_gal = pix2ang(nside, np.arange(npix), lonlat=True)[1] # <<<<<<<<<<<<<< + * mask_gal = np.abs(mask_gal) < gal_cut + * mi[mask_gal] = 0 */ - __pyx_t_8 = (__pyx_v_mmax == Py_None); - __pyx_t_5 = (__pyx_t_8 != 0); - if (__pyx_t_5) { + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pix2ang); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_nside); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_arange); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_npix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + if (!__pyx_t_10) { + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_8); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_2}; + __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_2}; + __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + { + __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8); + __pyx_t_4 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_lonlat, Py_True) < 0) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_mask_gal = __pyx_t_8; + __pyx_t_8 = 0; + + /* "healpy/src/_sphtools.pyx":238 + * if gal_cut is not None and gal_cut > 0: + * mask_gal = pix2ang(nside, np.arange(npix), lonlat=True)[1] + * mask_gal = np.abs(mask_gal) < gal_cut # <<<<<<<<<<<<<< + * mi[mask_gal] = 0 + * if polarization: + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_abs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + if (!__pyx_t_4) { + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_mask_gal); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_mask_gal}; + __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_8); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_mask_gal}; + __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_8); + } else + #endif + { + __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL; + __Pyx_INCREF(__pyx_v_mask_gal); + __Pyx_GIVEREF(__pyx_v_mask_gal); + PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_mask_gal); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_8, __pyx_v_gal_cut, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_mask_gal, __pyx_t_1); + __pyx_t_1 = 0; + + /* "healpy/src/_sphtools.pyx":239 + * mask_gal = pix2ang(nside, np.arange(npix), lonlat=True)[1] + * mask_gal = np.abs(mask_gal) < gal_cut + * mi[mask_gal] = 0 # <<<<<<<<<<<<<< + * if polarization: + * mq[mask_gal] = 0 + */ + if (unlikely(PyObject_SetItem(__pyx_v_mi, __pyx_v_mask_gal, __pyx_int_0) < 0)) __PYX_ERR(0, 239, __pyx_L1_error) + + /* "healpy/src/_sphtools.pyx":240 + * mask_gal = np.abs(mask_gal) < gal_cut + * mi[mask_gal] = 0 + * if polarization: # <<<<<<<<<<<<<< + * mq[mask_gal] = 0 + * mu[mask_gal] = 0 + */ + __pyx_t_6 = (__pyx_v_polarization != 0); + if (__pyx_t_6) { + + /* "healpy/src/_sphtools.pyx":241 + * mi[mask_gal] = 0 + * if polarization: + * mq[mask_gal] = 0 # <<<<<<<<<<<<<< + * mu[mask_gal] = 0 + * del mask_gal + */ + if (unlikely(!__pyx_v_mq)) { __Pyx_RaiseUnboundLocalError("mq"); __PYX_ERR(0, 241, __pyx_L1_error) } + if (unlikely(PyObject_SetItem(__pyx_v_mq, __pyx_v_mask_gal, __pyx_int_0) < 0)) __PYX_ERR(0, 241, __pyx_L1_error) + + /* "healpy/src/_sphtools.pyx":242 + * if polarization: + * mq[mask_gal] = 0 + * mu[mask_gal] = 0 # <<<<<<<<<<<<<< + * del mask_gal + * + */ + if (unlikely(!__pyx_v_mu)) { __Pyx_RaiseUnboundLocalError("mu"); __PYX_ERR(0, 242, __pyx_L1_error) } + if (unlikely(PyObject_SetItem(__pyx_v_mu, __pyx_v_mask_gal, __pyx_int_0) < 0)) __PYX_ERR(0, 242, __pyx_L1_error) + + /* "healpy/src/_sphtools.pyx":240 + * mask_gal = np.abs(mask_gal) < gal_cut + * mi[mask_gal] = 0 + * if polarization: # <<<<<<<<<<<<<< + * mq[mask_gal] = 0 + * mu[mask_gal] = 0 + */ + } + + /* "healpy/src/_sphtools.pyx":243 + * mq[mask_gal] = 0 + * mu[mask_gal] = 0 + * del mask_gal # <<<<<<<<<<<<<< + * + * # Adjust lmax and mmax + */ + __Pyx_DECREF(__pyx_v_mask_gal); + __pyx_v_mask_gal = NULL; + + /* "healpy/src/_sphtools.pyx":236 + * + * # Optionally apply a galactic cut + * if gal_cut is not None and gal_cut > 0: # <<<<<<<<<<<<<< + * mask_gal = pix2ang(nside, np.arange(npix), lonlat=True)[1] + * mask_gal = np.abs(mask_gal) < gal_cut + */ + } + + /* "healpy/src/_sphtools.pyx":247 + * # Adjust lmax and mmax + * cdef int lmax_, mmax_ + * if lmax is None: # <<<<<<<<<<<<<< + * lmax_ = 3 * nside - 1 + * else: + */ + __pyx_t_6 = (__pyx_v_lmax == Py_None); + __pyx_t_9 = (__pyx_t_6 != 0); + if (__pyx_t_9) { + + /* "healpy/src/_sphtools.pyx":248 + * cdef int lmax_, mmax_ + * if lmax is None: + * lmax_ = 3 * nside - 1 # <<<<<<<<<<<<<< + * else: + * lmax_ = lmax + */ + __pyx_v_lmax_ = ((3 * __pyx_v_nside) - 1); + + /* "healpy/src/_sphtools.pyx":247 + * # Adjust lmax and mmax + * cdef int lmax_, mmax_ + * if lmax is None: # <<<<<<<<<<<<<< + * lmax_ = 3 * nside - 1 + * else: + */ + goto __pyx_L12; + } + + /* "healpy/src/_sphtools.pyx":250 + * lmax_ = 3 * nside - 1 + * else: + * lmax_ = lmax # <<<<<<<<<<<<<< + * if mmax is None: + * mmax_ = lmax_ + */ + /*else*/ { + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_lmax); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_v_lmax_ = __pyx_t_7; + } + __pyx_L12:; + + /* "healpy/src/_sphtools.pyx":251 + * else: + * lmax_ = lmax + * if mmax is None: # <<<<<<<<<<<<<< + * mmax_ = lmax_ + * else: + */ + __pyx_t_9 = (__pyx_v_mmax == Py_None); + __pyx_t_6 = (__pyx_t_9 != 0); + if (__pyx_t_6) { - /* "healpy/src/_sphtools.pyx":233 + /* "healpy/src/_sphtools.pyx":252 * lmax_ = lmax * if mmax is None: * mmax_ = lmax_ # <<<<<<<<<<<<<< @@ -4181,17 +4844,17 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__ */ __pyx_v_mmax_ = __pyx_v_lmax_; - /* "healpy/src/_sphtools.pyx":232 + /* "healpy/src/_sphtools.pyx":251 * else: * lmax_ = lmax * if mmax is None: # <<<<<<<<<<<<<< * mmax_ = lmax_ * else: */ - goto __pyx_L6; + goto __pyx_L13; } - /* "healpy/src/_sphtools.pyx":235 + /* "healpy/src/_sphtools.pyx":254 * mmax_ = lmax_ * else: * mmax_ = mmax # <<<<<<<<<<<<<< @@ -4199,71 +4862,71 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__ * # Check all maps have same npix */ /*else*/ { - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_mmax); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_mmax); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 254, __pyx_L1_error) __pyx_v_mmax_ = __pyx_t_7; } - __pyx_L6:; + __pyx_L13:; - /* "healpy/src/_sphtools.pyx":238 + /* "healpy/src/_sphtools.pyx":257 * * # Check all maps have same npix * if polarization: # <<<<<<<<<<<<<< * if mq.size != npix or mu.size != npix: * raise ValueError("Input maps must have same size") */ - __pyx_t_5 = (__pyx_v_polarization != 0); - if (__pyx_t_5) { + __pyx_t_6 = (__pyx_v_polarization != 0); + if (__pyx_t_6) { - /* "healpy/src/_sphtools.pyx":239 + /* "healpy/src/_sphtools.pyx":258 * # Check all maps have same npix * if polarization: * if mq.size != npix or mu.size != npix: # <<<<<<<<<<<<<< * raise ValueError("Input maps must have same size") * */ - if (unlikely(!__pyx_v_mq)) { __Pyx_RaiseUnboundLocalError("mq"); __PYX_ERR(0, 239, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_mq, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_npix); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 239, __pyx_L1_error) + if (unlikely(!__pyx_v_mq)) { __Pyx_RaiseUnboundLocalError("mq"); __PYX_ERR(0, 258, __pyx_L1_error) } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mq, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_npix); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_8, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!__pyx_t_8) { + if (!__pyx_t_9) { } else { - __pyx_t_5 = __pyx_t_8; - goto __pyx_L9_bool_binop_done; + __pyx_t_6 = __pyx_t_9; + goto __pyx_L16_bool_binop_done; } - if (unlikely(!__pyx_v_mu)) { __Pyx_RaiseUnboundLocalError("mu"); __PYX_ERR(0, 239, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_mu, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error) + if (unlikely(!__pyx_v_mu)) { __Pyx_RaiseUnboundLocalError("mu"); __PYX_ERR(0, 258, __pyx_L1_error) } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_mu, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_npix); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_npix); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_8, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 239, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = __pyx_t_8; - __pyx_L9_bool_binop_done:; - if (__pyx_t_5) { + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __pyx_t_9; + __pyx_L16_bool_binop_done:; + if (__pyx_t_6) { - /* "healpy/src/_sphtools.pyx":240 + /* "healpy/src/_sphtools.pyx":259 * if polarization: * if mq.size != npix or mu.size != npix: * raise ValueError("Input maps must have same size") # <<<<<<<<<<<<<< * * # View the ndarray as a Healpix_Map */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 259, __pyx_L1_error) - /* "healpy/src/_sphtools.pyx":239 + /* "healpy/src/_sphtools.pyx":258 * # Check all maps have same npix * if polarization: * if mq.size != npix or mu.size != npix: # <<<<<<<<<<<<<< @@ -4272,7 +4935,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__ */ } - /* "healpy/src/_sphtools.pyx":238 + /* "healpy/src/_sphtools.pyx":257 * * # Check all maps have same npix * if polarization: # <<<<<<<<<<<<<< @@ -4281,52 +4944,52 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__ */ } - /* "healpy/src/_sphtools.pyx":243 + /* "healpy/src/_sphtools.pyx":262 * * # View the ndarray as a Healpix_Map * MI = ndarray2map(mi, RING) # <<<<<<<<<<<<<< * if polarization: * MQ = ndarray2map(mq, RING) */ - if (!(likely(((__pyx_v_mi) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_mi, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 243, __pyx_L1_error) - __pyx_t_9 = __pyx_f_7_common_ndarray2map(((PyArrayObject *)__pyx_v_mi), RING); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 243, __pyx_L1_error) - __pyx_v_MI = __pyx_t_9; + if (!(likely(((__pyx_v_mi) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_mi, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_12 = __pyx_f_7_common_ndarray2map(((PyArrayObject *)__pyx_v_mi), RING); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_v_MI = __pyx_t_12; - /* "healpy/src/_sphtools.pyx":244 + /* "healpy/src/_sphtools.pyx":263 * # View the ndarray as a Healpix_Map * MI = ndarray2map(mi, RING) * if polarization: # <<<<<<<<<<<<<< * MQ = ndarray2map(mq, RING) * MU = ndarray2map(mu, RING) */ - __pyx_t_5 = (__pyx_v_polarization != 0); - if (__pyx_t_5) { + __pyx_t_6 = (__pyx_v_polarization != 0); + if (__pyx_t_6) { - /* "healpy/src/_sphtools.pyx":245 + /* "healpy/src/_sphtools.pyx":264 * MI = ndarray2map(mi, RING) * if polarization: * MQ = ndarray2map(mq, RING) # <<<<<<<<<<<<<< * MU = ndarray2map(mu, RING) * */ - if (unlikely(!__pyx_v_mq)) { __Pyx_RaiseUnboundLocalError("mq"); __PYX_ERR(0, 245, __pyx_L1_error) } - if (!(likely(((__pyx_v_mq) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_mq, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 245, __pyx_L1_error) - __pyx_t_9 = __pyx_f_7_common_ndarray2map(((PyArrayObject *)__pyx_v_mq), RING); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 245, __pyx_L1_error) - __pyx_v_MQ = __pyx_t_9; + if (unlikely(!__pyx_v_mq)) { __Pyx_RaiseUnboundLocalError("mq"); __PYX_ERR(0, 264, __pyx_L1_error) } + if (!(likely(((__pyx_v_mq) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_mq, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_12 = __pyx_f_7_common_ndarray2map(((PyArrayObject *)__pyx_v_mq), RING); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_v_MQ = __pyx_t_12; - /* "healpy/src/_sphtools.pyx":246 + /* "healpy/src/_sphtools.pyx":265 * if polarization: * MQ = ndarray2map(mq, RING) * MU = ndarray2map(mu, RING) # <<<<<<<<<<<<<< * - * # replace UNSEEN pixels with zeros + * */ - if (unlikely(!__pyx_v_mu)) { __Pyx_RaiseUnboundLocalError("mu"); __PYX_ERR(0, 246, __pyx_L1_error) } - if (!(likely(((__pyx_v_mu) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_mu, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 246, __pyx_L1_error) - __pyx_t_9 = __pyx_f_7_common_ndarray2map(((PyArrayObject *)__pyx_v_mu), RING); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 246, __pyx_L1_error) - __pyx_v_MU = __pyx_t_9; + if (unlikely(!__pyx_v_mu)) { __Pyx_RaiseUnboundLocalError("mu"); __PYX_ERR(0, 265, __pyx_L1_error) } + if (!(likely(((__pyx_v_mu) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_mu, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_t_12 = __pyx_f_7_common_ndarray2map(((PyArrayObject *)__pyx_v_mu), RING); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_v_MU = __pyx_t_12; - /* "healpy/src/_sphtools.pyx":244 + /* "healpy/src/_sphtools.pyx":263 * # View the ndarray as a Healpix_Map * MI = ndarray2map(mi, RING) * if polarization: # <<<<<<<<<<<<<< @@ -4335,119 +4998,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__ */ } - /* "healpy/src/_sphtools.pyx":249 - * - * # replace UNSEEN pixels with zeros - * if mask_mi is not False: # <<<<<<<<<<<<<< - * mi[mask_mi] = 0.0 - * if polarization: - */ - __pyx_t_5 = (__pyx_v_mask_mi != Py_False); - __pyx_t_8 = (__pyx_t_5 != 0); - if (__pyx_t_8) { - - /* "healpy/src/_sphtools.pyx":250 - * # replace UNSEEN pixels with zeros - * if mask_mi is not False: - * mi[mask_mi] = 0.0 # <<<<<<<<<<<<<< - * if polarization: - * if mask_mq is not False: - */ - if (unlikely(PyObject_SetItem(__pyx_v_mi, __pyx_v_mask_mi, __pyx_float_0_0) < 0)) __PYX_ERR(0, 250, __pyx_L1_error) - - /* "healpy/src/_sphtools.pyx":249 - * - * # replace UNSEEN pixels with zeros - * if mask_mi is not False: # <<<<<<<<<<<<<< - * mi[mask_mi] = 0.0 - * if polarization: - */ - } - - /* "healpy/src/_sphtools.pyx":251 - * if mask_mi is not False: - * mi[mask_mi] = 0.0 - * if polarization: # <<<<<<<<<<<<<< - * if mask_mq is not False: - * mq[mask_mq] = 0.0 - */ - __pyx_t_8 = (__pyx_v_polarization != 0); - if (__pyx_t_8) { - - /* "healpy/src/_sphtools.pyx":252 - * mi[mask_mi] = 0.0 - * if polarization: - * if mask_mq is not False: # <<<<<<<<<<<<<< - * mq[mask_mq] = 0.0 - * if mask_mu is not False: - */ - if (unlikely(!__pyx_v_mask_mq)) { __Pyx_RaiseUnboundLocalError("mask_mq"); __PYX_ERR(0, 252, __pyx_L1_error) } - __pyx_t_8 = (__pyx_v_mask_mq != Py_False); - __pyx_t_5 = (__pyx_t_8 != 0); - if (__pyx_t_5) { - - /* "healpy/src/_sphtools.pyx":253 - * if polarization: - * if mask_mq is not False: - * mq[mask_mq] = 0.0 # <<<<<<<<<<<<<< - * if mask_mu is not False: - * mu[mask_mu] = 0.0 - */ - if (unlikely(!__pyx_v_mq)) { __Pyx_RaiseUnboundLocalError("mq"); __PYX_ERR(0, 253, __pyx_L1_error) } - if (unlikely(!__pyx_v_mask_mq)) { __Pyx_RaiseUnboundLocalError("mask_mq"); __PYX_ERR(0, 253, __pyx_L1_error) } - if (unlikely(PyObject_SetItem(__pyx_v_mq, __pyx_v_mask_mq, __pyx_float_0_0) < 0)) __PYX_ERR(0, 253, __pyx_L1_error) - - /* "healpy/src/_sphtools.pyx":252 - * mi[mask_mi] = 0.0 - * if polarization: - * if mask_mq is not False: # <<<<<<<<<<<<<< - * mq[mask_mq] = 0.0 - * if mask_mu is not False: - */ - } - - /* "healpy/src/_sphtools.pyx":254 - * if mask_mq is not False: - * mq[mask_mq] = 0.0 - * if mask_mu is not False: # <<<<<<<<<<<<<< - * mu[mask_mu] = 0.0 - * - */ - if (unlikely(!__pyx_v_mask_mu)) { __Pyx_RaiseUnboundLocalError("mask_mu"); __PYX_ERR(0, 254, __pyx_L1_error) } - __pyx_t_5 = (__pyx_v_mask_mu != Py_False); - __pyx_t_8 = (__pyx_t_5 != 0); - if (__pyx_t_8) { - - /* "healpy/src/_sphtools.pyx":255 - * mq[mask_mq] = 0.0 - * if mask_mu is not False: - * mu[mask_mu] = 0.0 # <<<<<<<<<<<<<< - * - * - */ - if (unlikely(!__pyx_v_mu)) { __Pyx_RaiseUnboundLocalError("mu"); __PYX_ERR(0, 255, __pyx_L1_error) } - if (unlikely(!__pyx_v_mask_mu)) { __Pyx_RaiseUnboundLocalError("mask_mu"); __PYX_ERR(0, 255, __pyx_L1_error) } - if (unlikely(PyObject_SetItem(__pyx_v_mu, __pyx_v_mask_mu, __pyx_float_0_0) < 0)) __PYX_ERR(0, 255, __pyx_L1_error) - - /* "healpy/src/_sphtools.pyx":254 - * if mask_mq is not False: - * mq[mask_mq] = 0.0 - * if mask_mu is not False: # <<<<<<<<<<<<<< - * mu[mask_mu] = 0.0 - * - */ - } - - /* "healpy/src/_sphtools.pyx":251 - * if mask_mi is not False: - * mi[mask_mi] = 0.0 - * if polarization: # <<<<<<<<<<<<<< - * if mask_mq is not False: - * mq[mask_mq] = 0.0 - */ - } - - /* "healpy/src/_sphtools.pyx":259 + /* "healpy/src/_sphtools.pyx":269 * * # Create an ndarray object that will contain the alm for output (to be returned) * n_alm = alm_getn(lmax_, mmax_) # <<<<<<<<<<<<<< @@ -4456,125 +5007,125 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__ */ __pyx_v_n_alm = __pyx_f_6healpy_9_sphtools_alm_getn(__pyx_v_lmax_, __pyx_v_mmax_); - /* "healpy/src/_sphtools.pyx":260 + /* "healpy/src/_sphtools.pyx":270 * # Create an ndarray object that will contain the alm for output (to be returned) * n_alm = alm_getn(lmax_, mmax_) * almI = np.empty(n_alm, dtype=np.complex128) # <<<<<<<<<<<<<< * if polarization: * almG = np.empty(n_alm, dtype=np.complex128) */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_n_alm); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_complex128); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 270, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 260, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_n_alm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 270, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_complex128); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 270, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_11) < 0) __PYX_ERR(0, 270, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 270, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_v_almI = __pyx_t_2; - __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_almI = __pyx_t_11; + __pyx_t_11 = 0; - /* "healpy/src/_sphtools.pyx":261 + /* "healpy/src/_sphtools.pyx":271 * n_alm = alm_getn(lmax_, mmax_) * almI = np.empty(n_alm, dtype=np.complex128) * if polarization: # <<<<<<<<<<<<<< * almG = np.empty(n_alm, dtype=np.complex128) * almC = np.empty(n_alm, dtype=np.complex128) */ - __pyx_t_8 = (__pyx_v_polarization != 0); - if (__pyx_t_8) { + __pyx_t_6 = (__pyx_v_polarization != 0); + if (__pyx_t_6) { - /* "healpy/src/_sphtools.pyx":262 + /* "healpy/src/_sphtools.pyx":272 * almI = np.empty(n_alm, dtype=np.complex128) * if polarization: * almG = np.empty(n_alm, dtype=np.complex128) # <<<<<<<<<<<<<< * almC = np.empty(n_alm, dtype=np.complex128) * */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 262, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n_alm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_n_alm); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_11); + __pyx_t_11 = 0; + __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_complex128); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_complex128); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_almG = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v_almG = __pyx_t_4; + __pyx_t_4 = 0; - /* "healpy/src/_sphtools.pyx":263 + /* "healpy/src/_sphtools.pyx":273 * if polarization: * almG = np.empty(n_alm, dtype=np.complex128) * almC = np.empty(n_alm, dtype=np.complex128) # <<<<<<<<<<<<<< * * # View the ndarray as an Alm */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_n_alm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_complex128); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n_alm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_almC = __pyx_t_4; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_complex128); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_almC = __pyx_t_8; + __pyx_t_8 = 0; - /* "healpy/src/_sphtools.pyx":261 + /* "healpy/src/_sphtools.pyx":271 * n_alm = alm_getn(lmax_, mmax_) * almI = np.empty(n_alm, dtype=np.complex128) * if polarization: # <<<<<<<<<<<<<< @@ -4583,52 +5134,52 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__ */ } - /* "healpy/src/_sphtools.pyx":266 + /* "healpy/src/_sphtools.pyx":276 * * # View the ndarray as an Alm * AI = ndarray2alm(almI, lmax_, mmax_) # <<<<<<<<<<<<<< * if polarization: * AG = ndarray2alm(almG, lmax_, mmax_) */ - if (!(likely(((__pyx_v_almI) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_almI, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 266, __pyx_L1_error) - __pyx_t_10 = __pyx_f_7_common_ndarray2alm(((PyArrayObject *)__pyx_v_almI), __pyx_v_lmax_, __pyx_v_mmax_); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 266, __pyx_L1_error) - __pyx_v_AI = __pyx_t_10; + if (!(likely(((__pyx_v_almI) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_almI, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_13 = __pyx_f_7_common_ndarray2alm(((PyArrayObject *)__pyx_v_almI), __pyx_v_lmax_, __pyx_v_mmax_); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_v_AI = __pyx_t_13; - /* "healpy/src/_sphtools.pyx":267 + /* "healpy/src/_sphtools.pyx":277 * # View the ndarray as an Alm * AI = ndarray2alm(almI, lmax_, mmax_) * if polarization: # <<<<<<<<<<<<<< * AG = ndarray2alm(almG, lmax_, mmax_) * AC = ndarray2alm(almC, lmax_, mmax_) */ - __pyx_t_8 = (__pyx_v_polarization != 0); - if (__pyx_t_8) { + __pyx_t_6 = (__pyx_v_polarization != 0); + if (__pyx_t_6) { - /* "healpy/src/_sphtools.pyx":268 + /* "healpy/src/_sphtools.pyx":278 * AI = ndarray2alm(almI, lmax_, mmax_) * if polarization: * AG = ndarray2alm(almG, lmax_, mmax_) # <<<<<<<<<<<<<< * AC = ndarray2alm(almC, lmax_, mmax_) * */ - if (unlikely(!__pyx_v_almG)) { __Pyx_RaiseUnboundLocalError("almG"); __PYX_ERR(0, 268, __pyx_L1_error) } - if (!(likely(((__pyx_v_almG) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_almG, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 268, __pyx_L1_error) - __pyx_t_10 = __pyx_f_7_common_ndarray2alm(((PyArrayObject *)__pyx_v_almG), __pyx_v_lmax_, __pyx_v_mmax_); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error) - __pyx_v_AG = __pyx_t_10; + if (unlikely(!__pyx_v_almG)) { __Pyx_RaiseUnboundLocalError("almG"); __PYX_ERR(0, 278, __pyx_L1_error) } + if (!(likely(((__pyx_v_almG) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_almG, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_13 = __pyx_f_7_common_ndarray2alm(((PyArrayObject *)__pyx_v_almG), __pyx_v_lmax_, __pyx_v_mmax_); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_v_AG = __pyx_t_13; - /* "healpy/src/_sphtools.pyx":269 + /* "healpy/src/_sphtools.pyx":279 * if polarization: * AG = ndarray2alm(almG, lmax_, mmax_) * AC = ndarray2alm(almC, lmax_, mmax_) # <<<<<<<<<<<<<< * * # ring weights */ - if (unlikely(!__pyx_v_almC)) { __Pyx_RaiseUnboundLocalError("almC"); __PYX_ERR(0, 269, __pyx_L1_error) } - if (!(likely(((__pyx_v_almC) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_almC, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 269, __pyx_L1_error) - __pyx_t_10 = __pyx_f_7_common_ndarray2alm(((PyArrayObject *)__pyx_v_almC), __pyx_v_lmax_, __pyx_v_mmax_); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error) - __pyx_v_AC = __pyx_t_10; + if (unlikely(!__pyx_v_almC)) { __Pyx_RaiseUnboundLocalError("almC"); __PYX_ERR(0, 279, __pyx_L1_error) } + if (!(likely(((__pyx_v_almC) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_almC, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_13 = __pyx_f_7_common_ndarray2alm(((PyArrayObject *)__pyx_v_almC), __pyx_v_lmax_, __pyx_v_mmax_); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_v_AC = __pyx_t_13; - /* "healpy/src/_sphtools.pyx":267 + /* "healpy/src/_sphtools.pyx":277 * # View the ndarray as an Alm * AI = ndarray2alm(almI, lmax_, mmax_) * if polarization: # <<<<<<<<<<<<<< @@ -4637,7 +5188,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__ */ } - /* "healpy/src/_sphtools.pyx":272 + /* "healpy/src/_sphtools.pyx":282 * * # ring weights * cdef arr[double] * w_arr = new arr[double]() # <<<<<<<<<<<<<< @@ -4646,195 +5197,297 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__ */ __pyx_v_w_arr = new arr (); - /* "healpy/src/_sphtools.pyx":275 + /* "healpy/src/_sphtools.pyx":285 * cdef int i * cdef char *c_datapath * if use_weights: # <<<<<<<<<<<<<< * if datapath is None: * datapath = get_datapath() */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_use_weights); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 275, __pyx_L1_error) - if (__pyx_t_8) { + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_use_weights); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 285, __pyx_L1_error) + if (__pyx_t_6) { - /* "healpy/src/_sphtools.pyx":276 + /* "healpy/src/_sphtools.pyx":286 * cdef char *c_datapath * if use_weights: * if datapath is None: # <<<<<<<<<<<<<< * datapath = get_datapath() - * c_datapath = datapath + * # For Python3: datapath must be a str, bdatapath must be bytes */ - __pyx_t_8 = (__pyx_v_datapath == Py_None); - __pyx_t_5 = (__pyx_t_8 != 0); - if (__pyx_t_5) { + __pyx_t_6 = (__pyx_v_datapath == Py_None); + __pyx_t_9 = (__pyx_t_6 != 0); + if (__pyx_t_9) { - /* "healpy/src/_sphtools.pyx":277 + /* "healpy/src/_sphtools.pyx":287 * if use_weights: * if datapath is None: * datapath = get_datapath() # <<<<<<<<<<<<<< - * c_datapath = datapath - * weightfile = 'weight_ring_n%05d.fits' % (nside) + * # For Python3: datapath must be a str, bdatapath must be bytes + * if isinstance(datapath, unicode) : */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_datapath); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_datapath); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); + __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_3) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { - __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error) } - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_datapath, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_datapath, __pyx_t_8); + __pyx_t_8 = 0; - /* "healpy/src/_sphtools.pyx":276 + /* "healpy/src/_sphtools.pyx":286 * cdef char *c_datapath * if use_weights: * if datapath is None: # <<<<<<<<<<<<<< * datapath = get_datapath() - * c_datapath = datapath + * # For Python3: datapath must be a str, bdatapath must be bytes */ } - /* "healpy/src/_sphtools.pyx":278 - * if datapath is None: + /* "healpy/src/_sphtools.pyx":289 + * datapath = get_datapath() + * # For Python3: datapath must be a str, bdatapath must be bytes + * if isinstance(datapath, unicode) : # <<<<<<<<<<<<<< + * bdatapath = datapath.encode('UTF-8') + * else : + */ + __pyx_t_9 = PyUnicode_Check(__pyx_v_datapath); + __pyx_t_6 = (__pyx_t_9 != 0); + if (__pyx_t_6) { + + /* "healpy/src/_sphtools.pyx":290 + * # For Python3: datapath must be a str, bdatapath must be bytes + * if isinstance(datapath, unicode) : + * bdatapath = datapath.encode('UTF-8') # <<<<<<<<<<<<<< + * else : + * bdatapath = datapath + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_datapath, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_bdatapath = __pyx_t_4; + __pyx_t_4 = 0; + + /* "healpy/src/_sphtools.pyx":289 * datapath = get_datapath() - * c_datapath = datapath # <<<<<<<<<<<<<< + * # For Python3: datapath must be a str, bdatapath must be bytes + * if isinstance(datapath, unicode) : # <<<<<<<<<<<<<< + * bdatapath = datapath.encode('UTF-8') + * else : + */ + goto __pyx_L23; + } + + /* "healpy/src/_sphtools.pyx":292 + * bdatapath = datapath.encode('UTF-8') + * else : + * bdatapath = datapath # <<<<<<<<<<<<<< + * datapath = datapath.decode('UTF-8') + * c_datapath = bdatapath + */ + /*else*/ { + __Pyx_INCREF(__pyx_v_datapath); + __pyx_v_bdatapath = __pyx_v_datapath; + + /* "healpy/src/_sphtools.pyx":293 + * else : + * bdatapath = datapath + * datapath = datapath.decode('UTF-8') # <<<<<<<<<<<<<< + * c_datapath = bdatapath + * weightfile = 'weight_ring_n%05d.fits' % (nside) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_datapath, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_datapath, __pyx_t_8); + __pyx_t_8 = 0; + } + __pyx_L23:; + + /* "healpy/src/_sphtools.pyx":294 + * bdatapath = datapath + * datapath = datapath.decode('UTF-8') + * c_datapath = bdatapath # <<<<<<<<<<<<<< * weightfile = 'weight_ring_n%05d.fits' % (nside) * if not os.path.isfile(os.path.join(datapath, weightfile)): */ - __pyx_t_11 = __Pyx_PyObject_AsString(__pyx_v_datapath); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 278, __pyx_L1_error) - __pyx_v_c_datapath = __pyx_t_11; + __pyx_t_14 = __Pyx_PyObject_AsString(__pyx_v_bdatapath); if (unlikely((!__pyx_t_14) && PyErr_Occurred())) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_v_c_datapath = __pyx_t_14; - /* "healpy/src/_sphtools.pyx":279 - * datapath = get_datapath() - * c_datapath = datapath + /* "healpy/src/_sphtools.pyx":295 + * datapath = datapath.decode('UTF-8') + * c_datapath = bdatapath * weightfile = 'weight_ring_n%05d.fits' % (nside) # <<<<<<<<<<<<<< * if not os.path.isfile(os.path.join(datapath, weightfile)): * raise IOError('Weight file not found in %s' % (datapath)) */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_nside); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_nside); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_weight_ring_n_05d_fits, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_weight_ring_n_05d_fits, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_weightfile = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_weightfile = __pyx_t_4; + __pyx_t_4 = 0; - /* "healpy/src/_sphtools.pyx":280 - * c_datapath = datapath + /* "healpy/src/_sphtools.pyx":296 + * c_datapath = bdatapath * weightfile = 'weight_ring_n%05d.fits' % (nside) * if not os.path.isfile(os.path.join(datapath, weightfile)): # <<<<<<<<<<<<<< * raise IOError('Weight file not found in %s' % (datapath)) * read_weight_ring(string(c_datapath), nside, w_arr[0]) */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_isfile); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_isfile); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = NULL; - __pyx_t_12 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_6); + __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_join); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_11); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_12 = 1; + __Pyx_DECREF_SET(__pyx_t_11, function); + __pyx_t_7 = 1; } } - __pyx_t_13 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - if (__pyx_t_6) { - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_6); __pyx_t_6 = NULL; - } - __Pyx_INCREF(__pyx_v_datapath); - __Pyx_GIVEREF(__pyx_v_datapath); - PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_v_datapath); - __Pyx_INCREF(__pyx_v_weightfile); - __Pyx_GIVEREF(__pyx_v_weightfile); - PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_v_weightfile); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_2); + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_11)) { + PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_datapath, __pyx_v_weightfile}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) { + PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_datapath, __pyx_v_weightfile}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + { + __pyx_t_2 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (__pyx_t_1) { + __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = NULL; + } + __Pyx_INCREF(__pyx_v_datapath); + __Pyx_GIVEREF(__pyx_v_datapath); + PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_7, __pyx_v_datapath); + __Pyx_INCREF(__pyx_v_weightfile); + __Pyx_GIVEREF(__pyx_v_weightfile); + PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_7, __pyx_v_weightfile); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); + __Pyx_DECREF_SET(__pyx_t_8, function); } } - if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error) + if (!__pyx_t_11) { + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_4); } else { - __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2); __pyx_t_2 = NULL; - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_3}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_3}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_11); __pyx_t_11 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 280, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = ((!__pyx_t_5) != 0); - if (__pyx_t_8) { + __pyx_t_9 = ((!__pyx_t_6) != 0); + if (__pyx_t_9) { - /* "healpy/src/_sphtools.pyx":281 + /* "healpy/src/_sphtools.pyx":297 * weightfile = 'weight_ring_n%05d.fits' % (nside) * if not os.path.isfile(os.path.join(datapath, weightfile)): * raise IOError('Weight file not found in %s' % (datapath)) # <<<<<<<<<<<<<< * read_weight_ring(string(c_datapath), nside, w_arr[0]) * for i in range(w_arr.size()): */ - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Weight_file_not_found_in_s, __pyx_v_datapath); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Weight_file_not_found_in_s, __pyx_v_datapath); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 281, __pyx_L1_error) + __PYX_ERR(0, 297, __pyx_L1_error) - /* "healpy/src/_sphtools.pyx":280 - * c_datapath = datapath + /* "healpy/src/_sphtools.pyx":296 + * c_datapath = bdatapath * weightfile = 'weight_ring_n%05d.fits' % (nside) * if not os.path.isfile(os.path.join(datapath, weightfile)): # <<<<<<<<<<<<<< * raise IOError('Weight file not found in %s' % (datapath)) @@ -4842,7 +5495,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__ */ } - /* "healpy/src/_sphtools.pyx":282 + /* "healpy/src/_sphtools.pyx":298 * if not os.path.isfile(os.path.join(datapath, weightfile)): * raise IOError('Weight file not found in %s' % (datapath)) * read_weight_ring(string(c_datapath), nside, w_arr[0]) # <<<<<<<<<<<<<< @@ -4850,47 +5503,47 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__ * w_arr[0][i] += 1 */ try { - __pyx_t_14 = std::string(__pyx_v_c_datapath); + __pyx_t_15 = std::string(__pyx_v_c_datapath); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 282, __pyx_L1_error) + __PYX_ERR(0, 298, __pyx_L1_error) } - read_weight_ring(__pyx_t_14, __pyx_v_nside, (__pyx_v_w_arr[0])); + read_weight_ring(__pyx_t_15, __pyx_v_nside, (__pyx_v_w_arr[0])); - /* "healpy/src/_sphtools.pyx":283 + /* "healpy/src/_sphtools.pyx":299 * raise IOError('Weight file not found in %s' % (datapath)) * read_weight_ring(string(c_datapath), nside, w_arr[0]) * for i in range(w_arr.size()): # <<<<<<<<<<<<<< * w_arr[0][i] += 1 * else: */ - __pyx_t_15 = __pyx_v_w_arr->size(); - for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_15; __pyx_t_7+=1) { + __pyx_t_16 = __pyx_v_w_arr->size(); + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_16; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "healpy/src/_sphtools.pyx":284 + /* "healpy/src/_sphtools.pyx":300 * read_weight_ring(string(c_datapath), nside, w_arr[0]) * for i in range(w_arr.size()): * w_arr[0][i] += 1 # <<<<<<<<<<<<<< * else: * w_arr.allocAndFill(2 * nside, 1.) */ - __pyx_t_16 = 0; - __pyx_t_17 = __pyx_v_i; - ((__pyx_v_w_arr[__pyx_t_16])[__pyx_t_17]) = (((__pyx_v_w_arr[__pyx_t_16])[__pyx_t_17]) + 1.0); + __pyx_t_17 = 0; + __pyx_t_18 = __pyx_v_i; + ((__pyx_v_w_arr[__pyx_t_17])[__pyx_t_18]) = (((__pyx_v_w_arr[__pyx_t_17])[__pyx_t_18]) + 1.0); } - /* "healpy/src/_sphtools.pyx":275 + /* "healpy/src/_sphtools.pyx":285 * cdef int i * cdef char *c_datapath * if use_weights: # <<<<<<<<<<<<<< * if datapath is None: * datapath = get_datapath() */ - goto __pyx_L18; + goto __pyx_L21; } - /* "healpy/src/_sphtools.pyx":286 + /* "healpy/src/_sphtools.pyx":302 * w_arr[0][i] += 1 * else: * w_arr.allocAndFill(2 * nside, 1.) # <<<<<<<<<<<<<< @@ -4900,174 +5553,53 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__ /*else*/ { __pyx_v_w_arr->allocAndFill((2 * __pyx_v_nside), 1.); } - __pyx_L18:; + __pyx_L21:; - /* "healpy/src/_sphtools.pyx":288 + /* "healpy/src/_sphtools.pyx":304 * w_arr.allocAndFill(2 * nside, 1.) * * if polarization: # <<<<<<<<<<<<<< * map2alm_pol_iter(MI[0], MQ[0], MU[0], AI[0], AG[0], AC[0], niter, w_arr[0]) * else: */ - __pyx_t_8 = (__pyx_v_polarization != 0); - if (__pyx_t_8) { + __pyx_t_9 = (__pyx_v_polarization != 0); + if (__pyx_t_9) { - /* "healpy/src/_sphtools.pyx":289 + /* "healpy/src/_sphtools.pyx":305 * * if polarization: * map2alm_pol_iter(MI[0], MQ[0], MU[0], AI[0], AG[0], AC[0], niter, w_arr[0]) # <<<<<<<<<<<<<< * else: * map2alm_iter(MI[0], AI[0], niter, w_arr[0]) */ - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_niter); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_niter); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 305, __pyx_L1_error) map2alm_pol_iter((__pyx_v_MI[0]), (__pyx_v_MQ[0]), (__pyx_v_MU[0]), (__pyx_v_AI[0]), (__pyx_v_AG[0]), (__pyx_v_AC[0]), __pyx_t_7, (__pyx_v_w_arr[0])); - /* "healpy/src/_sphtools.pyx":288 + /* "healpy/src/_sphtools.pyx":304 * w_arr.allocAndFill(2 * nside, 1.) * * if polarization: # <<<<<<<<<<<<<< * map2alm_pol_iter(MI[0], MQ[0], MU[0], AI[0], AG[0], AC[0], niter, w_arr[0]) * else: */ - goto __pyx_L23; + goto __pyx_L27; } - /* "healpy/src/_sphtools.pyx":291 + /* "healpy/src/_sphtools.pyx":307 * map2alm_pol_iter(MI[0], MQ[0], MU[0], AI[0], AG[0], AC[0], niter, w_arr[0]) * else: * map2alm_iter(MI[0], AI[0], niter, w_arr[0]) # <<<<<<<<<<<<<< * - * # restore input map with UNSEEN pixels + * del w_arr */ /*else*/ { - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_niter); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_niter); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L1_error) map2alm_iter((__pyx_v_MI[0]), (__pyx_v_AI[0]), __pyx_t_7, (__pyx_v_w_arr[0])); } - __pyx_L23:; - - /* "healpy/src/_sphtools.pyx":294 - * - * # restore input map with UNSEEN pixels - * if mask_mi is not False: # <<<<<<<<<<<<<< - * mi[mask_mi] = UNSEEN - * if polarization: - */ - __pyx_t_8 = (__pyx_v_mask_mi != Py_False); - __pyx_t_5 = (__pyx_t_8 != 0); - if (__pyx_t_5) { - - /* "healpy/src/_sphtools.pyx":295 - * # restore input map with UNSEEN pixels - * if mask_mi is not False: - * mi[mask_mi] = UNSEEN # <<<<<<<<<<<<<< - * if polarization: - * if mask_mq is not False: - */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_6healpy_9_sphtools_UNSEEN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_v_mi, __pyx_v_mask_mi, __pyx_t_1) < 0)) __PYX_ERR(0, 295, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "healpy/src/_sphtools.pyx":294 - * - * # restore input map with UNSEEN pixels - * if mask_mi is not False: # <<<<<<<<<<<<<< - * mi[mask_mi] = UNSEEN - * if polarization: - */ - } - - /* "healpy/src/_sphtools.pyx":296 - * if mask_mi is not False: - * mi[mask_mi] = UNSEEN - * if polarization: # <<<<<<<<<<<<<< - * if mask_mq is not False: - * mq[mask_mq] = UNSEEN - */ - __pyx_t_5 = (__pyx_v_polarization != 0); - if (__pyx_t_5) { - - /* "healpy/src/_sphtools.pyx":297 - * mi[mask_mi] = UNSEEN - * if polarization: - * if mask_mq is not False: # <<<<<<<<<<<<<< - * mq[mask_mq] = UNSEEN - * if mask_mu is not False: - */ - if (unlikely(!__pyx_v_mask_mq)) { __Pyx_RaiseUnboundLocalError("mask_mq"); __PYX_ERR(0, 297, __pyx_L1_error) } - __pyx_t_5 = (__pyx_v_mask_mq != Py_False); - __pyx_t_8 = (__pyx_t_5 != 0); - if (__pyx_t_8) { - - /* "healpy/src/_sphtools.pyx":298 - * if polarization: - * if mask_mq is not False: - * mq[mask_mq] = UNSEEN # <<<<<<<<<<<<<< - * if mask_mu is not False: - * mu[mask_mu] = UNSEEN - */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_6healpy_9_sphtools_UNSEEN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_v_mq)) { __Pyx_RaiseUnboundLocalError("mq"); __PYX_ERR(0, 298, __pyx_L1_error) } - if (unlikely(!__pyx_v_mask_mq)) { __Pyx_RaiseUnboundLocalError("mask_mq"); __PYX_ERR(0, 298, __pyx_L1_error) } - if (unlikely(PyObject_SetItem(__pyx_v_mq, __pyx_v_mask_mq, __pyx_t_1) < 0)) __PYX_ERR(0, 298, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "healpy/src/_sphtools.pyx":297 - * mi[mask_mi] = UNSEEN - * if polarization: - * if mask_mq is not False: # <<<<<<<<<<<<<< - * mq[mask_mq] = UNSEEN - * if mask_mu is not False: - */ - } - - /* "healpy/src/_sphtools.pyx":299 - * if mask_mq is not False: - * mq[mask_mq] = UNSEEN - * if mask_mu is not False: # <<<<<<<<<<<<<< - * mu[mask_mu] = UNSEEN - * - */ - if (unlikely(!__pyx_v_mask_mu)) { __Pyx_RaiseUnboundLocalError("mask_mu"); __PYX_ERR(0, 299, __pyx_L1_error) } - __pyx_t_8 = (__pyx_v_mask_mu != Py_False); - __pyx_t_5 = (__pyx_t_8 != 0); - if (__pyx_t_5) { - - /* "healpy/src/_sphtools.pyx":300 - * mq[mask_mq] = UNSEEN - * if mask_mu is not False: - * mu[mask_mu] = UNSEEN # <<<<<<<<<<<<<< - * - * del w_arr - */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_6healpy_9_sphtools_UNSEEN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_v_mu)) { __Pyx_RaiseUnboundLocalError("mu"); __PYX_ERR(0, 300, __pyx_L1_error) } - if (unlikely(!__pyx_v_mask_mu)) { __Pyx_RaiseUnboundLocalError("mask_mu"); __PYX_ERR(0, 300, __pyx_L1_error) } - if (unlikely(PyObject_SetItem(__pyx_v_mu, __pyx_v_mask_mu, __pyx_t_1) < 0)) __PYX_ERR(0, 300, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "healpy/src/_sphtools.pyx":299 - * if mask_mq is not False: - * mq[mask_mq] = UNSEEN - * if mask_mu is not False: # <<<<<<<<<<<<<< - * mu[mask_mu] = UNSEEN - * - */ - } - - /* "healpy/src/_sphtools.pyx":296 - * if mask_mi is not False: - * mi[mask_mi] = UNSEEN - * if polarization: # <<<<<<<<<<<<<< - * if mask_mq is not False: - * mq[mask_mq] = UNSEEN - */ - } + __pyx_L27:; - /* "healpy/src/_sphtools.pyx":302 - * mu[mask_mu] = UNSEEN + /* "healpy/src/_sphtools.pyx":309 + * map2alm_iter(MI[0], AI[0], niter, w_arr[0]) * * del w_arr # <<<<<<<<<<<<<< * if polarization: @@ -5075,21 +5607,21 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__ */ delete __pyx_v_w_arr; - /* "healpy/src/_sphtools.pyx":303 + /* "healpy/src/_sphtools.pyx":310 * * del w_arr * if polarization: # <<<<<<<<<<<<<< * del MI, MQ, MU, AI, AG, AC - * return almI, almG, almC + * return np.array([almI, almG, almC]) */ - __pyx_t_5 = (__pyx_v_polarization != 0); - if (__pyx_t_5) { + __pyx_t_9 = (__pyx_v_polarization != 0); + if (__pyx_t_9) { - /* "healpy/src/_sphtools.pyx":304 + /* "healpy/src/_sphtools.pyx":311 * del w_arr * if polarization: * del MI, MQ, MU, AI, AG, AC # <<<<<<<<<<<<<< - * return almI, almG, almC + * return np.array([almI, almG, almC]) * else: */ delete __pyx_v_MI; @@ -5099,42 +5631,93 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__ delete __pyx_v_AG; delete __pyx_v_AC; - /* "healpy/src/_sphtools.pyx":305 + /* "healpy/src/_sphtools.pyx":312 * if polarization: * del MI, MQ, MU, AI, AG, AC - * return almI, almG, almC # <<<<<<<<<<<<<< + * return np.array([almI, almG, almC]) # <<<<<<<<<<<<<< * else: * del MI, AI */ __Pyx_XDECREF(__pyx_r); - if (unlikely(!__pyx_v_almG)) { __Pyx_RaiseUnboundLocalError("almG"); __PYX_ERR(0, 305, __pyx_L1_error) } - if (unlikely(!__pyx_v_almC)) { __Pyx_RaiseUnboundLocalError("almC"); __PYX_ERR(0, 305, __pyx_L1_error) } - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_v_almG)) { __Pyx_RaiseUnboundLocalError("almG"); __PYX_ERR(0, 312, __pyx_L1_error) } + if (unlikely(!__pyx_v_almC)) { __Pyx_RaiseUnboundLocalError("almC"); __PYX_ERR(0, 312, __pyx_L1_error) } + __pyx_t_8 = PyList_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_almI); __Pyx_GIVEREF(__pyx_v_almI); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_almI); + PyList_SET_ITEM(__pyx_t_8, 0, __pyx_v_almI); __Pyx_INCREF(__pyx_v_almG); __Pyx_GIVEREF(__pyx_v_almG); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_almG); + PyList_SET_ITEM(__pyx_t_8, 1, __pyx_v_almG); __Pyx_INCREF(__pyx_v_almC); __Pyx_GIVEREF(__pyx_v_almC); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_almC); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + PyList_SET_ITEM(__pyx_t_8, 2, __pyx_v_almC); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (!__pyx_t_3) { + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_8}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_8}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } else + #endif + { + __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __pyx_t_3 = NULL; + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; - /* "healpy/src/_sphtools.pyx":303 + /* "healpy/src/_sphtools.pyx":310 * * del w_arr * if polarization: # <<<<<<<<<<<<<< * del MI, MQ, MU, AI, AG, AC - * return almI, almG, almC + * return np.array([almI, almG, almC]) */ } - /* "healpy/src/_sphtools.pyx":307 - * return almI, almG, almC + /* "healpy/src/_sphtools.pyx":314 + * return np.array([almI, almG, almC]) * else: * del MI, AI # <<<<<<<<<<<<<< * return almI @@ -5144,7 +5727,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__ delete __pyx_v_MI; delete __pyx_v_AI; - /* "healpy/src/_sphtools.pyx":308 + /* "healpy/src/_sphtools.pyx":315 * else: * del MI, AI * return almI # <<<<<<<<<<<<<< @@ -5161,7 +5744,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__ * return maps * * def map2alm(m, lmax = None, mmax = None, niter = 3, use_weights = False, # <<<<<<<<<<<<<< - * datapath = None): + * datapath = None, gal_cut = 0): * """Computes the alm of a Healpix map. */ @@ -5171,8 +5754,9 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__ __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("healpy._sphtools.map2alm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -5180,12 +5764,12 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__ __Pyx_XDECREF(__pyx_v_mi); __Pyx_XDECREF(__pyx_v_mq); __Pyx_XDECREF(__pyx_v_mu); - __Pyx_XDECREF(__pyx_v_mask_mi); - __Pyx_XDECREF(__pyx_v_mask_mq); - __Pyx_XDECREF(__pyx_v_mask_mu); + __Pyx_XDECREF(__pyx_v_mask); + __Pyx_XDECREF(__pyx_v_mask_gal); __Pyx_XDECREF(__pyx_v_almI); __Pyx_XDECREF(__pyx_v_almG); __Pyx_XDECREF(__pyx_v_almC); + __Pyx_XDECREF(__pyx_v_bdatapath); __Pyx_XDECREF(__pyx_v_weightfile); __Pyx_XDECREF(__pyx_v_datapath); __Pyx_XGIVEREF(__pyx_r); @@ -5193,7 +5777,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "healpy/src/_sphtools.pyx":311 +/* "healpy/src/_sphtools.pyx":318 * * * def alm2cl(alms, alms2 = None, lmax = None, mmax = None, lmax_out = None): # <<<<<<<<<<<<<< @@ -5203,7 +5787,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_6map2alm(CYTHON_UNUSED PyObject *__ /* Python wrapper */ static PyObject *__pyx_pw_6healpy_9_sphtools_9alm2cl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6healpy_9_sphtools_8alm2cl[] = "alm2cl(alms, alms2=None, lmax=None, mmax=None, lmax_out=None)\nComputes (cross-)spectra from alm(s). If alm2 is given, cross-spectra between\n alm and alm2 are computed. If alm (and alm2 if provided) contains n alm,\n then n(n+1)/2 auto and cross-spectra are returned.\n\n Parameters\n ----------\n alms : complex, array or sequence of arrays\n The alm from which to compute the power spectrum. If n>=2 arrays are given,\n computes both auto- and cross-spectra.\n alms2 : complex, array or sequence of 3 arrays, optional\n If provided, computes cross-spectra between alm and alm2.\n Default: alm2=alm, so auto-spectra are computed.\n lmax : None or int, optional\n The maximum l of the input alm. Default: computed from size of alm\n and mmax_in\n mmax : None or int, optional\n The maximum m of the input alm. Default: assume mmax_in = lmax_in\n lmax_out : None or int, optional\n The maximum l of the returned spectra. By default: the lmax of the given\n alm(s).\n\n Returns\n -------\n cl : array or tuple of n(n+1)/2 arrays\n the spectrum <*alm* x *alm2*> if *alm* (and *alm2*) is one alm, or \n the auto- and cross-spectra <*alm*[i] x *alm2*[j]> if alm (and alm2)\n contains more than one spectra.\n If more than one spectrum is returned, they are ordered by diagonal.\n For example, if *alm* is almT, almE, almB, then the returned spectra are:\n TT, EE, BB, TE, EB, TB.\n "; +static char __pyx_doc_6healpy_9_sphtools_8alm2cl[] = "alm2cl(alms, alms2=None, lmax=None, mmax=None, lmax_out=None)\nComputes (cross-)spectra from alm(s). If alm2 is given, cross-spectra between\n alm and alm2 are computed. If alm (and alm2 if provided) contains n alm,\n then n(n+1)/2 auto and cross-spectra are returned.\n\n Parameters\n ----------\n alms : complex, array or sequence of arrays\n The alm from which to compute the power spectrum. If n>=2 arrays are given,\n computes both auto- and cross-spectra.\n alms2 : complex, array or sequence of 3 arrays, optional\n If provided, computes cross-spectra between alm and alm2.\n Default: alm2=alm, so auto-spectra are computed.\n lmax : None or int, optional\n The maximum l of the input alm. Default: computed from size of alm\n and mmax_in\n mmax : None or int, optional\n The maximum m of the input alm. Default: assume mmax_in = lmax_in\n lmax_out : None or int, optional\n The maximum l of the returned spectra. By default: the lmax of the given\n alm(s).\n\n Returns\n -------\n cl : array or tuple of n(n+1)/2 arrays\n the spectrum <*alm* x *alm2*> if *alm* (and *alm2*) is one alm, or\n the auto- and cross-spectra <*alm*[i] x *alm2*[j]> if alm (and alm2)\n contains more than one spectra.\n If more than one spectrum is returned, they are ordered by diagonal.\n For example, if *alm* is almT, almE, almB, then the returned spectra are:\n TT, EE, BB, TE, EB, TB.\n "; static PyMethodDef __pyx_mdef_6healpy_9_sphtools_9alm2cl = {"alm2cl", (PyCFunction)__pyx_pw_6healpy_9_sphtools_9alm2cl, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6healpy_9_sphtools_8alm2cl}; static PyObject *__pyx_pw_6healpy_9_sphtools_9alm2cl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_alms = 0; @@ -5260,7 +5844,7 @@ static PyObject *__pyx_pw_6healpy_9_sphtools_9alm2cl(PyObject *__pyx_self, PyObj } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "alm2cl") < 0)) __PYX_ERR(0, 311, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "alm2cl") < 0)) __PYX_ERR(0, 318, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -5281,7 +5865,7 @@ static PyObject *__pyx_pw_6healpy_9_sphtools_9alm2cl(PyObject *__pyx_self, PyObj } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("alm2cl", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 311, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("alm2cl", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 318, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("healpy._sphtools.alm2cl", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5373,31 +5957,31 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p __pyx_pybuffernd_alm2_.data = NULL; __pyx_pybuffernd_alm2_.rcbuffer = &__pyx_pybuffer_alm2_; - /* "healpy/src/_sphtools.pyx":347 + /* "healpy/src/_sphtools.pyx":354 * # * cdef int Nspec, Nspec2 * if not hasattr(alms, '__len__'): # <<<<<<<<<<<<<< * raise ValueError('alms must be an array or a sequence of arrays') * if not hasattr(alms[0], '__len__'): */ - __pyx_t_1 = PyObject_HasAttr(__pyx_v_alms, __pyx_n_s_len); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 347, __pyx_L1_error) + __pyx_t_1 = PyObject_HasAttr(__pyx_v_alms, __pyx_n_s_len); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 354, __pyx_L1_error) __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { - /* "healpy/src/_sphtools.pyx":348 + /* "healpy/src/_sphtools.pyx":355 * cdef int Nspec, Nspec2 * if not hasattr(alms, '__len__'): * raise ValueError('alms must be an array or a sequence of arrays') # <<<<<<<<<<<<<< * if not hasattr(alms[0], '__len__'): * alms_lonely = True */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 348, __pyx_L1_error) + __PYX_ERR(0, 355, __pyx_L1_error) - /* "healpy/src/_sphtools.pyx":347 + /* "healpy/src/_sphtools.pyx":354 * # * cdef int Nspec, Nspec2 * if not hasattr(alms, '__len__'): # <<<<<<<<<<<<<< @@ -5406,21 +5990,21 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p */ } - /* "healpy/src/_sphtools.pyx":349 + /* "healpy/src/_sphtools.pyx":356 * if not hasattr(alms, '__len__'): * raise ValueError('alms must be an array or a sequence of arrays') * if not hasattr(alms[0], '__len__'): # <<<<<<<<<<<<<< * alms_lonely = True * alms = [alms] */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_alms, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_alms, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_HasAttr(__pyx_t_3, __pyx_n_s_len); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_2 = PyObject_HasAttr(__pyx_t_3, __pyx_n_s_len); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_1) { - /* "healpy/src/_sphtools.pyx":350 + /* "healpy/src/_sphtools.pyx":357 * raise ValueError('alms must be an array or a sequence of arrays') * if not hasattr(alms[0], '__len__'): * alms_lonely = True # <<<<<<<<<<<<<< @@ -5429,14 +6013,14 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p */ __pyx_v_alms_lonely = 1; - /* "healpy/src/_sphtools.pyx":351 + /* "healpy/src/_sphtools.pyx":358 * if not hasattr(alms[0], '__len__'): * alms_lonely = True * alms = [alms] # <<<<<<<<<<<<<< * else: * alms_lonely = False */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_alms); __Pyx_GIVEREF(__pyx_v_alms); @@ -5444,7 +6028,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p __Pyx_DECREF_SET(__pyx_v_alms, __pyx_t_3); __pyx_t_3 = 0; - /* "healpy/src/_sphtools.pyx":349 + /* "healpy/src/_sphtools.pyx":356 * if not hasattr(alms, '__len__'): * raise ValueError('alms must be an array or a sequence of arrays') * if not hasattr(alms[0], '__len__'): # <<<<<<<<<<<<<< @@ -5454,7 +6038,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p goto __pyx_L4; } - /* "healpy/src/_sphtools.pyx":353 + /* "healpy/src/_sphtools.pyx":360 * alms = [alms] * else: * alms_lonely = False # <<<<<<<<<<<<<< @@ -5466,17 +6050,17 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p } __pyx_L4:; - /* "healpy/src/_sphtools.pyx":355 + /* "healpy/src/_sphtools.pyx":362 * alms_lonely = False * * Nspec = len(alms) # <<<<<<<<<<<<<< * * if alms2 is None: */ - __pyx_t_4 = PyObject_Length(__pyx_v_alms); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_4 = PyObject_Length(__pyx_v_alms); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 362, __pyx_L1_error) __pyx_v_Nspec = __pyx_t_4; - /* "healpy/src/_sphtools.pyx":357 + /* "healpy/src/_sphtools.pyx":364 * Nspec = len(alms) * * if alms2 is None: # <<<<<<<<<<<<<< @@ -5487,7 +6071,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "healpy/src/_sphtools.pyx":358 + /* "healpy/src/_sphtools.pyx":365 * * if alms2 is None: * alms2 = alms # <<<<<<<<<<<<<< @@ -5497,7 +6081,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p __Pyx_INCREF(__pyx_v_alms); __Pyx_DECREF_SET(__pyx_v_alms2, __pyx_v_alms); - /* "healpy/src/_sphtools.pyx":357 + /* "healpy/src/_sphtools.pyx":364 * Nspec = len(alms) * * if alms2 is None: # <<<<<<<<<<<<<< @@ -5506,31 +6090,31 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p */ } - /* "healpy/src/_sphtools.pyx":360 + /* "healpy/src/_sphtools.pyx":367 * alms2 = alms * * if not hasattr(alms2, '__len__'): # <<<<<<<<<<<<<< * raise ValueError('alms2 must be an array or a sequence of arrays') * if not hasattr(alms2[0], '__len__'): */ - __pyx_t_2 = PyObject_HasAttr(__pyx_v_alms2, __pyx_n_s_len); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 360, __pyx_L1_error) + __pyx_t_2 = PyObject_HasAttr(__pyx_v_alms2, __pyx_n_s_len); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 367, __pyx_L1_error) __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_1) { - /* "healpy/src/_sphtools.pyx":361 + /* "healpy/src/_sphtools.pyx":368 * * if not hasattr(alms2, '__len__'): * raise ValueError('alms2 must be an array or a sequence of arrays') # <<<<<<<<<<<<<< * if not hasattr(alms2[0], '__len__'): * alms2 = [alms2] */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 361, __pyx_L1_error) + __PYX_ERR(0, 368, __pyx_L1_error) - /* "healpy/src/_sphtools.pyx":360 + /* "healpy/src/_sphtools.pyx":367 * alms2 = alms * * if not hasattr(alms2, '__len__'): # <<<<<<<<<<<<<< @@ -5539,28 +6123,28 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p */ } - /* "healpy/src/_sphtools.pyx":362 + /* "healpy/src/_sphtools.pyx":369 * if not hasattr(alms2, '__len__'): * raise ValueError('alms2 must be an array or a sequence of arrays') * if not hasattr(alms2[0], '__len__'): # <<<<<<<<<<<<<< * alms2 = [alms2] * Nspec2 = len(alms2) */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_alms2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_alms2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_HasAttr(__pyx_t_3, __pyx_n_s_len); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 362, __pyx_L1_error) + __pyx_t_1 = PyObject_HasAttr(__pyx_t_3, __pyx_n_s_len); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { - /* "healpy/src/_sphtools.pyx":363 + /* "healpy/src/_sphtools.pyx":370 * raise ValueError('alms2 must be an array or a sequence of arrays') * if not hasattr(alms2[0], '__len__'): * alms2 = [alms2] # <<<<<<<<<<<<<< * Nspec2 = len(alms2) * */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_alms2); __Pyx_GIVEREF(__pyx_v_alms2); @@ -5568,7 +6152,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p __Pyx_DECREF_SET(__pyx_v_alms2, __pyx_t_3); __pyx_t_3 = 0; - /* "healpy/src/_sphtools.pyx":362 + /* "healpy/src/_sphtools.pyx":369 * if not hasattr(alms2, '__len__'): * raise ValueError('alms2 must be an array or a sequence of arrays') * if not hasattr(alms2[0], '__len__'): # <<<<<<<<<<<<<< @@ -5577,17 +6161,17 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p */ } - /* "healpy/src/_sphtools.pyx":364 + /* "healpy/src/_sphtools.pyx":371 * if not hasattr(alms2[0], '__len__'): * alms2 = [alms2] * Nspec2 = len(alms2) # <<<<<<<<<<<<<< * * if Nspec != Nspec2: */ - __pyx_t_4 = PyObject_Length(__pyx_v_alms2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 364, __pyx_L1_error) + __pyx_t_4 = PyObject_Length(__pyx_v_alms2); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 371, __pyx_L1_error) __pyx_v_Nspec2 = __pyx_t_4; - /* "healpy/src/_sphtools.pyx":366 + /* "healpy/src/_sphtools.pyx":373 * Nspec2 = len(alms2) * * if Nspec != Nspec2: # <<<<<<<<<<<<<< @@ -5597,20 +6181,20 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p __pyx_t_2 = ((__pyx_v_Nspec != __pyx_v_Nspec2) != 0); if (__pyx_t_2) { - /* "healpy/src/_sphtools.pyx":367 + /* "healpy/src/_sphtools.pyx":374 * * if Nspec != Nspec2: * raise ValueError('alms and alms2 must have same number of spectra') # <<<<<<<<<<<<<< * * ############################################## */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 367, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 367, __pyx_L1_error) + __PYX_ERR(0, 374, __pyx_L1_error) - /* "healpy/src/_sphtools.pyx":366 + /* "healpy/src/_sphtools.pyx":373 * Nspec2 = len(alms2) * * if Nspec != Nspec2: # <<<<<<<<<<<<<< @@ -5619,23 +6203,23 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p */ } - /* "healpy/src/_sphtools.pyx":373 + /* "healpy/src/_sphtools.pyx":380 * # * cdef int almsize * almsize = alms[0].size # <<<<<<<<<<<<<< * for i in xrange(Nspec): * if alms[i].size != almsize or alms2[i].size != almsize: */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_alms, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_alms, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 373, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_almsize = __pyx_t_6; - /* "healpy/src/_sphtools.pyx":374 + /* "healpy/src/_sphtools.pyx":381 * cdef int almsize * almsize = alms[0].size * for i in xrange(Nspec): # <<<<<<<<<<<<<< @@ -5646,60 +6230,60 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "healpy/src/_sphtools.pyx":375 + /* "healpy/src/_sphtools.pyx":382 * almsize = alms[0].size * for i in xrange(Nspec): * if alms[i].size != almsize or alms2[i].size != almsize: # <<<<<<<<<<<<<< * raise ValueError('all alms must have same size') * */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_alms, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_alms, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_almsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_almsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L12_bool_binop_done; } - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_alms2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_alms2, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_almsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_almsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_8, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_8, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_1; __pyx_L12_bool_binop_done:; if (__pyx_t_2) { - /* "healpy/src/_sphtools.pyx":376 + /* "healpy/src/_sphtools.pyx":383 * for i in xrange(Nspec): * if alms[i].size != almsize or alms2[i].size != almsize: * raise ValueError('all alms must have same size') # <<<<<<<<<<<<<< * * lmax, mmax = alm_getlmmax(alms[0], lmax, mmax) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 376, __pyx_L1_error) + __PYX_ERR(0, 383, __pyx_L1_error) - /* "healpy/src/_sphtools.pyx":375 + /* "healpy/src/_sphtools.pyx":382 * almsize = alms[0].size * for i in xrange(Nspec): * if alms[i].size != almsize or alms2[i].size != almsize: # <<<<<<<<<<<<<< @@ -5709,50 +6293,70 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p } } - /* "healpy/src/_sphtools.pyx":378 + /* "healpy/src/_sphtools.pyx":385 * raise ValueError('all alms must have same size') * * lmax, mmax = alm_getlmmax(alms[0], lmax, mmax) # <<<<<<<<<<<<<< * * if lmax_out is None: */ - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_alm_getlmmax); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 378, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_alm_getlmmax); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_alms, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 378, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_alms, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = NULL; - __pyx_t_4 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_4 = 1; + __pyx_t_6 = 1; } } - __pyx_t_10 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 378, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (__pyx_t_9) { - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_5, __pyx_v_lmax, __pyx_v_mmax}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 385, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_5, __pyx_v_lmax, __pyx_v_mmax}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 385, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + { + __pyx_t_10 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (__pyx_t_9) { + __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; + } + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_6, __pyx_t_5); + __Pyx_INCREF(__pyx_v_lmax); + __Pyx_GIVEREF(__pyx_v_lmax); + PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_6, __pyx_v_lmax); + __Pyx_INCREF(__pyx_v_mmax); + __Pyx_GIVEREF(__pyx_v_mmax); + PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_6, __pyx_v_mmax); + __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_4, __pyx_t_5); - __Pyx_INCREF(__pyx_v_lmax); - __Pyx_GIVEREF(__pyx_v_lmax); - PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_4, __pyx_v_lmax); - __Pyx_INCREF(__pyx_v_mmax); - __Pyx_GIVEREF(__pyx_v_mmax); - PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_4, __pyx_v_mmax); - __pyx_t_5 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 378, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; - #if CYTHON_COMPILING_IN_CPYTHON + #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); @@ -5760,9 +6364,9 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 378, __pyx_L1_error) + __PYX_ERR(0, 385, __pyx_L1_error) } - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); @@ -5773,15 +6377,15 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_10); #else - __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 378, __pyx_L1_error) + __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 378, __pyx_L1_error) + __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 378, __pyx_L1_error) + __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext; @@ -5789,7 +6393,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p __Pyx_GOTREF(__pyx_t_8); index = 1; __pyx_t_10 = __pyx_t_11(__pyx_t_5); if (unlikely(!__pyx_t_10)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_5), 2) < 0) __PYX_ERR(0, 378, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_5), 2) < 0) __PYX_ERR(0, 385, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L15_unpacking_done; @@ -5797,7 +6401,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 378, __pyx_L1_error) + __PYX_ERR(0, 385, __pyx_L1_error) __pyx_L15_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_lmax, __pyx_t_8); @@ -5805,7 +6409,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p __Pyx_DECREF_SET(__pyx_v_mmax, __pyx_t_10); __pyx_t_10 = 0; - /* "healpy/src/_sphtools.pyx":380 + /* "healpy/src/_sphtools.pyx":387 * lmax, mmax = alm_getlmmax(alms[0], lmax, mmax) * * if lmax_out is None: # <<<<<<<<<<<<<< @@ -5816,7 +6420,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "healpy/src/_sphtools.pyx":381 + /* "healpy/src/_sphtools.pyx":388 * * if lmax_out is None: * lmax_out = lmax # <<<<<<<<<<<<<< @@ -5826,7 +6430,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p __Pyx_INCREF(__pyx_v_lmax); __Pyx_DECREF_SET(__pyx_v_lmax_out, __pyx_v_lmax); - /* "healpy/src/_sphtools.pyx":380 + /* "healpy/src/_sphtools.pyx":387 * lmax, mmax = alm_getlmmax(alms[0], lmax, mmax) * * if lmax_out is None: # <<<<<<<<<<<<<< @@ -5835,82 +6439,82 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p */ } - /* "healpy/src/_sphtools.pyx":388 + /* "healpy/src/_sphtools.pyx":395 * # * cdef int j, l, m, limit * cdef int lmax_ = lmax, mmax_ = mmax # <<<<<<<<<<<<<< * cdef int lmax_out_ = lmax_out * */ - __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_lmax); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_lmax); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 395, __pyx_L1_error) __pyx_v_lmax_ = __pyx_t_6; - __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_mmax); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_mmax); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 395, __pyx_L1_error) __pyx_v_mmax_ = __pyx_t_6; - /* "healpy/src/_sphtools.pyx":389 + /* "healpy/src/_sphtools.pyx":396 * cdef int j, l, m, limit * cdef int lmax_ = lmax, mmax_ = mmax * cdef int lmax_out_ = lmax_out # <<<<<<<<<<<<<< * * cdef np.ndarray[double, ndim=1] powspec_ */ - __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_lmax_out); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_lmax_out); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error) __pyx_v_lmax_out_ = __pyx_t_6; - /* "healpy/src/_sphtools.pyx":395 + /* "healpy/src/_sphtools.pyx":402 * cdef np.ndarray[np.complex128_t, ndim=1] alm2_ * * spectra = [] # <<<<<<<<<<<<<< * for n in xrange(Nspec): # diagonal rank * for m in xrange(0, Nspec - n): # position in the diagonal */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 395, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_spectra = __pyx_t_3; __pyx_t_3 = 0; - /* "healpy/src/_sphtools.pyx":396 + /* "healpy/src/_sphtools.pyx":403 * * spectra = [] * for n in xrange(Nspec): # diagonal rank # <<<<<<<<<<<<<< * for m in xrange(0, Nspec - n): # position in the diagonal * powspec_ = np.zeros(lmax + 1) */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_Nspec); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_Nspec); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 396, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_xrange, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_xrange, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_10 = __pyx_t_3; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 396, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 396, __pyx_L1_error) + __pyx_t_12 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 403, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_12)) { if (likely(PyList_CheckExact(__pyx_t_10))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_10)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 396, __pyx_L1_error) + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 403, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_10, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_10, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_10)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 396, __pyx_L1_error) + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 403, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_10, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_10, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -5920,7 +6524,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 396, __pyx_L1_error) + else __PYX_ERR(0, 403, __pyx_L1_error) } break; } @@ -5929,39 +6533,39 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_3); __pyx_t_3 = 0; - /* "healpy/src/_sphtools.pyx":397 + /* "healpy/src/_sphtools.pyx":404 * spectra = [] * for n in xrange(Nspec): # diagonal rank * for m in xrange(0, Nspec - n): # position in the diagonal # <<<<<<<<<<<<<< * powspec_ = np.zeros(lmax + 1) * alm1_ = alms[m] */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_Nspec); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_Nspec); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyNumber_Subtract(__pyx_t_3, __pyx_v_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_8 = PyNumber_Subtract(__pyx_t_3, __pyx_v_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_13 = __Pyx_PyInt_As_long(__pyx_t_8); if (unlikely((__pyx_t_13 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyInt_As_long(__pyx_t_8); if (unlikely((__pyx_t_13 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_13; __pyx_t_6+=1) { __pyx_v_m = __pyx_t_6; - /* "healpy/src/_sphtools.pyx":398 + /* "healpy/src/_sphtools.pyx":405 * for n in xrange(Nspec): # diagonal rank * for m in xrange(0, Nspec - n): # position in the diagonal * powspec_ = np.zeros(lmax + 1) # <<<<<<<<<<<<<< * alm1_ = alms[m] * alm2_ = alms2[m + n] */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_lmax, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_lmax, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); @@ -5971,22 +6575,42 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p } } if (!__pyx_t_9) { - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_8); } else { - __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 398, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_9); __pyx_t_9 = NULL; - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_14, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 398, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_3}; + __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 405, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_3}; + __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 405, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 405, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_9); __pyx_t_9 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_14, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 405, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 398, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 405, __pyx_L1_error) __pyx_t_15 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -6002,22 +6626,22 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p } } __pyx_pybuffernd_powspec_.diminfo[0].strides = __pyx_pybuffernd_powspec_.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_powspec_.diminfo[0].shape = __pyx_pybuffernd_powspec_.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 398, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 405, __pyx_L1_error) } __pyx_t_15 = 0; __Pyx_XDECREF_SET(__pyx_v_powspec_, ((PyArrayObject *)__pyx_t_8)); __pyx_t_8 = 0; - /* "healpy/src/_sphtools.pyx":399 + /* "healpy/src/_sphtools.pyx":406 * for m in xrange(0, Nspec - n): # position in the diagonal * powspec_ = np.zeros(lmax + 1) * alm1_ = alms[m] # <<<<<<<<<<<<<< * alm2_ = alms2[m + n] * # compute cross-spectrum alm1[n] x alm2[n+m] */ - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_alms, __pyx_v_m, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_alms, __pyx_v_m, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 399, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 406, __pyx_L1_error) __pyx_t_19 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -6033,28 +6657,28 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p } } __pyx_pybuffernd_alm1_.diminfo[0].strides = __pyx_pybuffernd_alm1_.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_alm1_.diminfo[0].shape = __pyx_pybuffernd_alm1_.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 399, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 406, __pyx_L1_error) } __pyx_t_19 = 0; __Pyx_XDECREF_SET(__pyx_v_alm1_, ((PyArrayObject *)__pyx_t_8)); __pyx_t_8 = 0; - /* "healpy/src/_sphtools.pyx":400 + /* "healpy/src/_sphtools.pyx":407 * powspec_ = np.zeros(lmax + 1) * alm1_ = alms[m] * alm2_ = alms2[m + n] # <<<<<<<<<<<<<< * # compute cross-spectrum alm1[n] x alm2[n+m] * # and place result in result list */ - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = PyNumber_Add(__pyx_t_8, __pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_8, __pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_GetItem(__pyx_v_alms2, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_8 = PyObject_GetItem(__pyx_v_alms2, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 400, __pyx_L1_error) + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 407, __pyx_L1_error) __pyx_t_20 = ((PyArrayObject *)__pyx_t_8); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -6070,13 +6694,13 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p } } __pyx_pybuffernd_alm2_.diminfo[0].strides = __pyx_pybuffernd_alm2_.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_alm2_.diminfo[0].shape = __pyx_pybuffernd_alm2_.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 400, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 407, __pyx_L1_error) } __pyx_t_20 = 0; __Pyx_XDECREF_SET(__pyx_v_alm2_, ((PyArrayObject *)__pyx_t_8)); __pyx_t_8 = 0; - /* "healpy/src/_sphtools.pyx":403 + /* "healpy/src/_sphtools.pyx":410 * # compute cross-spectrum alm1[n] x alm2[n+m] * # and place result in result list * for l in range(lmax_ + 1): # <<<<<<<<<<<<<< @@ -6087,7 +6711,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_21; __pyx_t_7+=1) { __pyx_v_l = __pyx_t_7; - /* "healpy/src/_sphtools.pyx":404 + /* "healpy/src/_sphtools.pyx":411 * # and place result in result list * for l in range(lmax_ + 1): * j = alm_getidx(lmax_, l, 0) # <<<<<<<<<<<<<< @@ -6096,7 +6720,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p */ __pyx_v_j = __pyx_f_6healpy_9_sphtools_alm_getidx(__pyx_v_lmax_, __pyx_v_l, 0); - /* "healpy/src/_sphtools.pyx":405 + /* "healpy/src/_sphtools.pyx":412 * for l in range(lmax_ + 1): * j = alm_getidx(lmax_, l, 0) * powspec_[l] = alm1_[j].real * alm2_[j].real # <<<<<<<<<<<<<< @@ -6111,7 +6735,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_alm1_.diminfo[0].shape)) __pyx_t_23 = 0; if (unlikely(__pyx_t_23 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_23); - __PYX_ERR(0, 405, __pyx_L1_error) + __PYX_ERR(0, 412, __pyx_L1_error) } __pyx_t_24 = __pyx_v_j; __pyx_t_23 = -1; @@ -6121,7 +6745,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_alm2_.diminfo[0].shape)) __pyx_t_23 = 0; if (unlikely(__pyx_t_23 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_23); - __PYX_ERR(0, 405, __pyx_L1_error) + __PYX_ERR(0, 412, __pyx_L1_error) } __pyx_t_25 = __pyx_v_l; __pyx_t_23 = -1; @@ -6131,32 +6755,32 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_powspec_.diminfo[0].shape)) __pyx_t_23 = 0; if (unlikely(__pyx_t_23 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_23); - __PYX_ERR(0, 405, __pyx_L1_error) + __PYX_ERR(0, 412, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_powspec_.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_powspec_.diminfo[0].strides) = (__Pyx_CREAL((*__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_alm1_.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_alm1_.diminfo[0].strides))) * __Pyx_CREAL((*__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_alm2_.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_alm2_.diminfo[0].strides)))); - /* "healpy/src/_sphtools.pyx":406 + /* "healpy/src/_sphtools.pyx":413 * j = alm_getidx(lmax_, l, 0) * powspec_[l] = alm1_[j].real * alm2_[j].real * limit = l if l <= mmax else mmax # <<<<<<<<<<<<<< * for m in range(1, limit + 1): * j = alm_getidx(lmax_, l, m) */ - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_l); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_l); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_8, __pyx_v_mmax, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_8, __pyx_v_mmax, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { __pyx_t_23 = __pyx_v_l; } else { - __pyx_t_26 = __Pyx_PyInt_As_int(__pyx_v_mmax); if (unlikely((__pyx_t_26 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_26 = __Pyx_PyInt_As_int(__pyx_v_mmax); if (unlikely((__pyx_t_26 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 413, __pyx_L1_error) __pyx_t_23 = __pyx_t_26; } __pyx_v_limit = __pyx_t_23; - /* "healpy/src/_sphtools.pyx":407 + /* "healpy/src/_sphtools.pyx":414 * powspec_[l] = alm1_[j].real * alm2_[j].real * limit = l if l <= mmax else mmax * for m in range(1, limit + 1): # <<<<<<<<<<<<<< @@ -6167,7 +6791,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p for (__pyx_t_23 = 1; __pyx_t_23 < __pyx_t_27; __pyx_t_23+=1) { __pyx_v_m = __pyx_t_23; - /* "healpy/src/_sphtools.pyx":408 + /* "healpy/src/_sphtools.pyx":415 * limit = l if l <= mmax else mmax * for m in range(1, limit + 1): * j = alm_getidx(lmax_, l, m) # <<<<<<<<<<<<<< @@ -6176,7 +6800,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p */ __pyx_v_j = __pyx_f_6healpy_9_sphtools_alm_getidx(__pyx_v_lmax_, __pyx_v_l, __pyx_v_m); - /* "healpy/src/_sphtools.pyx":409 + /* "healpy/src/_sphtools.pyx":416 * for m in range(1, limit + 1): * j = alm_getidx(lmax_, l, m) * powspec_[l] += 2 * (alm1_[j].real * alm2_[j].real + # <<<<<<<<<<<<<< @@ -6191,7 +6815,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_alm1_.diminfo[0].shape)) __pyx_t_26 = 0; if (unlikely(__pyx_t_26 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_26); - __PYX_ERR(0, 409, __pyx_L1_error) + __PYX_ERR(0, 416, __pyx_L1_error) } __pyx_t_29 = __pyx_v_j; __pyx_t_26 = -1; @@ -6201,10 +6825,10 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_alm2_.diminfo[0].shape)) __pyx_t_26 = 0; if (unlikely(__pyx_t_26 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_26); - __PYX_ERR(0, 409, __pyx_L1_error) + __PYX_ERR(0, 416, __pyx_L1_error) } - /* "healpy/src/_sphtools.pyx":410 + /* "healpy/src/_sphtools.pyx":417 * j = alm_getidx(lmax_, l, m) * powspec_[l] += 2 * (alm1_[j].real * alm2_[j].real + * alm1_[j].imag * alm2_[j].imag) # <<<<<<<<<<<<<< @@ -6219,7 +6843,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_alm1_.diminfo[0].shape)) __pyx_t_26 = 0; if (unlikely(__pyx_t_26 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_26); - __PYX_ERR(0, 410, __pyx_L1_error) + __PYX_ERR(0, 417, __pyx_L1_error) } __pyx_t_31 = __pyx_v_j; __pyx_t_26 = -1; @@ -6229,10 +6853,10 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_alm2_.diminfo[0].shape)) __pyx_t_26 = 0; if (unlikely(__pyx_t_26 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_26); - __PYX_ERR(0, 410, __pyx_L1_error) + __PYX_ERR(0, 417, __pyx_L1_error) } - /* "healpy/src/_sphtools.pyx":409 + /* "healpy/src/_sphtools.pyx":416 * for m in range(1, limit + 1): * j = alm_getidx(lmax_, l, m) * powspec_[l] += 2 * (alm1_[j].real * alm2_[j].real + # <<<<<<<<<<<<<< @@ -6247,12 +6871,12 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_powspec_.diminfo[0].shape)) __pyx_t_26 = 0; if (unlikely(__pyx_t_26 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_26); - __PYX_ERR(0, 409, __pyx_L1_error) + __PYX_ERR(0, 416, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_powspec_.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_powspec_.diminfo[0].strides) += (2.0 * ((__Pyx_CREAL((*__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_alm1_.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_alm1_.diminfo[0].strides))) * __Pyx_CREAL((*__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_alm2_.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_alm2_.diminfo[0].strides)))) + (__Pyx_CIMAG((*__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_alm1_.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_alm1_.diminfo[0].strides))) * __Pyx_CIMAG((*__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_alm2_.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_alm2_.diminfo[0].strides)))))); } - /* "healpy/src/_sphtools.pyx":411 + /* "healpy/src/_sphtools.pyx":418 * powspec_[l] += 2 * (alm1_[j].real * alm2_[j].real + * alm1_[j].imag * alm2_[j].imag) * powspec_[l] /= (2 * l + 1) # <<<<<<<<<<<<<< @@ -6267,22 +6891,22 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_powspec_.diminfo[0].shape)) __pyx_t_23 = 0; if (unlikely(__pyx_t_23 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_23); - __PYX_ERR(0, 411, __pyx_L1_error) + __PYX_ERR(0, 418, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_powspec_.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_powspec_.diminfo[0].strides) /= ((2 * __pyx_v_l) + 1); } - /* "healpy/src/_sphtools.pyx":412 + /* "healpy/src/_sphtools.pyx":419 * alm1_[j].imag * alm2_[j].imag) * powspec_[l] /= (2 * l + 1) * spectra.append(powspec_) # <<<<<<<<<<<<<< * * # if only one alm was given, returns only cl and not a list with one cl */ - __pyx_t_34 = __Pyx_PyObject_Append(__pyx_v_spectra, ((PyObject *)__pyx_v_powspec_)); if (unlikely(__pyx_t_34 == -1)) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_t_34 = __Pyx_PyObject_Append(__pyx_v_spectra, ((PyObject *)__pyx_v_powspec_)); if (unlikely(__pyx_t_34 == -1)) __PYX_ERR(0, 419, __pyx_L1_error) } - /* "healpy/src/_sphtools.pyx":396 + /* "healpy/src/_sphtools.pyx":403 * * spectra = [] * for n in xrange(Nspec): # diagonal rank # <<<<<<<<<<<<<< @@ -6292,7 +6916,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "healpy/src/_sphtools.pyx":415 + /* "healpy/src/_sphtools.pyx":422 * * # if only one alm was given, returns only cl and not a list with one cl * if alms_lonely: # <<<<<<<<<<<<<< @@ -6302,19 +6926,19 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p __pyx_t_1 = (__pyx_v_alms_lonely != 0); if (__pyx_t_1) { - /* "healpy/src/_sphtools.pyx":416 + /* "healpy/src/_sphtools.pyx":423 * # if only one alm was given, returns only cl and not a list with one cl * if alms_lonely: * spectra = spectra[0] # <<<<<<<<<<<<<< * - * return spectra + * return np.array(spectra) */ - __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_spectra, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_spectra, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF_SET(__pyx_v_spectra, __pyx_t_10); __pyx_t_10 = 0; - /* "healpy/src/_sphtools.pyx":415 + /* "healpy/src/_sphtools.pyx":422 * * # if only one alm was given, returns only cl and not a list with one cl * if alms_lonely: # <<<<<<<<<<<<<< @@ -6323,19 +6947,67 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p */ } - /* "healpy/src/_sphtools.pyx":418 + /* "healpy/src/_sphtools.pyx":425 * spectra = spectra[0] * - * return spectra # <<<<<<<<<<<<<< + * return np.array(spectra) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_spectra); - __pyx_r = __pyx_v_spectra; + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + if (!__pyx_t_5) { + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_spectra); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_spectra}; + __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_10); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_spectra}; + __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_10); + } else + #endif + { + __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_5); __pyx_t_5 = NULL; + __Pyx_INCREF(__pyx_v_spectra); + __Pyx_GIVEREF(__pyx_v_spectra); + PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_v_spectra); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_14, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + } + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; goto __pyx_L0; - /* "healpy/src/_sphtools.pyx":311 + /* "healpy/src/_sphtools.pyx":318 * * * def alm2cl(alms, alms2 = None, lmax = None, mmax = None, lmax_out = None): # <<<<<<<<<<<<<< @@ -6382,7 +7054,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_8alm2cl(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "healpy/src/_sphtools.pyx":423 +/* "healpy/src/_sphtools.pyx":430 * @cython.wraparound(False) * @cython.boundscheck(False) * def almxfl(alm, fl, mmax = None, inplace = False): # <<<<<<<<<<<<<< @@ -6426,7 +7098,7 @@ static PyObject *__pyx_pw_6healpy_9_sphtools_11almxfl(PyObject *__pyx_self, PyOb case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fl)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("almxfl", 0, 2, 4, 1); __PYX_ERR(0, 423, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("almxfl", 0, 2, 4, 1); __PYX_ERR(0, 430, __pyx_L3_error) } case 2: if (kw_args > 0) { @@ -6440,7 +7112,7 @@ static PyObject *__pyx_pw_6healpy_9_sphtools_11almxfl(PyObject *__pyx_self, PyOb } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "almxfl") < 0)) __PYX_ERR(0, 423, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "almxfl") < 0)) __PYX_ERR(0, 430, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -6459,7 +7131,7 @@ static PyObject *__pyx_pw_6healpy_9_sphtools_11almxfl(PyObject *__pyx_self, PyOb } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("almxfl", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 423, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("almxfl", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 430, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("healpy._sphtools.almxfl", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6501,14 +7173,13 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_10almxfl(CYTHON_UNUSED PyObject *__ PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyArrayObject *__pyx_t_12 = NULL; - Py_ssize_t __pyx_t_13; - PyObject *(*__pyx_t_14)(PyObject *); - int __pyx_t_15; - long __pyx_t_16; - __pyx_t_double_complex __pyx_t_17; - Py_ssize_t __pyx_t_18; - long __pyx_t_19; - Py_ssize_t __pyx_t_20; + PyObject *(*__pyx_t_13)(PyObject *); + int __pyx_t_14; + long __pyx_t_15; + __pyx_t_double_complex __pyx_t_16; + Py_ssize_t __pyx_t_17; + long __pyx_t_18; + Py_ssize_t __pyx_t_19; __Pyx_RefNannySetupContext("almxfl", 0); __pyx_pybuffer_alm_.pybuffer.buf = NULL; __pyx_pybuffer_alm_.refcount = 0; @@ -6519,48 +7190,48 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_10almxfl(CYTHON_UNUSED PyObject *__ __pyx_pybuffernd_fl_.data = NULL; __pyx_pybuffernd_fl_.rcbuffer = &__pyx_pybuffer_fl_; - /* "healpy/src/_sphtools.pyx":448 + /* "healpy/src/_sphtools.pyx":455 * cdef np.ndarray[np.complex128_t, ndim=1] fl_ * * if inplace: # <<<<<<<<<<<<<< * alm_ = np.ascontiguousarray(alm, dtype = np.complex128) * else: */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_inplace); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 448, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_inplace); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 455, __pyx_L1_error) if (__pyx_t_1) { - /* "healpy/src/_sphtools.pyx":449 + /* "healpy/src/_sphtools.pyx":456 * * if inplace: * alm_ = np.ascontiguousarray(alm, dtype = np.complex128) # <<<<<<<<<<<<<< * else: * alm_ = np.array(alm, dtype = np.complex128, copy = True) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_alm); __Pyx_GIVEREF(__pyx_v_alm); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_alm); - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_complex128); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_complex128); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 449, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 449, __pyx_L1_error) + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 456, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -6576,13 +7247,13 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_10almxfl(CYTHON_UNUSED PyObject *__ } } __pyx_pybuffernd_alm_.diminfo[0].strides = __pyx_pybuffernd_alm_.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_alm_.diminfo[0].shape = __pyx_pybuffernd_alm_.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 449, __pyx_L1_error) + if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 456, __pyx_L1_error) } __pyx_t_7 = 0; __pyx_v_alm_ = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "healpy/src/_sphtools.pyx":448 + /* "healpy/src/_sphtools.pyx":455 * cdef np.ndarray[np.complex128_t, ndim=1] fl_ * * if inplace: # <<<<<<<<<<<<<< @@ -6592,7 +7263,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_10almxfl(CYTHON_UNUSED PyObject *__ goto __pyx_L3; } - /* "healpy/src/_sphtools.pyx":451 + /* "healpy/src/_sphtools.pyx":458 * alm_ = np.ascontiguousarray(alm, dtype = np.complex128) * else: * alm_ = np.array(alm, dtype = np.complex128, copy = True) # <<<<<<<<<<<<<< @@ -6600,32 +7271,32 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_10almxfl(CYTHON_UNUSED PyObject *__ * fl_ = np.ascontiguousarray(fl, dtype = np.complex128) */ /*else*/ { - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_alm); __Pyx_GIVEREF(__pyx_v_alm); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_alm); - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_complex128); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_complex128); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 451, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_True) < 0) __PYX_ERR(0, 451, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 451, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_True) < 0) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 451, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 458, __pyx_L1_error) __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -6641,7 +7312,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_10almxfl(CYTHON_UNUSED PyObject *__ } } __pyx_pybuffernd_alm_.diminfo[0].strides = __pyx_pybuffernd_alm_.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_alm_.diminfo[0].shape = __pyx_pybuffernd_alm_.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 451, __pyx_L1_error) + if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 458, __pyx_L1_error) } __pyx_t_7 = 0; __pyx_v_alm_ = ((PyArrayObject *)__pyx_t_5); @@ -6649,38 +7320,38 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_10almxfl(CYTHON_UNUSED PyObject *__ } __pyx_L3:; - /* "healpy/src/_sphtools.pyx":453 + /* "healpy/src/_sphtools.pyx":460 * alm_ = np.array(alm, dtype = np.complex128, copy = True) * * fl_ = np.ascontiguousarray(fl, dtype = np.complex128) # <<<<<<<<<<<<<< * * cdef int lmax_, mmax_ */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 453, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 453, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_fl); __Pyx_GIVEREF(__pyx_v_fl); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_fl); - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 453, __pyx_L1_error) + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 453, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_complex128); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_complex128); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 453, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 453, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_t_12 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -6696,54 +7367,72 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_10almxfl(CYTHON_UNUSED PyObject *__ } } __pyx_pybuffernd_fl_.diminfo[0].strides = __pyx_pybuffernd_fl_.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fl_.diminfo[0].shape = __pyx_pybuffernd_fl_.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 453, __pyx_L1_error) + if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 460, __pyx_L1_error) } __pyx_t_12 = 0; __pyx_v_fl_ = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "healpy/src/_sphtools.pyx":457 + /* "healpy/src/_sphtools.pyx":464 * cdef int lmax_, mmax_ * cdef int l, m * lmax_, mmax_ = alm_getlmmax(alm_, None, mmax) # <<<<<<<<<<<<<< * * cdef np.complex128_t f */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_alm_getlmmax); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_alm_getlmmax); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = NULL; - __pyx_t_13 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_13 = 1; + __pyx_t_8 = 1; } } - __pyx_t_2 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __pyx_t_5 = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_alm_), Py_None, __pyx_v_mmax}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_alm_), Py_None, __pyx_v_mmax}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + { + __pyx_t_2 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_alm_)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_alm_)); + PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_8, ((PyObject *)__pyx_v_alm_)); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_8, Py_None); + __Pyx_INCREF(__pyx_v_mmax); + __Pyx_GIVEREF(__pyx_v_mmax); + PyTuple_SET_ITEM(__pyx_t_2, 2+__pyx_t_8, __pyx_v_mmax); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __Pyx_INCREF(((PyObject *)__pyx_v_alm_)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_alm_)); - PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_13, ((PyObject *)__pyx_v_alm_)); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_13, Py_None); - __Pyx_INCREF(__pyx_v_mmax); - __Pyx_GIVEREF(__pyx_v_mmax); - PyTuple_SET_ITEM(__pyx_t_2, 2+__pyx_t_13, __pyx_v_mmax); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; - #if CYTHON_COMPILING_IN_CPYTHON + #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); @@ -6751,9 +7440,9 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_10almxfl(CYTHON_UNUSED PyObject *__ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 457, __pyx_L1_error) + __PYX_ERR(0, 464, __pyx_L1_error) } - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); @@ -6764,65 +7453,65 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_10almxfl(CYTHON_UNUSED PyObject *__ __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_2); #else - __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_14 = Py_TYPE(__pyx_t_5)->tp_iternext; - index = 0; __pyx_t_6 = __pyx_t_14(__pyx_t_5); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; + __pyx_t_13 = Py_TYPE(__pyx_t_5)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); - index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; + index = 1; __pyx_t_2 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_5), 2) < 0) __PYX_ERR(0, 457, __pyx_L1_error) - __pyx_t_14 = NULL; + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_5), 2) < 0) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_14 = NULL; + __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 457, __pyx_L1_error) + __PYX_ERR(0, 464, __pyx_L1_error) __pyx_L5_unpacking_done:; } - __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_lmax_ = __pyx_t_8; - __pyx_v_mmax_ = __pyx_t_15; + __pyx_v_mmax_ = __pyx_t_14; - /* "healpy/src/_sphtools.pyx":461 + /* "healpy/src/_sphtools.pyx":468 * cdef np.complex128_t f * cdef int maxm, i * cdef int flsize = fl_.size # <<<<<<<<<<<<<< * for l in xrange(lmax_ + 1): * f = fl_[l] if l < flsize else 0. */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_fl_), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_fl_), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 461, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_flsize = __pyx_t_15; + __pyx_v_flsize = __pyx_t_14; - /* "healpy/src/_sphtools.pyx":462 + /* "healpy/src/_sphtools.pyx":469 * cdef int maxm, i * cdef int flsize = fl_.size * for l in xrange(lmax_ + 1): # <<<<<<<<<<<<<< * f = fl_[l] if l < flsize else 0. * maxm = l if l <= mmax_ else mmax_ */ - __pyx_t_16 = (__pyx_v_lmax_ + 1); - for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_16; __pyx_t_15+=1) { - __pyx_v_l = __pyx_t_15; + __pyx_t_15 = (__pyx_v_lmax_ + 1); + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_15; __pyx_t_14+=1) { + __pyx_v_l = __pyx_t_14; - /* "healpy/src/_sphtools.pyx":463 + /* "healpy/src/_sphtools.pyx":470 * cdef int flsize = fl_.size * for l in xrange(lmax_ + 1): * f = fl_[l] if l < flsize else 0. # <<<<<<<<<<<<<< @@ -6830,14 +7519,14 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_10almxfl(CYTHON_UNUSED PyObject *__ * for m in xrange(maxm + 1): */ if (((__pyx_v_l < __pyx_v_flsize) != 0)) { - __pyx_t_18 = __pyx_v_l; - __pyx_t_17 = (*__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_fl_.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_fl_.diminfo[0].strides)); + __pyx_t_17 = __pyx_v_l; + __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_fl_.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_fl_.diminfo[0].strides)); } else { - __pyx_t_17 = __pyx_t_double_complex_from_parts(0., 0); + __pyx_t_16 = __pyx_t_double_complex_from_parts(0., 0); } - __pyx_v_f = __pyx_t_17; + __pyx_v_f = __pyx_t_16; - /* "healpy/src/_sphtools.pyx":464 + /* "healpy/src/_sphtools.pyx":471 * for l in xrange(lmax_ + 1): * f = fl_[l] if l < flsize else 0. * maxm = l if l <= mmax_ else mmax_ # <<<<<<<<<<<<<< @@ -6851,18 +7540,18 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_10almxfl(CYTHON_UNUSED PyObject *__ } __pyx_v_maxm = __pyx_t_8; - /* "healpy/src/_sphtools.pyx":465 + /* "healpy/src/_sphtools.pyx":472 * f = fl_[l] if l < flsize else 0. * maxm = l if l <= mmax_ else mmax_ * for m in xrange(maxm + 1): # <<<<<<<<<<<<<< * i = alm_getidx(lmax_, l, m) * alm_[i] *= f */ - __pyx_t_19 = (__pyx_v_maxm + 1); - for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_19; __pyx_t_8+=1) { + __pyx_t_18 = (__pyx_v_maxm + 1); + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_18; __pyx_t_8+=1) { __pyx_v_m = __pyx_t_8; - /* "healpy/src/_sphtools.pyx":466 + /* "healpy/src/_sphtools.pyx":473 * maxm = l if l <= mmax_ else mmax_ * for m in xrange(maxm + 1): * i = alm_getidx(lmax_, l, m) # <<<<<<<<<<<<<< @@ -6871,19 +7560,19 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_10almxfl(CYTHON_UNUSED PyObject *__ */ __pyx_v_i = __pyx_f_6healpy_9_sphtools_alm_getidx(__pyx_v_lmax_, __pyx_v_l, __pyx_v_m); - /* "healpy/src/_sphtools.pyx":467 + /* "healpy/src/_sphtools.pyx":474 * for m in xrange(maxm + 1): * i = alm_getidx(lmax_, l, m) * alm_[i] *= f # <<<<<<<<<<<<<< * * return alm_ */ - __pyx_t_20 = __pyx_v_i; - *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_alm_.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_alm_.diminfo[0].strides) *= __pyx_v_f; + __pyx_t_19 = __pyx_v_i; + *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_pybuffernd_alm_.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_alm_.diminfo[0].strides) *= __pyx_v_f; } } - /* "healpy/src/_sphtools.pyx":469 + /* "healpy/src/_sphtools.pyx":476 * alm_[i] *= f * * return alm_ # <<<<<<<<<<<<<< @@ -6895,7 +7584,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_10almxfl(CYTHON_UNUSED PyObject *__ __pyx_r = ((PyObject *)__pyx_v_alm_); goto __pyx_L0; - /* "healpy/src/_sphtools.pyx":423 + /* "healpy/src/_sphtools.pyx":430 * @cython.wraparound(False) * @cython.boundscheck(False) * def almxfl(alm, fl, mmax = None, inplace = False): # <<<<<<<<<<<<<< @@ -6931,7 +7620,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_10almxfl(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "healpy/src/_sphtools.pyx":472 +/* "healpy/src/_sphtools.pyx":479 * * * def rotate_alm(alm not None, double psi, double theta, double phi, lmax=None, # <<<<<<<<<<<<<< @@ -6958,7 +7647,7 @@ static PyObject *__pyx_pw_6healpy_9_sphtools_13rotate_alm(PyObject *__pyx_self, PyObject* values[6] = {0,0,0,0,0,0}; values[4] = ((PyObject *)Py_None); - /* "healpy/src/_sphtools.pyx":473 + /* "healpy/src/_sphtools.pyx":480 * * def rotate_alm(alm not None, double psi, double theta, double phi, lmax=None, * mmax=None): # <<<<<<<<<<<<<< @@ -6987,17 +7676,17 @@ static PyObject *__pyx_pw_6healpy_9_sphtools_13rotate_alm(PyObject *__pyx_self, case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_psi)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rotate_alm", 0, 4, 6, 1); __PYX_ERR(0, 472, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rotate_alm", 0, 4, 6, 1); __PYX_ERR(0, 479, __pyx_L3_error) } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_theta)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rotate_alm", 0, 4, 6, 2); __PYX_ERR(0, 472, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rotate_alm", 0, 4, 6, 2); __PYX_ERR(0, 479, __pyx_L3_error) } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_phi)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("rotate_alm", 0, 4, 6, 3); __PYX_ERR(0, 472, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rotate_alm", 0, 4, 6, 3); __PYX_ERR(0, 479, __pyx_L3_error) } case 4: if (kw_args > 0) { @@ -7011,7 +7700,7 @@ static PyObject *__pyx_pw_6healpy_9_sphtools_13rotate_alm(PyObject *__pyx_self, } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rotate_alm") < 0)) __PYX_ERR(0, 472, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rotate_alm") < 0)) __PYX_ERR(0, 479, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -7026,26 +7715,26 @@ static PyObject *__pyx_pw_6healpy_9_sphtools_13rotate_alm(PyObject *__pyx_self, } } __pyx_v_alm = values[0]; - __pyx_v_psi = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_psi == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 472, __pyx_L3_error) - __pyx_v_theta = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_theta == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 472, __pyx_L3_error) - __pyx_v_phi = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_phi == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 472, __pyx_L3_error) + __pyx_v_psi = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_psi == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L3_error) + __pyx_v_theta = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_theta == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L3_error) + __pyx_v_phi = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_phi == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L3_error) __pyx_v_lmax = values[4]; __pyx_v_mmax = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rotate_alm", 0, 4, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 472, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rotate_alm", 0, 4, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 479, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("healpy._sphtools.rotate_alm", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_alm) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "alm"); __PYX_ERR(0, 472, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "alm"); __PYX_ERR(0, 479, __pyx_L1_error) } __pyx_r = __pyx_pf_6healpy_9_sphtools_12rotate_alm(__pyx_self, __pyx_v_alm, __pyx_v_psi, __pyx_v_theta, __pyx_v_phi, __pyx_v_lmax, __pyx_v_mmax); - /* "healpy/src/_sphtools.pyx":472 + /* "healpy/src/_sphtools.pyx":479 * * * def rotate_alm(alm not None, double psi, double theta, double phi, lmax=None, # <<<<<<<<<<<<<< @@ -7085,18 +7774,17 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; - Py_ssize_t __pyx_t_14; + int __pyx_t_14; PyObject *__pyx_t_15 = NULL; PyObject *(*__pyx_t_16)(PyObject *); int __pyx_t_17; - int __pyx_t_18; - Alm > *__pyx_t_19; + Alm > *__pyx_t_18; __Pyx_RefNannySetupContext("rotate_alm", 0); __Pyx_INCREF(__pyx_v_alm); __Pyx_INCREF(__pyx_v_lmax); __Pyx_INCREF(__pyx_v_mmax); - /* "healpy/src/_sphtools.pyx":501 + /* "healpy/src/_sphtools.pyx":508 * * """ * if isinstance(alm, np.ndarray) and alm.ndim == 1: # <<<<<<<<<<<<<< @@ -7110,25 +7798,25 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_alm, __pyx_n_s_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 501, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_alm, __pyx_n_s_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_t_4, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 501, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_t_4, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 501, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "healpy/src/_sphtools.pyx":502 + /* "healpy/src/_sphtools.pyx":509 * """ * if isinstance(alm, np.ndarray) and alm.ndim == 1: * alm = [alm] # <<<<<<<<<<<<<< * * if not isinstance(alm, (list, tuple, np.ndarray)) or len(alm) == 0: */ - __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 502, __pyx_L1_error) + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_alm); __Pyx_GIVEREF(__pyx_v_alm); @@ -7136,7 +7824,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject __Pyx_DECREF_SET(__pyx_v_alm, __pyx_t_5); __pyx_t_5 = 0; - /* "healpy/src/_sphtools.pyx":501 + /* "healpy/src/_sphtools.pyx":508 * * """ * if isinstance(alm, np.ndarray) and alm.ndim == 1: # <<<<<<<<<<<<<< @@ -7145,7 +7833,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject */ } - /* "healpy/src/_sphtools.pyx":504 + /* "healpy/src/_sphtools.pyx":511 * alm = [alm] * * if not isinstance(alm, (list, tuple, np.ndarray)) or len(alm) == 0: # <<<<<<<<<<<<<< @@ -7176,26 +7864,26 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject __pyx_t_1 = __pyx_t_6; goto __pyx_L7_bool_binop_done; } - __pyx_t_7 = PyObject_Length(__pyx_v_alm); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_7 = PyObject_Length(__pyx_v_alm); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 511, __pyx_L1_error) __pyx_t_6 = ((__pyx_t_7 == 0) != 0); __pyx_t_1 = __pyx_t_6; __pyx_L7_bool_binop_done:; if (__pyx_t_1) { - /* "healpy/src/_sphtools.pyx":505 + /* "healpy/src/_sphtools.pyx":512 * * if not isinstance(alm, (list, tuple, np.ndarray)) or len(alm) == 0: * raise ValueError('Invalid input.') # <<<<<<<<<<<<<< * * # C++ rotate_alm only handles 1 or 3 maps. The function handling 3 maps */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 505, __pyx_L1_error) + __PYX_ERR(0, 512, __pyx_L1_error) - /* "healpy/src/_sphtools.pyx":504 + /* "healpy/src/_sphtools.pyx":511 * alm = [alm] * * if not isinstance(alm, (list, tuple, np.ndarray)) or len(alm) == 0: # <<<<<<<<<<<<<< @@ -7204,14 +7892,14 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject */ } - /* "healpy/src/_sphtools.pyx":510 + /* "healpy/src/_sphtools.pyx":517 * # is faster than running 3 times the 1-map function, but gives identical * # results. * if len(alm) not in (1, 3): # <<<<<<<<<<<<<< * for a in alm: * rotate_alm(a, psi, theta, phi) */ - __pyx_t_7 = PyObject_Length(__pyx_v_alm); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 510, __pyx_L1_error) + __pyx_t_7 = PyObject_Length(__pyx_v_alm); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 517, __pyx_L1_error) __pyx_t_6 = ((__pyx_t_7 != 1) != 0); if (__pyx_t_6) { } else { @@ -7224,7 +7912,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject __pyx_t_6 = (__pyx_t_1 != 0); if (__pyx_t_6) { - /* "healpy/src/_sphtools.pyx":511 + /* "healpy/src/_sphtools.pyx":518 * # results. * if len(alm) not in (1, 3): * for a in alm: # <<<<<<<<<<<<<< @@ -7235,26 +7923,26 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject __pyx_t_5 = __pyx_v_alm; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_alm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 511, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_alm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 511, __pyx_L1_error) + __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 518, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 511, __pyx_L1_error) + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 518, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 511, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 511, __pyx_L1_error) + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 518, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 511, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -7264,7 +7952,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 511, __pyx_L1_error) + else __PYX_ERR(0, 518, __pyx_L1_error) } break; } @@ -7273,24 +7961,24 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject __Pyx_XDECREF_SET(__pyx_v_a, __pyx_t_4); __pyx_t_4 = 0; - /* "healpy/src/_sphtools.pyx":512 + /* "healpy/src/_sphtools.pyx":519 * if len(alm) not in (1, 3): * for a in alm: * rotate_alm(a, psi, theta, phi) # <<<<<<<<<<<<<< * return * */ - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_rotate_alm); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_rotate_alm); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyFloat_FromDouble(__pyx_v_psi); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_10 = PyFloat_FromDouble(__pyx_v_psi); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = PyFloat_FromDouble(__pyx_v_theta); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_11 = PyFloat_FromDouble(__pyx_v_theta); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = PyFloat_FromDouble(__pyx_v_phi); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_12 = PyFloat_FromDouble(__pyx_v_phi); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = NULL; __pyx_t_14 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); @@ -7300,30 +7988,54 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject __pyx_t_14 = 1; } } - __pyx_t_15 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 512, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - if (__pyx_t_13) { - __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_13); __pyx_t_13 = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_9)) { + PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_v_a, __pyx_t_10, __pyx_t_11, __pyx_t_12}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { + PyObject *__pyx_temp[5] = {__pyx_t_13, __pyx_v_a, __pyx_t_10, __pyx_t_11, __pyx_t_12}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_14, 4+__pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } else + #endif + { + __pyx_t_15 = PyTuple_New(4+__pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + if (__pyx_t_13) { + __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_13); __pyx_t_13 = NULL; + } + __Pyx_INCREF(__pyx_v_a); + __Pyx_GIVEREF(__pyx_v_a); + PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_14, __pyx_v_a); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_14, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_15, 2+__pyx_t_14, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_15, 3+__pyx_t_14, __pyx_t_12); + __pyx_t_10 = 0; + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_15, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } - __Pyx_INCREF(__pyx_v_a); - __Pyx_GIVEREF(__pyx_v_a); - PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_14, __pyx_v_a); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_14, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_15, 2+__pyx_t_14, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_15, 3+__pyx_t_14, __pyx_t_12); - __pyx_t_10 = 0; - __pyx_t_11 = 0; - __pyx_t_12 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_15, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "healpy/src/_sphtools.pyx":511 + /* "healpy/src/_sphtools.pyx":518 * # results. * if len(alm) not in (1, 3): * for a in alm: # <<<<<<<<<<<<<< @@ -7333,7 +8045,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "healpy/src/_sphtools.pyx":513 + /* "healpy/src/_sphtools.pyx":520 * for a in alm: * rotate_alm(a, psi, theta, phi) * return # <<<<<<<<<<<<<< @@ -7344,7 +8056,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "healpy/src/_sphtools.pyx":510 + /* "healpy/src/_sphtools.pyx":517 * # is faster than running 3 times the 1-map function, but gives identical * # results. * if len(alm) not in (1, 3): # <<<<<<<<<<<<<< @@ -7353,50 +8065,70 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject */ } - /* "healpy/src/_sphtools.pyx":515 + /* "healpy/src/_sphtools.pyx":522 * return * * lmax, mmax = alm_getlmmax(alm[0], lmax, mmax) # <<<<<<<<<<<<<< * ai = np.ascontiguousarray(alm[0], dtype=np.complex128) * AI = ndarray2alm(ai, lmax, mmax) */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_alm_getlmmax); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 515, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_alm_getlmmax); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_alm, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 515, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_alm, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_15 = NULL; - __pyx_t_7 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_14 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_7 = 1; + __pyx_t_14 = 1; } } - __pyx_t_12 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 515, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (__pyx_t_15) { - __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_15); __pyx_t_15 = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[4] = {__pyx_t_15, __pyx_t_9, __pyx_v_lmax, __pyx_v_mmax}; + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_14, 3+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[4] = {__pyx_t_15, __pyx_t_9, __pyx_v_lmax, __pyx_v_mmax}; + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_14, 3+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else + #endif + { + __pyx_t_12 = PyTuple_New(3+__pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (__pyx_t_15) { + __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_15); __pyx_t_15 = NULL; + } + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_14, __pyx_t_9); + __Pyx_INCREF(__pyx_v_lmax); + __Pyx_GIVEREF(__pyx_v_lmax); + PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_14, __pyx_v_lmax); + __Pyx_INCREF(__pyx_v_mmax); + __Pyx_GIVEREF(__pyx_v_mmax); + PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_14, __pyx_v_mmax); + __pyx_t_9 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_7, __pyx_t_9); - __Pyx_INCREF(__pyx_v_lmax); - __Pyx_GIVEREF(__pyx_v_lmax); - PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_7, __pyx_v_lmax); - __Pyx_INCREF(__pyx_v_mmax); - __Pyx_GIVEREF(__pyx_v_mmax); - PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_7, __pyx_v_mmax); - __pyx_t_9 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 515, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; - #if CYTHON_COMPILING_IN_CPYTHON + #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); @@ -7404,9 +8136,9 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 515, __pyx_L1_error) + __PYX_ERR(0, 522, __pyx_L1_error) } - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); @@ -7417,15 +8149,15 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_12); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 515, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 515, __pyx_L1_error) + __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 515, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext; @@ -7433,7 +8165,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_12 = __pyx_t_16(__pyx_t_9); if (unlikely(!__pyx_t_12)) goto __pyx_L17_unpacking_failed; __Pyx_GOTREF(__pyx_t_12); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_9), 2) < 0) __PYX_ERR(0, 515, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_9), 2) < 0) __PYX_ERR(0, 522, __pyx_L1_error) __pyx_t_16 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L18_unpacking_done; @@ -7441,7 +8173,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_16 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 515, __pyx_L1_error) + __PYX_ERR(0, 522, __pyx_L1_error) __pyx_L18_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_lmax, __pyx_t_4); @@ -7449,35 +8181,35 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject __Pyx_DECREF_SET(__pyx_v_mmax, __pyx_t_12); __pyx_t_12 = 0; - /* "healpy/src/_sphtools.pyx":516 + /* "healpy/src/_sphtools.pyx":523 * * lmax, mmax = alm_getlmmax(alm[0], lmax, mmax) * ai = np.ascontiguousarray(alm[0], dtype=np.complex128) # <<<<<<<<<<<<<< * AI = ndarray2alm(ai, lmax, mmax) * if len(alm) == 1: */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_alm, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_alm, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_complex128); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_complex128); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_15) < 0) __PYX_ERR(0, 516, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_15) < 0) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -7485,31 +8217,31 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject __pyx_v_ai = __pyx_t_15; __pyx_t_15 = 0; - /* "healpy/src/_sphtools.pyx":517 + /* "healpy/src/_sphtools.pyx":524 * lmax, mmax = alm_getlmmax(alm[0], lmax, mmax) * ai = np.ascontiguousarray(alm[0], dtype=np.complex128) * AI = ndarray2alm(ai, lmax, mmax) # <<<<<<<<<<<<<< * if len(alm) == 1: * c_rotate_alm(AI[0], psi, theta, phi) */ - if (!(likely(((__pyx_v_ai) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_ai, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 517, __pyx_L1_error) - __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_v_lmax); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 517, __pyx_L1_error) - __pyx_t_18 = __Pyx_PyInt_As_int(__pyx_v_mmax); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 517, __pyx_L1_error) - __pyx_t_19 = __pyx_f_7_common_ndarray2alm(((PyArrayObject *)__pyx_v_ai), __pyx_t_17, __pyx_t_18); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 517, __pyx_L1_error) - __pyx_v_AI = __pyx_t_19; + if (!(likely(((__pyx_v_ai) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_ai, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_v_lmax); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_v_mmax); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_18 = __pyx_f_7_common_ndarray2alm(((PyArrayObject *)__pyx_v_ai), __pyx_t_14, __pyx_t_17); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_v_AI = __pyx_t_18; - /* "healpy/src/_sphtools.pyx":518 + /* "healpy/src/_sphtools.pyx":525 * ai = np.ascontiguousarray(alm[0], dtype=np.complex128) * AI = ndarray2alm(ai, lmax, mmax) * if len(alm) == 1: # <<<<<<<<<<<<<< * c_rotate_alm(AI[0], psi, theta, phi) * del AI */ - __pyx_t_7 = PyObject_Length(__pyx_v_alm); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_7 = PyObject_Length(__pyx_v_alm); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 525, __pyx_L1_error) __pyx_t_6 = ((__pyx_t_7 == 1) != 0); if (__pyx_t_6) { - /* "healpy/src/_sphtools.pyx":519 + /* "healpy/src/_sphtools.pyx":526 * AI = ndarray2alm(ai, lmax, mmax) * if len(alm) == 1: * c_rotate_alm(AI[0], psi, theta, phi) # <<<<<<<<<<<<<< @@ -7518,7 +8250,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject */ rotate_alm((__pyx_v_AI[0]), __pyx_v_psi, __pyx_v_theta, __pyx_v_phi); - /* "healpy/src/_sphtools.pyx":520 + /* "healpy/src/_sphtools.pyx":527 * if len(alm) == 1: * c_rotate_alm(AI[0], psi, theta, phi) * del AI # <<<<<<<<<<<<<< @@ -7527,7 +8259,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject */ delete __pyx_v_AI; - /* "healpy/src/_sphtools.pyx":518 + /* "healpy/src/_sphtools.pyx":525 * ai = np.ascontiguousarray(alm[0], dtype=np.complex128) * AI = ndarray2alm(ai, lmax, mmax) * if len(alm) == 1: # <<<<<<<<<<<<<< @@ -7537,7 +8269,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject goto __pyx_L19; } - /* "healpy/src/_sphtools.pyx":522 + /* "healpy/src/_sphtools.pyx":529 * del AI * else: * ag = np.ascontiguousarray(alm[1], dtype=np.complex128) # <<<<<<<<<<<<<< @@ -7545,28 +8277,28 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject * AG = ndarray2alm(ag, lmax, mmax) */ /*else*/ { - __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_alm, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_alm, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyDict_New(); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_15 = PyDict_New(); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_complex128); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_complex128); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 522, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_15); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_15); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -7574,35 +8306,35 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject __pyx_v_ag = __pyx_t_9; __pyx_t_9 = 0; - /* "healpy/src/_sphtools.pyx":523 + /* "healpy/src/_sphtools.pyx":530 * else: * ag = np.ascontiguousarray(alm[1], dtype=np.complex128) * ac = np.ascontiguousarray(alm[2], dtype=np.complex128) # <<<<<<<<<<<<<< * AG = ndarray2alm(ag, lmax, mmax) * AC = ndarray2alm(ac, lmax, mmax) */ - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_alm, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_alm, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_complex128); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_complex128); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 523, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -7610,33 +8342,33 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject __pyx_v_ac = __pyx_t_12; __pyx_t_12 = 0; - /* "healpy/src/_sphtools.pyx":524 + /* "healpy/src/_sphtools.pyx":531 * ag = np.ascontiguousarray(alm[1], dtype=np.complex128) * ac = np.ascontiguousarray(alm[2], dtype=np.complex128) * AG = ndarray2alm(ag, lmax, mmax) # <<<<<<<<<<<<<< * AC = ndarray2alm(ac, lmax, mmax) * c_rotate_alm(AI[0], AG[0], AC[0], psi, theta, phi) */ - if (!(likely(((__pyx_v_ag) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_ag, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 524, __pyx_L1_error) - __pyx_t_18 = __Pyx_PyInt_As_int(__pyx_v_lmax); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 524, __pyx_L1_error) - __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_v_mmax); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 524, __pyx_L1_error) - __pyx_t_19 = __pyx_f_7_common_ndarray2alm(((PyArrayObject *)__pyx_v_ag), __pyx_t_18, __pyx_t_17); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 524, __pyx_L1_error) - __pyx_v_AG = __pyx_t_19; + if (!(likely(((__pyx_v_ag) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_ag, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 531, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_v_lmax); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 531, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_v_mmax); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 531, __pyx_L1_error) + __pyx_t_18 = __pyx_f_7_common_ndarray2alm(((PyArrayObject *)__pyx_v_ag), __pyx_t_17, __pyx_t_14); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 531, __pyx_L1_error) + __pyx_v_AG = __pyx_t_18; - /* "healpy/src/_sphtools.pyx":525 + /* "healpy/src/_sphtools.pyx":532 * ac = np.ascontiguousarray(alm[2], dtype=np.complex128) * AG = ndarray2alm(ag, lmax, mmax) * AC = ndarray2alm(ac, lmax, mmax) # <<<<<<<<<<<<<< * c_rotate_alm(AI[0], AG[0], AC[0], psi, theta, phi) * del AI, AG, AC */ - if (!(likely(((__pyx_v_ac) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_ac, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 525, __pyx_L1_error) - __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_v_lmax); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 525, __pyx_L1_error) - __pyx_t_18 = __Pyx_PyInt_As_int(__pyx_v_mmax); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 525, __pyx_L1_error) - __pyx_t_19 = __pyx_f_7_common_ndarray2alm(((PyArrayObject *)__pyx_v_ac), __pyx_t_17, __pyx_t_18); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 525, __pyx_L1_error) - __pyx_v_AC = __pyx_t_19; + if (!(likely(((__pyx_v_ac) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_ac, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_v_lmax); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_v_mmax); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_t_18 = __pyx_f_7_common_ndarray2alm(((PyArrayObject *)__pyx_v_ac), __pyx_t_14, __pyx_t_17); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_v_AC = __pyx_t_18; - /* "healpy/src/_sphtools.pyx":526 + /* "healpy/src/_sphtools.pyx":533 * AG = ndarray2alm(ag, lmax, mmax) * AC = ndarray2alm(ac, lmax, mmax) * c_rotate_alm(AI[0], AG[0], AC[0], psi, theta, phi) # <<<<<<<<<<<<<< @@ -7645,7 +8377,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject */ rotate_alm((__pyx_v_AI[0]), (__pyx_v_AG[0]), (__pyx_v_AC[0]), __pyx_v_psi, __pyx_v_theta, __pyx_v_phi); - /* "healpy/src/_sphtools.pyx":527 + /* "healpy/src/_sphtools.pyx":534 * AC = ndarray2alm(ac, lmax, mmax) * c_rotate_alm(AI[0], AG[0], AC[0], psi, theta, phi) * del AI, AG, AC # <<<<<<<<<<<<<< @@ -7658,7 +8390,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject } __pyx_L19:; - /* "healpy/src/_sphtools.pyx":472 + /* "healpy/src/_sphtools.pyx":479 * * * def rotate_alm(alm not None, double psi, double theta, double phi, lmax=None, # <<<<<<<<<<<<<< @@ -7693,7 +8425,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_12rotate_alm(CYTHON_UNUSED PyObject return __pyx_r; } -/* "healpy/src/_sphtools.pyx":530 +/* "healpy/src/_sphtools.pyx":537 * * * cdef int alm_getn(int l, int m): # <<<<<<<<<<<<<< @@ -7708,7 +8440,7 @@ static int __pyx_f_6healpy_9_sphtools_alm_getn(int __pyx_v_l, int __pyx_v_m) { PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("alm_getn", 0); - /* "healpy/src/_sphtools.pyx":531 + /* "healpy/src/_sphtools.pyx":538 * * cdef int alm_getn(int l, int m): * if not m <= l: # <<<<<<<<<<<<<< @@ -7718,20 +8450,20 @@ static int __pyx_f_6healpy_9_sphtools_alm_getn(int __pyx_v_l, int __pyx_v_m) { __pyx_t_1 = ((!((__pyx_v_m <= __pyx_v_l) != 0)) != 0); if (__pyx_t_1) { - /* "healpy/src/_sphtools.pyx":532 + /* "healpy/src/_sphtools.pyx":539 * cdef int alm_getn(int l, int m): * if not m <= l: * raise ValueError("mmax must be <= lmax") # <<<<<<<<<<<<<< * return ((m+1)*(m+2))/2 + (m+1)*(l-m) * */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 532, __pyx_L1_error) + __PYX_ERR(0, 539, __pyx_L1_error) - /* "healpy/src/_sphtools.pyx":531 + /* "healpy/src/_sphtools.pyx":538 * * cdef int alm_getn(int l, int m): * if not m <= l: # <<<<<<<<<<<<<< @@ -7740,7 +8472,7 @@ static int __pyx_f_6healpy_9_sphtools_alm_getn(int __pyx_v_l, int __pyx_v_m) { */ } - /* "healpy/src/_sphtools.pyx":533 + /* "healpy/src/_sphtools.pyx":540 * if not m <= l: * raise ValueError("mmax must be <= lmax") * return ((m+1)*(m+2))/2 + (m+1)*(l-m) # <<<<<<<<<<<<<< @@ -7750,7 +8482,7 @@ static int __pyx_f_6healpy_9_sphtools_alm_getn(int __pyx_v_l, int __pyx_v_m) { __pyx_r = (__Pyx_div_long(((__pyx_v_m + 1) * (__pyx_v_m + 2)), 2) + ((__pyx_v_m + 1) * (__pyx_v_l - __pyx_v_m))); goto __pyx_L0; - /* "healpy/src/_sphtools.pyx":530 + /* "healpy/src/_sphtools.pyx":537 * * * cdef int alm_getn(int l, int m): # <<<<<<<<<<<<<< @@ -7768,7 +8500,7 @@ static int __pyx_f_6healpy_9_sphtools_alm_getn(int __pyx_v_l, int __pyx_v_m) { return __pyx_r; } -/* "healpy/src/_sphtools.pyx":536 +/* "healpy/src/_sphtools.pyx":543 * * * def alm_getlmmax(a, lmax, mmax): # <<<<<<<<<<<<<< @@ -7808,16 +8540,16 @@ static PyObject *__pyx_pw_6healpy_9_sphtools_15alm_getlmmax(PyObject *__pyx_self case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lmax)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("alm_getlmmax", 1, 3, 3, 1); __PYX_ERR(0, 536, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("alm_getlmmax", 1, 3, 3, 1); __PYX_ERR(0, 543, __pyx_L3_error) } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mmax)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("alm_getlmmax", 1, 3, 3, 2); __PYX_ERR(0, 536, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("alm_getlmmax", 1, 3, 3, 2); __PYX_ERR(0, 543, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "alm_getlmmax") < 0)) __PYX_ERR(0, 536, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "alm_getlmmax") < 0)) __PYX_ERR(0, 543, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -7832,7 +8564,7 @@ static PyObject *__pyx_pw_6healpy_9_sphtools_15alm_getlmmax(PyObject *__pyx_self } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("alm_getlmmax", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 536, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("alm_getlmmax", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 543, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("healpy._sphtools.alm_getlmmax", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -7857,7 +8589,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_14alm_getlmmax(CYTHON_UNUSED PyObje __Pyx_INCREF(__pyx_v_lmax); __Pyx_INCREF(__pyx_v_mmax); - /* "healpy/src/_sphtools.pyx":537 + /* "healpy/src/_sphtools.pyx":544 * * def alm_getlmmax(a, lmax, mmax): * if lmax is None: # <<<<<<<<<<<<<< @@ -7868,7 +8600,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_14alm_getlmmax(CYTHON_UNUSED PyObje __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "healpy/src/_sphtools.pyx":538 + /* "healpy/src/_sphtools.pyx":545 * def alm_getlmmax(a, lmax, mmax): * if lmax is None: * if mmax is None: # <<<<<<<<<<<<<< @@ -7879,23 +8611,23 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_14alm_getlmmax(CYTHON_UNUSED PyObje __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "healpy/src/_sphtools.pyx":539 + /* "healpy/src/_sphtools.pyx":546 * if lmax is None: * if mmax is None: * lmax = alm_getlmax(a.size) # <<<<<<<<<<<<<< * mmax = lmax * else: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 539, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_f_6healpy_9_sphtools_alm_getlmax(__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_f_6healpy_9_sphtools_alm_getlmax(__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_lmax, __pyx_t_3); __pyx_t_3 = 0; - /* "healpy/src/_sphtools.pyx":540 + /* "healpy/src/_sphtools.pyx":547 * if mmax is None: * lmax = alm_getlmax(a.size) * mmax = lmax # <<<<<<<<<<<<<< @@ -7905,7 +8637,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_14alm_getlmmax(CYTHON_UNUSED PyObje __Pyx_INCREF(__pyx_v_lmax); __Pyx_DECREF_SET(__pyx_v_mmax, __pyx_v_lmax); - /* "healpy/src/_sphtools.pyx":538 + /* "healpy/src/_sphtools.pyx":545 * def alm_getlmmax(a, lmax, mmax): * if lmax is None: * if mmax is None: # <<<<<<<<<<<<<< @@ -7915,7 +8647,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_14alm_getlmmax(CYTHON_UNUSED PyObje goto __pyx_L4; } - /* "healpy/src/_sphtools.pyx":542 + /* "healpy/src/_sphtools.pyx":549 * mmax = lmax * else: * lmax = alm_getlmax2(a.size, mmax) # <<<<<<<<<<<<<< @@ -7923,19 +8655,19 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_14alm_getlmmax(CYTHON_UNUSED PyObje * mmax = lmax */ /*else*/ { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 542, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_mmax); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 542, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_f_6healpy_9_sphtools_alm_getlmax2(__pyx_t_4, __pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_mmax); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 549, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_f_6healpy_9_sphtools_alm_getlmax2(__pyx_t_4, __pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_lmax, __pyx_t_3); __pyx_t_3 = 0; } __pyx_L4:; - /* "healpy/src/_sphtools.pyx":537 + /* "healpy/src/_sphtools.pyx":544 * * def alm_getlmmax(a, lmax, mmax): * if lmax is None: # <<<<<<<<<<<<<< @@ -7945,7 +8677,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_14alm_getlmmax(CYTHON_UNUSED PyObje goto __pyx_L3; } - /* "healpy/src/_sphtools.pyx":543 + /* "healpy/src/_sphtools.pyx":550 * else: * lmax = alm_getlmax2(a.size, mmax) * elif mmax is None: # <<<<<<<<<<<<<< @@ -7956,7 +8688,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_14alm_getlmmax(CYTHON_UNUSED PyObje __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "healpy/src/_sphtools.pyx":544 + /* "healpy/src/_sphtools.pyx":551 * lmax = alm_getlmax2(a.size, mmax) * elif mmax is None: * mmax = lmax # <<<<<<<<<<<<<< @@ -7966,7 +8698,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_14alm_getlmmax(CYTHON_UNUSED PyObje __Pyx_INCREF(__pyx_v_lmax); __Pyx_DECREF_SET(__pyx_v_mmax, __pyx_v_lmax); - /* "healpy/src/_sphtools.pyx":543 + /* "healpy/src/_sphtools.pyx":550 * else: * lmax = alm_getlmax2(a.size, mmax) * elif mmax is None: # <<<<<<<<<<<<<< @@ -7976,7 +8708,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_14alm_getlmmax(CYTHON_UNUSED PyObje } __pyx_L3:; - /* "healpy/src/_sphtools.pyx":545 + /* "healpy/src/_sphtools.pyx":552 * elif mmax is None: * mmax = lmax * return lmax, mmax # <<<<<<<<<<<<<< @@ -7984,7 +8716,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_14alm_getlmmax(CYTHON_UNUSED PyObje * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_lmax); __Pyx_GIVEREF(__pyx_v_lmax); @@ -7996,7 +8728,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_14alm_getlmmax(CYTHON_UNUSED PyObje __pyx_t_3 = 0; goto __pyx_L0; - /* "healpy/src/_sphtools.pyx":536 + /* "healpy/src/_sphtools.pyx":543 * * * def alm_getlmmax(a, lmax, mmax): # <<<<<<<<<<<<<< @@ -8017,7 +8749,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_14alm_getlmmax(CYTHON_UNUSED PyObje return __pyx_r; } -/* "healpy/src/_sphtools.pyx":549 +/* "healpy/src/_sphtools.pyx":556 * * @cython.cdivision(True) * cdef inline int alm_getlmax(int s): # <<<<<<<<<<<<<< @@ -8038,22 +8770,22 @@ static CYTHON_INLINE int __pyx_f_6healpy_9_sphtools_alm_getlmax(int __pyx_v_s) { int __pyx_t_7; __Pyx_RefNannySetupContext("alm_getlmax", 0); - /* "healpy/src/_sphtools.pyx":551 + /* "healpy/src/_sphtools.pyx":558 * cdef inline int alm_getlmax(int s): * cdef double x * x=(-3+np.sqrt(1+8*s))/2 # <<<<<<<<<<<<<< * if x != floor(x): * return -1 */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_long((1 + (8 * __pyx_v_s))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_long((1 + (8 * __pyx_v_s))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); @@ -8063,32 +8795,52 @@ static CYTHON_INLINE int __pyx_f_6healpy_9_sphtools_alm_getlmax(int __pyx_v_s) { } } if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_AddCObj(__pyx_int_neg_3, __pyx_t_1, -3L, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_AddCObj(__pyx_int_neg_3, __pyx_t_1, -3L, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_int_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_int_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_x = __pyx_t_6; - /* "healpy/src/_sphtools.pyx":552 + /* "healpy/src/_sphtools.pyx":559 * cdef double x * x=(-3+np.sqrt(1+8*s))/2 * if x != floor(x): # <<<<<<<<<<<<<< @@ -8098,7 +8850,7 @@ static CYTHON_INLINE int __pyx_f_6healpy_9_sphtools_alm_getlmax(int __pyx_v_s) { __pyx_t_7 = ((__pyx_v_x != floor(__pyx_v_x)) != 0); if (__pyx_t_7) { - /* "healpy/src/_sphtools.pyx":553 + /* "healpy/src/_sphtools.pyx":560 * x=(-3+np.sqrt(1+8*s))/2 * if x != floor(x): * return -1 # <<<<<<<<<<<<<< @@ -8108,7 +8860,7 @@ static CYTHON_INLINE int __pyx_f_6healpy_9_sphtools_alm_getlmax(int __pyx_v_s) { __pyx_r = -1; goto __pyx_L0; - /* "healpy/src/_sphtools.pyx":552 + /* "healpy/src/_sphtools.pyx":559 * cdef double x * x=(-3+np.sqrt(1+8*s))/2 * if x != floor(x): # <<<<<<<<<<<<<< @@ -8117,7 +8869,7 @@ static CYTHON_INLINE int __pyx_f_6healpy_9_sphtools_alm_getlmax(int __pyx_v_s) { */ } - /* "healpy/src/_sphtools.pyx":555 + /* "healpy/src/_sphtools.pyx":562 * return -1 * else: * return floor(x) # <<<<<<<<<<<<<< @@ -8129,7 +8881,7 @@ static CYTHON_INLINE int __pyx_f_6healpy_9_sphtools_alm_getlmax(int __pyx_v_s) { goto __pyx_L0; } - /* "healpy/src/_sphtools.pyx":549 + /* "healpy/src/_sphtools.pyx":556 * * @cython.cdivision(True) * cdef inline int alm_getlmax(int s): # <<<<<<<<<<<<<< @@ -8151,7 +8903,7 @@ static CYTHON_INLINE int __pyx_f_6healpy_9_sphtools_alm_getlmax(int __pyx_v_s) { return __pyx_r; } -/* "healpy/src/_sphtools.pyx":559 +/* "healpy/src/_sphtools.pyx":566 * * @cython.cdivision(True) * cdef inline int alm_getlmax2(int s, int mmax): # <<<<<<<<<<<<<< @@ -8166,7 +8918,7 @@ static CYTHON_INLINE int __pyx_f_6healpy_9_sphtools_alm_getlmax2(int __pyx_v_s, int __pyx_t_1; __Pyx_RefNannySetupContext("alm_getlmax2", 0); - /* "healpy/src/_sphtools.pyx":561 + /* "healpy/src/_sphtools.pyx":568 * cdef inline int alm_getlmax2(int s, int mmax): * cdef double x * x = (2 * s + mmax ** 2 - mmax - 2.) / (2 * mmax + 2.) # <<<<<<<<<<<<<< @@ -8175,7 +8927,7 @@ static CYTHON_INLINE int __pyx_f_6healpy_9_sphtools_alm_getlmax2(int __pyx_v_s, */ __pyx_v_x = (((((2 * __pyx_v_s) + __Pyx_pow_long(((long)__pyx_v_mmax), 2)) - __pyx_v_mmax) - 2.) / ((2 * __pyx_v_mmax) + 2.)); - /* "healpy/src/_sphtools.pyx":562 + /* "healpy/src/_sphtools.pyx":569 * cdef double x * x = (2 * s + mmax ** 2 - mmax - 2.) / (2 * mmax + 2.) * if x != floor(x): # <<<<<<<<<<<<<< @@ -8185,7 +8937,7 @@ static CYTHON_INLINE int __pyx_f_6healpy_9_sphtools_alm_getlmax2(int __pyx_v_s, __pyx_t_1 = ((__pyx_v_x != floor(__pyx_v_x)) != 0); if (__pyx_t_1) { - /* "healpy/src/_sphtools.pyx":563 + /* "healpy/src/_sphtools.pyx":570 * x = (2 * s + mmax ** 2 - mmax - 2.) / (2 * mmax + 2.) * if x != floor(x): * return -1 # <<<<<<<<<<<<<< @@ -8195,7 +8947,7 @@ static CYTHON_INLINE int __pyx_f_6healpy_9_sphtools_alm_getlmax2(int __pyx_v_s, __pyx_r = -1; goto __pyx_L0; - /* "healpy/src/_sphtools.pyx":562 + /* "healpy/src/_sphtools.pyx":569 * cdef double x * x = (2 * s + mmax ** 2 - mmax - 2.) / (2 * mmax + 2.) * if x != floor(x): # <<<<<<<<<<<<<< @@ -8204,7 +8956,7 @@ static CYTHON_INLINE int __pyx_f_6healpy_9_sphtools_alm_getlmax2(int __pyx_v_s, */ } - /* "healpy/src/_sphtools.pyx":565 + /* "healpy/src/_sphtools.pyx":572 * return -1 * else: * return floor(x) # <<<<<<<<<<<<<< @@ -8216,7 +8968,7 @@ static CYTHON_INLINE int __pyx_f_6healpy_9_sphtools_alm_getlmax2(int __pyx_v_s, goto __pyx_L0; } - /* "healpy/src/_sphtools.pyx":559 + /* "healpy/src/_sphtools.pyx":566 * * @cython.cdivision(True) * cdef inline int alm_getlmax2(int s, int mmax): # <<<<<<<<<<<<<< @@ -8230,7 +8982,7 @@ static CYTHON_INLINE int __pyx_f_6healpy_9_sphtools_alm_getlmax2(int __pyx_v_s, return __pyx_r; } -/* "healpy/src/_sphtools.pyx":569 +/* "healpy/src/_sphtools.pyx":576 * * @cython.cdivision(True) * cdef inline int alm_getidx(int lmax, int l, int m): # <<<<<<<<<<<<<< @@ -8243,7 +8995,7 @@ static CYTHON_INLINE int __pyx_f_6healpy_9_sphtools_alm_getidx(int __pyx_v_lmax, __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("alm_getidx", 0); - /* "healpy/src/_sphtools.pyx":570 + /* "healpy/src/_sphtools.pyx":577 * @cython.cdivision(True) * cdef inline int alm_getidx(int lmax, int l, int m): * return m*(2*lmax+1-m)/2+l # <<<<<<<<<<<<<< @@ -8253,7 +9005,7 @@ static CYTHON_INLINE int __pyx_f_6healpy_9_sphtools_alm_getidx(int __pyx_v_lmax, __pyx_r = (((__pyx_v_m * (((2 * __pyx_v_lmax) + 1) - __pyx_v_m)) / 2) + __pyx_v_l); goto __pyx_L0; - /* "healpy/src/_sphtools.pyx":569 + /* "healpy/src/_sphtools.pyx":576 * * @cython.cdivision(True) * cdef inline int alm_getidx(int lmax, int l, int m): # <<<<<<<<<<<<<< @@ -8267,7 +9019,7 @@ static CYTHON_INLINE int __pyx_f_6healpy_9_sphtools_alm_getidx(int __pyx_v_lmax, return __pyx_r; } -/* "healpy/src/_sphtools.pyx":575 +/* "healpy/src/_sphtools.pyx":582 * @cython.wraparound(False) * @cython.boundscheck(False) * cpdef mkmask(np.ndarray[double, ndim=1] m): # <<<<<<<<<<<<<< @@ -8312,24 +9064,24 @@ static PyObject *__pyx_f_6healpy_9_sphtools_mkmask(PyArrayObject *__pyx_v_m, CYT __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 575, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 582, __pyx_L1_error) } __pyx_pybuffernd_m.diminfo[0].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m.diminfo[0].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[0]; - /* "healpy/src/_sphtools.pyx":577 + /* "healpy/src/_sphtools.pyx":584 * cpdef mkmask(np.ndarray[double, ndim=1] m): * cdef int nbad * cdef int size = m.size # <<<<<<<<<<<<<< * cdef int i * # first, count number of bad pixels, to see if allocating a mask is needed */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_m), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_m), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 577, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_2; - /* "healpy/src/_sphtools.pyx":580 + /* "healpy/src/_sphtools.pyx":587 * cdef int i * # first, count number of bad pixels, to see if allocating a mask is needed * nbad = count_bad(m) # <<<<<<<<<<<<<< @@ -8338,7 +9090,7 @@ static PyObject *__pyx_f_6healpy_9_sphtools_mkmask(PyArrayObject *__pyx_v_m, CYT */ __pyx_v_nbad = __pyx_f_6healpy_9_sphtools_count_bad(((PyArrayObject *)__pyx_v_m), 0); - /* "healpy/src/_sphtools.pyx":583 + /* "healpy/src/_sphtools.pyx":590 * cdef np.ndarray[np.int8_t, ndim=1] mask * #cdef np.ndarray[double, ndim=1] m_ * if nbad == 0: # <<<<<<<<<<<<<< @@ -8348,7 +9100,7 @@ static PyObject *__pyx_f_6healpy_9_sphtools_mkmask(PyArrayObject *__pyx_v_m, CYT __pyx_t_3 = ((__pyx_v_nbad == 0) != 0); if (__pyx_t_3) { - /* "healpy/src/_sphtools.pyx":584 + /* "healpy/src/_sphtools.pyx":591 * #cdef np.ndarray[double, ndim=1] m_ * if nbad == 0: * return False # <<<<<<<<<<<<<< @@ -8360,7 +9112,7 @@ static PyObject *__pyx_f_6healpy_9_sphtools_mkmask(PyArrayObject *__pyx_v_m, CYT __pyx_r = Py_False; goto __pyx_L0; - /* "healpy/src/_sphtools.pyx":583 + /* "healpy/src/_sphtools.pyx":590 * cdef np.ndarray[np.int8_t, ndim=1] mask * #cdef np.ndarray[double, ndim=1] m_ * if nbad == 0: # <<<<<<<<<<<<<< @@ -8369,7 +9121,7 @@ static PyObject *__pyx_f_6healpy_9_sphtools_mkmask(PyArrayObject *__pyx_v_m, CYT */ } - /* "healpy/src/_sphtools.pyx":586 + /* "healpy/src/_sphtools.pyx":593 * return False * else: * mask = np.zeros(size, dtype = np.int8) # <<<<<<<<<<<<<< @@ -8377,33 +9129,33 @@ static PyObject *__pyx_f_6healpy_9_sphtools_mkmask(PyArrayObject *__pyx_v_m, CYT * for i in range(size): */ /*else*/ { - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 586, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 586, __pyx_L1_error) + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 593, __pyx_L1_error) __pyx_t_8 = ((PyArrayObject *)__pyx_t_7); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -8419,13 +9171,13 @@ static PyObject *__pyx_f_6healpy_9_sphtools_mkmask(PyArrayObject *__pyx_v_m, CYT } } __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 586, __pyx_L1_error) + if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 593, __pyx_L1_error) } __pyx_t_8 = 0; __pyx_v_mask = ((PyArrayObject *)__pyx_t_7); __pyx_t_7 = 0; - /* "healpy/src/_sphtools.pyx":588 + /* "healpy/src/_sphtools.pyx":595 * mask = np.zeros(size, dtype = np.int8) * #m_ = m * for i in range(size): # <<<<<<<<<<<<<< @@ -8436,7 +9188,7 @@ static PyObject *__pyx_f_6healpy_9_sphtools_mkmask(PyArrayObject *__pyx_v_m, CYT for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; - /* "healpy/src/_sphtools.pyx":589 + /* "healpy/src/_sphtools.pyx":596 * #m_ = m * for i in range(size): * if fabs(m[i] - UNSEEN) < rtol_UNSEEN: # <<<<<<<<<<<<<< @@ -8447,7 +9199,7 @@ static PyObject *__pyx_f_6healpy_9_sphtools_mkmask(PyArrayObject *__pyx_v_m, CYT __pyx_t_3 = ((fabs(((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_m.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_m.diminfo[0].strides)) - __pyx_v_6healpy_9_sphtools_UNSEEN)) < __pyx_v_6healpy_9_sphtools_rtol_UNSEEN) != 0); if (__pyx_t_3) { - /* "healpy/src/_sphtools.pyx":590 + /* "healpy/src/_sphtools.pyx":597 * for i in range(size): * if fabs(m[i] - UNSEEN) < rtol_UNSEEN: * mask[i] = 1 # <<<<<<<<<<<<<< @@ -8457,7 +9209,7 @@ static PyObject *__pyx_f_6healpy_9_sphtools_mkmask(PyArrayObject *__pyx_v_m, CYT __pyx_t_14 = __pyx_v_i; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_mask.diminfo[0].strides) = 1; - /* "healpy/src/_sphtools.pyx":589 + /* "healpy/src/_sphtools.pyx":596 * #m_ = m * for i in range(size): * if fabs(m[i] - UNSEEN) < rtol_UNSEEN: # <<<<<<<<<<<<<< @@ -8468,16 +9220,16 @@ static PyObject *__pyx_f_6healpy_9_sphtools_mkmask(PyArrayObject *__pyx_v_m, CYT } } - /* "healpy/src/_sphtools.pyx":591 + /* "healpy/src/_sphtools.pyx":598 * if fabs(m[i] - UNSEEN) < rtol_UNSEEN: * mask[i] = 1 * mask.dtype = bool # <<<<<<<<<<<<<< * return mask * */ - if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 591, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_dtype, ((PyObject*)&PyBool_Type)) < 0) __PYX_ERR(0, 598, __pyx_L1_error) - /* "healpy/src/_sphtools.pyx":592 + /* "healpy/src/_sphtools.pyx":599 * mask[i] = 1 * mask.dtype = bool * return mask # <<<<<<<<<<<<<< @@ -8489,7 +9241,7 @@ static PyObject *__pyx_f_6healpy_9_sphtools_mkmask(PyArrayObject *__pyx_v_m, CYT __pyx_r = ((PyObject *)__pyx_v_mask); goto __pyx_L0; - /* "healpy/src/_sphtools.pyx":575 + /* "healpy/src/_sphtools.pyx":582 * @cython.wraparound(False) * @cython.boundscheck(False) * cpdef mkmask(np.ndarray[double, ndim=1] m): # <<<<<<<<<<<<<< @@ -8531,7 +9283,7 @@ static PyObject *__pyx_pw_6healpy_9_sphtools_17mkmask(PyObject *__pyx_self, PyOb PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mkmask (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5numpy_ndarray, 1, "m", 0))) __PYX_ERR(0, 575, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5numpy_ndarray, 1, "m", 0))) __PYX_ERR(0, 582, __pyx_L1_error) __pyx_r = __pyx_pf_6healpy_9_sphtools_16mkmask(__pyx_self, ((PyArrayObject *)__pyx_v_m)); /* function exit code */ @@ -8556,11 +9308,11 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_16mkmask(CYTHON_UNUSED PyObject *__ __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 575, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 582, __pyx_L1_error) } __pyx_pybuffernd_m.diminfo[0].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m.diminfo[0].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[0]; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6healpy_9_sphtools_mkmask(__pyx_v_m, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6healpy_9_sphtools_mkmask(__pyx_v_m, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -8586,7 +9338,7 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_16mkmask(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "healpy/src/_sphtools.pyx":596 +/* "healpy/src/_sphtools.pyx":603 * @cython.wraparound(False) * @cython.boundscheck(False) * cpdef int count_bad(np.ndarray[double, ndim=1] m): # <<<<<<<<<<<<<< @@ -8615,11 +9367,11 @@ static int __pyx_f_6healpy_9_sphtools_count_bad(PyArrayObject *__pyx_v_m, CYTHON __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 596, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 603, __pyx_L1_error) } __pyx_pybuffernd_m.diminfo[0].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m.diminfo[0].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[0]; - /* "healpy/src/_sphtools.pyx":598 + /* "healpy/src/_sphtools.pyx":605 * cpdef int count_bad(np.ndarray[double, ndim=1] m): * cdef int i * cdef int nbad = 0 # <<<<<<<<<<<<<< @@ -8628,33 +9380,33 @@ static int __pyx_f_6healpy_9_sphtools_count_bad(PyArrayObject *__pyx_v_m, CYTHON */ __pyx_v_nbad = 0; - /* "healpy/src/_sphtools.pyx":599 + /* "healpy/src/_sphtools.pyx":606 * cdef int i * cdef int nbad = 0 * cdef size = m.size # <<<<<<<<<<<<<< * for i in xrange(m.size): * if fabs(m[i] - UNSEEN) < rtol_UNSEEN: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_m), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_m), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_size = __pyx_t_1; __pyx_t_1 = 0; - /* "healpy/src/_sphtools.pyx":600 + /* "healpy/src/_sphtools.pyx":607 * cdef int nbad = 0 * cdef size = m.size * for i in xrange(m.size): # <<<<<<<<<<<<<< * if fabs(m[i] - UNSEEN) < rtol_UNSEEN: * nbad += 1 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_m), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_m), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "healpy/src/_sphtools.pyx":601 + /* "healpy/src/_sphtools.pyx":608 * cdef size = m.size * for i in xrange(m.size): * if fabs(m[i] - UNSEEN) < rtol_UNSEEN: # <<<<<<<<<<<<<< @@ -8665,7 +9417,7 @@ static int __pyx_f_6healpy_9_sphtools_count_bad(PyArrayObject *__pyx_v_m, CYTHON __pyx_t_5 = ((fabs(((*__Pyx_BufPtrStrided1d(double *, __pyx_pybuffernd_m.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_m.diminfo[0].strides)) - __pyx_v_6healpy_9_sphtools_UNSEEN)) < __pyx_v_6healpy_9_sphtools_rtol_UNSEEN) != 0); if (__pyx_t_5) { - /* "healpy/src/_sphtools.pyx":602 + /* "healpy/src/_sphtools.pyx":609 * for i in xrange(m.size): * if fabs(m[i] - UNSEEN) < rtol_UNSEEN: * nbad += 1 # <<<<<<<<<<<<<< @@ -8673,7 +9425,7 @@ static int __pyx_f_6healpy_9_sphtools_count_bad(PyArrayObject *__pyx_v_m, CYTHON */ __pyx_v_nbad = (__pyx_v_nbad + 1); - /* "healpy/src/_sphtools.pyx":601 + /* "healpy/src/_sphtools.pyx":608 * cdef size = m.size * for i in xrange(m.size): * if fabs(m[i] - UNSEEN) < rtol_UNSEEN: # <<<<<<<<<<<<<< @@ -8683,7 +9435,7 @@ static int __pyx_f_6healpy_9_sphtools_count_bad(PyArrayObject *__pyx_v_m, CYTHON } } - /* "healpy/src/_sphtools.pyx":603 + /* "healpy/src/_sphtools.pyx":610 * if fabs(m[i] - UNSEEN) < rtol_UNSEEN: * nbad += 1 * return nbad # <<<<<<<<<<<<<< @@ -8691,7 +9443,7 @@ static int __pyx_f_6healpy_9_sphtools_count_bad(PyArrayObject *__pyx_v_m, CYTHON __pyx_r = __pyx_v_nbad; goto __pyx_L0; - /* "healpy/src/_sphtools.pyx":596 + /* "healpy/src/_sphtools.pyx":603 * @cython.wraparound(False) * @cython.boundscheck(False) * cpdef int count_bad(np.ndarray[double, ndim=1] m): # <<<<<<<<<<<<<< @@ -8726,7 +9478,7 @@ static PyObject *__pyx_pw_6healpy_9_sphtools_19count_bad(PyObject *__pyx_self, P PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("count_bad (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5numpy_ndarray, 1, "m", 0))) __PYX_ERR(0, 596, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5numpy_ndarray, 1, "m", 0))) __PYX_ERR(0, 603, __pyx_L1_error) __pyx_r = __pyx_pf_6healpy_9_sphtools_18count_bad(__pyx_self, ((PyArrayObject *)__pyx_v_m)); /* function exit code */ @@ -8751,11 +9503,11 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_18count_bad(CYTHON_UNUSED PyObject __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 596, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 603, __pyx_L1_error) } __pyx_pybuffernd_m.diminfo[0].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m.diminfo[0].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[0]; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_6healpy_9_sphtools_count_bad(__pyx_v_m, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_6healpy_9_sphtools_count_bad(__pyx_v_m, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -8781,272 +9533,41 @@ static PyObject *__pyx_pf_6healpy_9_sphtools_18count_bad(CYTHON_UNUSED PyObject return __pyx_r; } -/* "_common.pxd":124 - * tsize Num_Alms (int l, int m) - * - * cdef inline Healpix_Map[double]* ndarray2map(np.ndarray[np.float64_t, ndim=1, mode='c'] array, Healpix_Ordering_Scheme scheme) except *: # <<<<<<<<<<<<<< - * """ View a contiguous ndarray as a Healpix Map. """ - * # To ensure that the output map is a view of the input array, the latter +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":197 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fullfill the PEP. */ -static CYTHON_INLINE Healpix_Map *__pyx_f_7_common_ndarray2map(PyArrayObject *__pyx_v_array, enum Healpix_Ordering_Scheme __pyx_v_scheme) { - arr *__pyx_v_a; - Healpix_Map *__pyx_v_map; - __Pyx_LocalBuf_ND __pyx_pybuffernd_array; - __Pyx_Buffer __pyx_pybuffer_array; - Healpix_Map *__pyx_r; +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; __Pyx_RefNannyDeclarations - Py_ssize_t __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - size_t __pyx_t_4; - __Pyx_RefNannySetupContext("ndarray2map", 0); - __pyx_pybuffer_array.pybuffer.buf = NULL; - __pyx_pybuffer_array.refcount = 0; - __pyx_pybuffernd_array.data = NULL; - __pyx_pybuffernd_array.rcbuffer = &__pyx_pybuffer_array; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_array.rcbuffer->pybuffer, (PyObject*)__pyx_v_array, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(1, 124, __pyx_L1_error) - } - __pyx_pybuffernd_array.diminfo[0].strides = __pyx_pybuffernd_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_array.diminfo[0].shape = __pyx_pybuffernd_array.rcbuffer->pybuffer.shape[0]; - - /* "_common.pxd":129 - * # is forced to be contiguous, of correct type and dimensions (otherwise, an - * # exception is raised). - * cdef arr[double] *a = new arr[double](&array[0], array.size) # <<<<<<<<<<<<<< - * cdef Healpix_Map[double] *map = new Healpix_Map[double]() - * map.Set(a[0], scheme) - */ - __pyx_t_1 = 0; - __pyx_t_2 = -1; - if (__pyx_t_1 < 0) { - __pyx_t_1 += __pyx_pybuffernd_array.diminfo[0].shape; - if (unlikely(__pyx_t_1 < 0)) __pyx_t_2 = 0; - } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_array.diminfo[0].shape)) __pyx_t_2 = 0; - if (unlikely(__pyx_t_2 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_2); - __PYX_ERR(1, 129, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_array), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 129, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 129, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_a = new arr ((&(*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_array.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_array.diminfo[0].strides))), __pyx_t_4); - - /* "_common.pxd":130 - * # exception is raised). - * cdef arr[double] *a = new arr[double](&array[0], array.size) - * cdef Healpix_Map[double] *map = new Healpix_Map[double]() # <<<<<<<<<<<<<< - * map.Set(a[0], scheme) - * del a # a does not own its buffer, so it won't be deallocated - */ - __pyx_v_map = new Healpix_Map (); - - /* "_common.pxd":131 - * cdef arr[double] *a = new arr[double](&array[0], array.size) - * cdef Healpix_Map[double] *map = new Healpix_Map[double]() - * map.Set(a[0], scheme) # <<<<<<<<<<<<<< - * del a # a does not own its buffer, so it won't be deallocated - * return map - */ - __pyx_v_map->Set((__pyx_v_a[0]), __pyx_v_scheme); - - /* "_common.pxd":132 - * cdef Healpix_Map[double] *map = new Healpix_Map[double]() - * map.Set(a[0], scheme) - * del a # a does not own its buffer, so it won't be deallocated # <<<<<<<<<<<<<< - * return map - * - */ - delete __pyx_v_a; - - /* "_common.pxd":133 - * map.Set(a[0], scheme) - * del a # a does not own its buffer, so it won't be deallocated - * return map # <<<<<<<<<<<<<< - * - * cdef inline Alm[xcomplex[double]]* ndarray2alm(np.ndarray[np.complex128_t, ndim=1, mode='c'] array, int lmax, int mmax) except *: - */ - __pyx_r = __pyx_v_map; - goto __pyx_L0; - - /* "_common.pxd":124 - * tsize Num_Alms (int l, int m) - * - * cdef inline Healpix_Map[double]* ndarray2map(np.ndarray[np.float64_t, ndim=1, mode='c'] array, Healpix_Ordering_Scheme scheme) except *: # <<<<<<<<<<<<<< - * """ View a contiguous ndarray as a Healpix Map. """ - * # To ensure that the output map is a view of the input array, the latter - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_array.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("_common.ndarray2map", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_array.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "_common.pxd":135 - * return map - * - * cdef inline Alm[xcomplex[double]]* ndarray2alm(np.ndarray[np.complex128_t, ndim=1, mode='c'] array, int lmax, int mmax) except *: # <<<<<<<<<<<<<< - * """ View a contiguous ndarray as an Alm. """ - * cdef arr[xcomplex[double]] *a = new arr[xcomplex[double]](&array[0], array.size) - */ - -static CYTHON_INLINE Alm > *__pyx_f_7_common_ndarray2alm(PyArrayObject *__pyx_v_array, int __pyx_v_lmax, int __pyx_v_mmax) { - arr > *__pyx_v_a; - Alm > *__pyx_v_alm; - __Pyx_LocalBuf_ND __pyx_pybuffernd_array; - __Pyx_Buffer __pyx_pybuffer_array; - Alm > *__pyx_r; - __Pyx_RefNannyDeclarations - Py_ssize_t __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - size_t __pyx_t_4; - __Pyx_RefNannySetupContext("ndarray2alm", 0); - __pyx_pybuffer_array.pybuffer.buf = NULL; - __pyx_pybuffer_array.refcount = 0; - __pyx_pybuffernd_array.data = NULL; - __pyx_pybuffernd_array.rcbuffer = &__pyx_pybuffer_array; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_array.rcbuffer->pybuffer, (PyObject*)__pyx_v_array, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(1, 135, __pyx_L1_error) - } - __pyx_pybuffernd_array.diminfo[0].strides = __pyx_pybuffernd_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_array.diminfo[0].shape = __pyx_pybuffernd_array.rcbuffer->pybuffer.shape[0]; - - /* "_common.pxd":137 - * cdef inline Alm[xcomplex[double]]* ndarray2alm(np.ndarray[np.complex128_t, ndim=1, mode='c'] array, int lmax, int mmax) except *: - * """ View a contiguous ndarray as an Alm. """ - * cdef arr[xcomplex[double]] *a = new arr[xcomplex[double]](&array[0], array.size) # <<<<<<<<<<<<<< - * cdef Alm[xcomplex[double]] *alm = new Alm[xcomplex[double]]() - * alm.Set(a[0], lmax, mmax) - */ - __pyx_t_1 = 0; - __pyx_t_2 = -1; - if (__pyx_t_1 < 0) { - __pyx_t_1 += __pyx_pybuffernd_array.diminfo[0].shape; - if (unlikely(__pyx_t_1 < 0)) __pyx_t_2 = 0; - } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_array.diminfo[0].shape)) __pyx_t_2 = 0; - if (unlikely(__pyx_t_2 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_2); - __PYX_ERR(1, 137, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_array), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 137, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_a = new arr > (((xcomplex *)(&(*__Pyx_BufPtrCContig1d(__pyx_t_double_complex *, __pyx_pybuffernd_array.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_array.diminfo[0].strides)))), __pyx_t_4); - - /* "_common.pxd":138 - * """ View a contiguous ndarray as an Alm. """ - * cdef arr[xcomplex[double]] *a = new arr[xcomplex[double]](&array[0], array.size) - * cdef Alm[xcomplex[double]] *alm = new Alm[xcomplex[double]]() # <<<<<<<<<<<<<< - * alm.Set(a[0], lmax, mmax) - * del a - */ - __pyx_v_alm = new Alm > (); - - /* "_common.pxd":139 - * cdef arr[xcomplex[double]] *a = new arr[xcomplex[double]](&array[0], array.size) - * cdef Alm[xcomplex[double]] *alm = new Alm[xcomplex[double]]() - * alm.Set(a[0], lmax, mmax) # <<<<<<<<<<<<<< - * del a - * return alm - */ - __pyx_v_alm->Set((__pyx_v_a[0]), __pyx_v_lmax, __pyx_v_mmax); - - /* "_common.pxd":140 - * cdef Alm[xcomplex[double]] *alm = new Alm[xcomplex[double]]() - * alm.Set(a[0], lmax, mmax) - * del a # <<<<<<<<<<<<<< - * return alm - */ - delete __pyx_v_a; - - /* "_common.pxd":141 - * alm.Set(a[0], lmax, mmax) - * del a - * return alm # <<<<<<<<<<<<<< - */ - __pyx_r = __pyx_v_alm; - goto __pyx_L0; - - /* "_common.pxd":135 - * return map - * - * cdef inline Alm[xcomplex[double]]* ndarray2alm(np.ndarray[np.complex128_t, ndim=1, mode='c'] array, int lmax, int mmax) except *: # <<<<<<<<<<<<<< - * """ View a contiguous ndarray as an Alm. """ - * cdef arr[xcomplex[double]] *a = new arr[xcomplex[double]](&array[0], array.size) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_array.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("_common.ndarray2alm", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_array.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - -/* Python wrapper */ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); - __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_copy_shape; + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_v_hasfields; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; @@ -9059,7 +9580,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_GIVEREF(__pyx_v_info->obj); } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":203 * # of flags * * if info == NULL: return # <<<<<<<<<<<<<< @@ -9072,7 +9593,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L0; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":206 * * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -9081,7 +9602,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":207 * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -9090,7 +9611,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":209 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -9099,7 +9620,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":211 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -9109,7 +9630,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":212 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -9118,7 +9639,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_copy_shape = 1; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":211 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -9128,7 +9649,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L4; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":214 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -9140,7 +9661,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L4:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -9154,7 +9675,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L6_bool_binop_done; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":217 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -9165,7 +9686,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -9174,20 +9695,20 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 218, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 218, __pyx_L1_error) + __PYX_ERR(1, 218, __pyx_L1_error) - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -9196,7 +9717,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -9210,7 +9731,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L9_bool_binop_done; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":221 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -9221,7 +9742,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L9_bool_binop_done:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -9230,20 +9751,20 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< * * info.buf = PyArray_DATA(self) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 222, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 222, __pyx_L1_error) + __PYX_ERR(1, 222, __pyx_L1_error) - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -9252,7 +9773,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":224 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -9261,7 +9782,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":225 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -9270,7 +9791,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":226 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< @@ -9280,7 +9801,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (__pyx_v_copy_shape != 0); if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< @@ -9289,7 +9810,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":230 * # This is allocated as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -9298,7 +9819,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -9309,7 +9830,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":232 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -9318,7 +9839,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -9328,7 +9849,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":226 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< @@ -9338,7 +9859,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L11; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -9348,7 +9869,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":236 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -9359,7 +9880,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L11:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -9368,7 +9889,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":238 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -9377,7 +9898,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":239 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -9386,7 +9907,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -9395,7 +9916,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -9407,7 +9928,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -9416,7 +9937,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -9434,7 +9955,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_L15_bool_binop_done:; if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -9447,7 +9968,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = Py_None; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -9457,7 +9978,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L14; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -9473,7 +9994,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L14:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":255 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -9483,7 +10004,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":256 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -9493,7 +10014,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_4 = __pyx_v_descr->type_num; __pyx_v_t = __pyx_t_4; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -9513,7 +10034,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L20_next_or:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258 * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -9530,7 +10051,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L19_bool_binop_done:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -9539,20 +10060,20 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 259, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 259, __pyx_L1_error) + __PYX_ERR(1, 259, __pyx_L1_error) - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -9561,7 +10082,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -9573,7 +10094,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"b"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -9584,7 +10105,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"B"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":262 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -9595,7 +10116,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"h"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -9606,7 +10127,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"H"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":264 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -9617,7 +10138,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"i"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -9628,7 +10149,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"I"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -9639,7 +10160,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"l"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -9650,7 +10171,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"L"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -9661,7 +10182,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"q"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":269 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -9672,7 +10193,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Q"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -9683,7 +10204,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"f"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -9694,7 +10215,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"d"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -9705,7 +10226,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"g"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -9716,7 +10237,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zf"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -9727,7 +10248,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zd"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -9738,7 +10259,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zg"); break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -9750,33 +10271,33 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * info.format = f * return */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) + __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(2, 278, __pyx_L1_error) + __PYX_ERR(1, 278, __pyx_L1_error) break; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -9785,7 +10306,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -9795,7 +10316,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_r = 0; goto __pyx_L0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":255 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -9804,7 +10325,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -9814,7 +10335,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->format = ((char *)malloc(0xFF)); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 * else: * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -9823,7 +10344,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -9832,17 +10353,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":285 * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< * info.format + _buffer_format_string_len, * &offset) */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 285, __pyx_L1_error) + __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error) __pyx_v_f = __pyx_t_7; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -9852,7 +10373,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":197 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -9884,7 +10405,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":290 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -9908,7 +10429,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":291 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -9918,7 +10439,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -9927,7 +10448,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ free(__pyx_v_info->format); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":291 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -9936,7 +10457,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":293 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -9946,7 +10467,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -9955,7 +10476,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ free(__pyx_v_info->strides); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":293 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -9964,7 +10485,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":290 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -9976,7 +10497,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -9990,7 +10511,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -9998,13 +10519,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ * cdef inline object PyArray_MultiIterNew2(a, b): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 771, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -10023,7 +10544,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -10037,7 +10558,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":774 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -10045,13 +10566,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ * cdef inline object PyArray_MultiIterNew3(a, b, c): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 774, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -10070,7 +10591,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -10084,7 +10605,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":777 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -10092,13 +10613,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 777, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -10117,7 +10638,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -10131,7 +10652,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":780 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -10139,13 +10660,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 780, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -10164,7 +10685,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -10178,7 +10699,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":783 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -10186,13 +10707,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 783, __pyx_L1_error) + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -10211,7 +10732,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -10240,7 +10761,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx char *__pyx_t_9; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * * cdef dtype child * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -10249,7 +10770,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 * cdef dtype child * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -10258,7 +10779,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -10267,21 +10788,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_v_descr->names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(2, 794, __pyx_L1_error) + __PYX_ERR(1, 794, __pyx_L1_error) } __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(2, 794, __pyx_L1_error) + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 794, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); __pyx_t_3 = 0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":795 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -10290,15 +10811,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_v_descr->fields == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(2, 795, __pyx_L1_error) + __PYX_ERR(1, 795, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 795, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 795, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -10307,7 +10828,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (likely(__pyx_v_fields != Py_None)) { PyObject* sequence = __pyx_v_fields; - #if CYTHON_COMPILING_IN_CPYTHON + #if !CYTHON_COMPILING_IN_PYPY Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); @@ -10315,59 +10836,59 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(2, 796, __pyx_L1_error) + __PYX_ERR(1, 796, __pyx_L1_error) } - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 796, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 796, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 796, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error) } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 796, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * */ - __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 798, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 798, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 798, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (__pyx_t_6) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":799 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 799, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 799, __pyx_L1_error) + __PYX_ERR(1, 799, __pyx_L1_error) - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -10376,7 +10897,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -10396,7 +10917,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L8_next_or:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -10413,7 +10934,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = __pyx_t_7; __pyx_L7_bool_binop_done:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -10422,20 +10943,20 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (__pyx_t_6) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 803, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 803, __pyx_L1_error) + __PYX_ERR(1, 803, __pyx_L1_error) - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -10444,7 +10965,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -10452,15 +10973,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * f += 1 */ while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 813, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 813, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 813, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -10469,7 +10990,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 0x78; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":815 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -10478,7 +10999,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":816 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -10489,7 +11010,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":818 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -10499,7 +11020,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_8 = 0; (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":820 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -10509,19 +11030,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); if (__pyx_t_6) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 821, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -10531,20 +11052,20 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); if (__pyx_t_6) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 823, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(2, 823, __pyx_L1_error) + __PYX_ERR(1, 823, __pyx_L1_error) - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -10553,252 +11074,252 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 826, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 826, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 826, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 827, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 827, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 827, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":828 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 828, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 828, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 828, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x68; goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 829, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 829, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 829, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 830, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 830, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 830, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x69; goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 831, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 831, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 831, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 832, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 832, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 832, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x6C; goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 833, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 833, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 833, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 834, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 834, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 834, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x71; goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":835 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 835, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 835, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 835, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 836, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 836, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 836, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x66; goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 837, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 837, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 837, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x64; goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 838, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 838, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 838, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x67; goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 839, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 839, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 839, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -10807,18 +11328,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 840, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 840, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 840, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -10827,18 +11348,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 841, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 841, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 841, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -10847,25 +11368,25 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 842, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 842, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 842, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; goto __pyx_L15; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -10873,23 +11394,23 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * else: */ /*else*/ { - __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error) + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 844, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(2, 844, __pyx_L1_error) + __PYX_ERR(1, 844, __pyx_L1_error) } __pyx_L15:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -10898,7 +11419,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":820 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -10908,7 +11429,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L13; } - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":849 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< @@ -10916,12 +11437,12 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * */ /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(2, 849, __pyx_L1_error) + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error) __pyx_v_f = __pyx_t_9; } __pyx_L13:; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -10931,7 +11452,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -10941,7 +11462,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -10966,7 +11487,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":966 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -10981,7 +11502,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a int __pyx_t_2; __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":968 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -10992,7 +11513,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":969 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -11001,135 +11522,758 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_baseptr = NULL; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":968 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + goto __pyx_L3; + } + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":971 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) + */ + /*else*/ { + Py_INCREF(__pyx_v_base); + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":972 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr + */ + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":973 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr + * + */ + Py_XDECREF(__pyx_v_arr->base); + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":974 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":966 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":978 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_None); + __pyx_r = Py_None; + goto __pyx_L0; + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + } + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":980 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":976 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_array", 0); + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * cdef inline int import_array() except -1: + * try: + * _import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") + */ + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error) + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * try: + * _import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 989, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":986 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L10_try_end:; + } + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_umath", 0); + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":993 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error) + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":994 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 995, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":992 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L10_try_end:; + } + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_ufunc", 0); + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":999 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error) + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L10_try_end; + __pyx_L3_error:; + __Pyx_PyThreadState_assign + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 1001, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_PyThreadState_assign + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L10_try_end:; + } + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "_common.pxd":124 + * tsize Num_Alms (int l, int m) + * + * cdef inline Healpix_Map[double]* ndarray2map(np.ndarray[np.float64_t, ndim=1, mode='c'] array, Healpix_Ordering_Scheme scheme) except *: # <<<<<<<<<<<<<< + * """ View a contiguous ndarray as a Healpix Map. """ + * # To ensure that the output map is a view of the input array, the latter + */ + +static CYTHON_INLINE Healpix_Map *__pyx_f_7_common_ndarray2map(PyArrayObject *__pyx_v_array, enum Healpix_Ordering_Scheme __pyx_v_scheme) { + arr *__pyx_v_a; + Healpix_Map *__pyx_v_map; + __Pyx_LocalBuf_ND __pyx_pybuffernd_array; + __Pyx_Buffer __pyx_pybuffer_array; + Healpix_Map *__pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __pyx_t_7_common_tsize __pyx_t_4; + __Pyx_RefNannySetupContext("ndarray2map", 0); + __pyx_pybuffer_array.pybuffer.buf = NULL; + __pyx_pybuffer_array.refcount = 0; + __pyx_pybuffernd_array.data = NULL; + __pyx_pybuffernd_array.rcbuffer = &__pyx_pybuffer_array; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_array.rcbuffer->pybuffer, (PyObject*)__pyx_v_array, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(2, 124, __pyx_L1_error) + } + __pyx_pybuffernd_array.diminfo[0].strides = __pyx_pybuffernd_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_array.diminfo[0].shape = __pyx_pybuffernd_array.rcbuffer->pybuffer.shape[0]; + + /* "_common.pxd":129 + * # is forced to be contiguous, of correct type and dimensions (otherwise, an + * # exception is raised). + * cdef arr[double] *a = new arr[double](&array[0], array.size) # <<<<<<<<<<<<<< + * cdef Healpix_Map[double] *map = new Healpix_Map[double]() + * map.Set(a[0], scheme) */ - goto __pyx_L3; + __pyx_t_1 = 0; + __pyx_t_2 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_array.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_2 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_array.diminfo[0].shape)) __pyx_t_2 = 0; + if (unlikely(__pyx_t_2 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_2); + __PYX_ERR(2, 129, __pyx_L1_error) } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_array), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 129, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_a = new arr ((&(*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_array.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_array.diminfo[0].strides))), __pyx_t_4); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 - * baseptr = NULL - * else: - * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< - * baseptr = base - * Py_XDECREF(arr.base) + /* "_common.pxd":130 + * # exception is raised). + * cdef arr[double] *a = new arr[double](&array[0], array.size) + * cdef Healpix_Map[double] *map = new Healpix_Map[double]() # <<<<<<<<<<<<<< + * map.Set(a[0], scheme) + * del a # a does not own its buffer, so it won't be deallocated */ - /*else*/ { - Py_INCREF(__pyx_v_base); + __pyx_v_map = new Healpix_Map (); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 - * else: - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base # <<<<<<<<<<<<<< - * Py_XDECREF(arr.base) - * arr.base = baseptr + /* "_common.pxd":131 + * cdef arr[double] *a = new arr[double](&array[0], array.size) + * cdef Healpix_Map[double] *map = new Healpix_Map[double]() + * map.Set(a[0], scheme) # <<<<<<<<<<<<<< + * del a # a does not own its buffer, so it won't be deallocated + * return map */ - __pyx_v_baseptr = ((PyObject *)__pyx_v_base); - } - __pyx_L3:; + __pyx_v_map->Set((__pyx_v_a[0]), __pyx_v_scheme); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base - * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< - * arr.base = baseptr + /* "_common.pxd":132 + * cdef Healpix_Map[double] *map = new Healpix_Map[double]() + * map.Set(a[0], scheme) + * del a # a does not own its buffer, so it won't be deallocated # <<<<<<<<<<<<<< + * return map * */ - Py_XDECREF(__pyx_v_arr->base); + delete __pyx_v_a; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 - * baseptr = base - * Py_XDECREF(arr.base) - * arr.base = baseptr # <<<<<<<<<<<<<< + /* "_common.pxd":133 + * map.Set(a[0], scheme) + * del a # a does not own its buffer, so it won't be deallocated + * return map # <<<<<<<<<<<<<< * - * cdef inline object get_array_base(ndarray arr): + * cdef inline Alm[xcomplex[double]]* ndarray2alm(np.ndarray[np.complex128_t, ndim=1, mode='c'] array, int lmax, int mmax) except *: */ - __pyx_v_arr->base = __pyx_v_baseptr; + __pyx_r = __pyx_v_map; + goto __pyx_L0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * + /* "_common.pxd":124 + * tsize Num_Alms (int l, int m) * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: + * cdef inline Healpix_Map[double]* ndarray2map(np.ndarray[np.float64_t, ndim=1, mode='c'] array, Healpix_Ordering_Scheme scheme) except *: # <<<<<<<<<<<<<< + * """ View a contiguous ndarray as a Healpix Map. """ + * # To ensure that the output map is a view of the input array, the latter */ /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_array.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("_common.ndarray2map", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_array.rcbuffer->pybuffer); + __pyx_L2:; __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr +/* "_common.pxd":135 + * return map * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * cdef inline Alm[xcomplex[double]]* ndarray2alm(np.ndarray[np.complex128_t, ndim=1, mode='c'] array, int lmax, int mmax) except *: # <<<<<<<<<<<<<< + * """ View a contiguous ndarray as an Alm. """ + * cdef arr[xcomplex[double]] *a = new arr[xcomplex[double]](&array[0], array.size) */ -static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { - PyObject *__pyx_r = NULL; +static CYTHON_INLINE Alm > *__pyx_f_7_common_ndarray2alm(PyArrayObject *__pyx_v_array, int __pyx_v_lmax, int __pyx_v_mmax) { + arr > *__pyx_v_a; + Alm > *__pyx_v_alm; + __Pyx_LocalBuf_ND __pyx_pybuffernd_array; + __Pyx_Buffer __pyx_pybuffer_array; + Alm > *__pyx_r; __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("get_array_base", 0); + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __pyx_t_7_common_tsize __pyx_t_4; + __Pyx_RefNannySetupContext("ndarray2alm", 0); + __pyx_pybuffer_array.pybuffer.buf = NULL; + __pyx_pybuffer_array.refcount = 0; + __pyx_pybuffernd_array.data = NULL; + __pyx_pybuffernd_array.rcbuffer = &__pyx_pybuffer_array; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_array.rcbuffer->pybuffer, (PyObject*)__pyx_v_array, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(2, 135, __pyx_L1_error) + } + __pyx_pybuffernd_array.diminfo[0].strides = __pyx_pybuffernd_array.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_array.diminfo[0].shape = __pyx_pybuffernd_array.rcbuffer->pybuffer.shape[0]; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: + /* "_common.pxd":137 + * cdef inline Alm[xcomplex[double]]* ndarray2alm(np.ndarray[np.complex128_t, ndim=1, mode='c'] array, int lmax, int mmax) except *: + * """ View a contiguous ndarray as an Alm. """ + * cdef arr[xcomplex[double]] *a = new arr[xcomplex[double]](&array[0], array.size) # <<<<<<<<<<<<<< + * cdef Alm[xcomplex[double]] *alm = new Alm[xcomplex[double]]() + * alm.Set(a[0], lmax, mmax) */ - __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); - if (__pyx_t_1) { + __pyx_t_1 = 0; + __pyx_t_2 = -1; + if (__pyx_t_1 < 0) { + __pyx_t_1 += __pyx_pybuffernd_array.diminfo[0].shape; + if (unlikely(__pyx_t_1 < 0)) __pyx_t_2 = 0; + } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_array.diminfo[0].shape)) __pyx_t_2 = 0; + if (unlikely(__pyx_t_2 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_2); + __PYX_ERR(2, 137, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_array), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 137, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_a = new arr > (((xcomplex *)(&(*__Pyx_BufPtrCContig1d(__pyx_t_double_complex *, __pyx_pybuffernd_array.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_array.diminfo[0].strides)))), __pyx_t_4); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: - * return None # <<<<<<<<<<<<<< - * else: - * return arr.base + /* "_common.pxd":138 + * """ View a contiguous ndarray as an Alm. """ + * cdef arr[xcomplex[double]] *a = new arr[xcomplex[double]](&array[0], array.size) + * cdef Alm[xcomplex[double]] *alm = new Alm[xcomplex[double]]() # <<<<<<<<<<<<<< + * alm.Set(a[0], lmax, mmax) + * del a */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; + __pyx_v_alm = new Alm > (); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: + /* "_common.pxd":139 + * cdef arr[xcomplex[double]] *a = new arr[xcomplex[double]](&array[0], array.size) + * cdef Alm[xcomplex[double]] *alm = new Alm[xcomplex[double]]() + * alm.Set(a[0], lmax, mmax) # <<<<<<<<<<<<<< + * del a + * return alm */ - } + __pyx_v_alm->Set((__pyx_v_a[0]), __pyx_v_lmax, __pyx_v_mmax); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 - * return None - * else: - * return arr.base # <<<<<<<<<<<<<< + /* "_common.pxd":140 + * cdef Alm[xcomplex[double]] *alm = new Alm[xcomplex[double]]() + * alm.Set(a[0], lmax, mmax) + * del a # <<<<<<<<<<<<<< + * return alm */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); - __pyx_r = ((PyObject *)__pyx_v_arr->base); - goto __pyx_L0; - } + delete __pyx_v_a; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr + /* "_common.pxd":141 + * alm.Set(a[0], lmax, mmax) + * del a + * return alm # <<<<<<<<<<<<<< + */ + __pyx_r = __pyx_v_alm; + goto __pyx_L0; + + /* "_common.pxd":135 + * return map * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * cdef inline Alm[xcomplex[double]]* ndarray2alm(np.ndarray[np.complex128_t, ndim=1, mode='c'] array, int lmax, int mmax) except *: # <<<<<<<<<<<<<< + * """ View a contiguous ndarray as an Alm. """ + * cdef arr[xcomplex[double]] *a = new arr[xcomplex[double]](&array[0], array.size) */ /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_array.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("_common.ndarray2alm", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + goto __pyx_L2; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_array.rcbuffer->pybuffer); + __pyx_L2:; __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -11164,10 +12308,12 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_AC, __pyx_k_AC, sizeof(__pyx_k_AC), 0, 0, 1, 1}, {&__pyx_n_s_AG, __pyx_k_AG, sizeof(__pyx_k_AG), 0, 0, 1, 1}, {&__pyx_n_s_AI, __pyx_k_AI, sizeof(__pyx_k_AI), 0, 0, 1, 1}, + {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1}, {&__pyx_n_s_DATAPATH, __pyx_k_DATAPATH, sizeof(__pyx_k_DATAPATH), 0, 0, 1, 1}, {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1}, + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_kp_s_Input_maps_must_have_same_size, __pyx_k_Input_maps_must_have_same_size, sizeof(__pyx_k_Input_maps_must_have_same_size), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_input, __pyx_k_Invalid_input, sizeof(__pyx_k_Invalid_input), 0, 0, 1, 0}, {&__pyx_n_s_M1, __pyx_k_M1, sizeof(__pyx_k_M1), 0, 0, 1, 1}, @@ -11179,10 +12325,12 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_Nspec, __pyx_k_Nspec, sizeof(__pyx_k_Nspec), 0, 0, 1, 1}, {&__pyx_n_s_Nspec2, __pyx_k_Nspec2, sizeof(__pyx_k_Nspec2), 0, 0, 1, 1}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_kp_s_UTF_8, __pyx_k_UTF_8, sizeof(__pyx_k_UTF_8), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_kp_s_Weight_file_not_found_in_s, __pyx_k_Weight_file_not_found_in_s, sizeof(__pyx_k_Weight_file_not_found_in_s), 0, 0, 1, 0}, {&__pyx_kp_s_Wrong_input_map_must_be_a_valid, __pyx_k_Wrong_input_map_must_be_a_valid, sizeof(__pyx_k_Wrong_input_map_must_be_a_valid), 0, 0, 1, 0}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, + {&__pyx_n_s_abs, __pyx_k_abs, sizeof(__pyx_k_abs), 0, 0, 1, 1}, {&__pyx_n_s_abspath, __pyx_k_abspath, sizeof(__pyx_k_abspath), 0, 0, 1, 1}, {&__pyx_n_s_ac, __pyx_k_ac, sizeof(__pyx_k_ac), 0, 0, 1, 1}, {&__pyx_n_s_ag, __pyx_k_ag, sizeof(__pyx_k_ag), 0, 0, 1, 1}, @@ -11208,22 +12356,28 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_almsize, __pyx_k_almsize, sizeof(__pyx_k_almsize), 0, 0, 1, 1}, {&__pyx_n_s_almxfl, __pyx_k_almxfl, sizeof(__pyx_k_almxfl), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, + {&__pyx_n_s_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 0, 0, 1, 1}, {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1}, {&__pyx_n_s_ascontiguousarray, __pyx_k_ascontiguousarray, sizeof(__pyx_k_ascontiguousarray), 0, 0, 1, 1}, + {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1}, + {&__pyx_n_s_bdatapath, __pyx_k_bdatapath, sizeof(__pyx_k_bdatapath), 0, 0, 1, 1}, {&__pyx_n_s_c_datapath, __pyx_k_c_datapath, sizeof(__pyx_k_c_datapath), 0, 0, 1, 1}, {&__pyx_n_s_complex128, __pyx_k_complex128, sizeof(__pyx_k_complex128), 0, 0, 1, 1}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_datapath, __pyx_k_datapath, sizeof(__pyx_k_datapath), 0, 0, 1, 1}, + {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, {&__pyx_n_s_dirname, __pyx_k_dirname, sizeof(__pyx_k_dirname), 0, 0, 1, 1}, {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, {&__pyx_n_s_fl, __pyx_k_fl, sizeof(__pyx_k_fl), 0, 0, 1, 1}, {&__pyx_n_s_fl_2, __pyx_k_fl_2, sizeof(__pyx_k_fl_2), 0, 0, 1, 1}, {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, {&__pyx_n_s_flsize, __pyx_k_flsize, sizeof(__pyx_k_flsize), 0, 0, 1, 1}, + {&__pyx_n_s_gal_cut, __pyx_k_gal_cut, sizeof(__pyx_k_gal_cut), 0, 0, 1, 1}, {&__pyx_n_s_get_datapath, __pyx_k_get_datapath, sizeof(__pyx_k_get_datapath), 0, 0, 1, 1}, {&__pyx_n_s_healpy, __pyx_k_healpy, sizeof(__pyx_k_healpy), 0, 0, 1, 1}, {&__pyx_n_s_healpy__sphtools, __pyx_k_healpy__sphtools, sizeof(__pyx_k_healpy__sphtools), 0, 0, 1, 1}, @@ -11244,6 +12398,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_lmax_2, __pyx_k_lmax_2, sizeof(__pyx_k_lmax_2), 0, 0, 1, 1}, {&__pyx_n_s_lmax_out, __pyx_k_lmax_out, sizeof(__pyx_k_lmax_out), 0, 0, 1, 1}, {&__pyx_n_s_lmax_out_2, __pyx_k_lmax_out_2, sizeof(__pyx_k_lmax_out_2), 0, 0, 1, 1}, + {&__pyx_n_s_lonlat, __pyx_k_lonlat, sizeof(__pyx_k_lonlat), 0, 0, 1, 1}, {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_map2alm, __pyx_k_map2alm, sizeof(__pyx_k_map2alm), 0, 0, 1, 1}, @@ -11252,9 +12407,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_maps_c, __pyx_k_maps_c, sizeof(__pyx_k_maps_c), 0, 0, 1, 1}, {&__pyx_n_s_maptype, __pyx_k_maptype, sizeof(__pyx_k_maptype), 0, 0, 1, 1}, {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1}, - {&__pyx_n_s_mask_mi, __pyx_k_mask_mi, sizeof(__pyx_k_mask_mi), 0, 0, 1, 1}, - {&__pyx_n_s_mask_mq, __pyx_k_mask_mq, sizeof(__pyx_k_mask_mq), 0, 0, 1, 1}, - {&__pyx_n_s_mask_mu, __pyx_k_mask_mu, sizeof(__pyx_k_mask_mu), 0, 0, 1, 1}, + {&__pyx_n_s_mask_gal, __pyx_k_mask_gal, sizeof(__pyx_k_mask_gal), 0, 0, 1, 1}, {&__pyx_n_s_masks, __pyx_k_masks, sizeof(__pyx_k_masks), 0, 0, 1, 1}, {&__pyx_n_s_maxm, __pyx_k_maxm, sizeof(__pyx_k_maxm), 0, 0, 1, 1}, {&__pyx_n_s_mi, __pyx_k_mi, sizeof(__pyx_k_mi), 0, 0, 1, 1}, @@ -11275,9 +12428,13 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_nside, __pyx_k_nside, sizeof(__pyx_k_nside), 0, 0, 1, 1}, {&__pyx_n_s_nside2npix, __pyx_k_nside2npix, sizeof(__pyx_k_nside2npix), 0, 0, 1, 1}, {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0}, + {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0}, + {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1}, {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_phi, __pyx_k_phi, sizeof(__pyx_k_phi), 0, 0, 1, 1}, + {&__pyx_n_s_pix2ang, __pyx_k_pix2ang, sizeof(__pyx_k_pix2ang), 0, 0, 1, 1}, {&__pyx_n_s_polarization, __pyx_k_polarization, sizeof(__pyx_k_polarization), 0, 0, 1, 1}, {&__pyx_n_s_powspec, __pyx_k_powspec, sizeof(__pyx_k_powspec), 0, 0, 1, 1}, {&__pyx_n_s_psi, __pyx_k_psi, sizeof(__pyx_k_psi), 0, 0, 1, 1}, @@ -11302,14 +12459,15 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 99, __pyx_L1_error) __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 106, __pyx_L1_error) - __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 281, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 299, __pyx_L1_error) #if PY_MAJOR_VERSION >= 3 - __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) __PYX_ERR(0, 381, __pyx_L1_error) #else - __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) __PYX_ERR(0, 381, __pyx_L1_error) #endif - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 799, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -11330,159 +12488,212 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "healpy/src/_sphtools.pyx":214 - * mu = np.ascontiguousarray(m[2], dtype=np.float64) + /* "healpy/src/_sphtools.pyx":216 + * mu = m[2].astype(np.float64, order='C', copy=True) * else: * raise ValueError("Wrong input map (must be a valid healpix map " # <<<<<<<<<<<<<< * "or a sequence of 1 or 3 maps)") * */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Wrong_input_map_must_be_a_valid); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Wrong_input_map_must_be_a_valid); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "healpy/src/_sphtools.pyx":240 + /* "healpy/src/_sphtools.pyx":259 * if polarization: * if mq.size != npix or mu.size != npix: * raise ValueError("Input maps must have same size") # <<<<<<<<<<<<<< * * # View the ndarray as a Healpix_Map */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Input_maps_must_have_same_size); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Input_maps_must_have_same_size); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "healpy/src/_sphtools.pyx":348 + /* "healpy/src/_sphtools.pyx":290 + * # For Python3: datapath must be a str, bdatapath must be bytes + * if isinstance(datapath, unicode) : + * bdatapath = datapath.encode('UTF-8') # <<<<<<<<<<<<<< + * else : + * bdatapath = datapath + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_UTF_8); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "healpy/src/_sphtools.pyx":293 + * else : + * bdatapath = datapath + * datapath = datapath.decode('UTF-8') # <<<<<<<<<<<<<< + * c_datapath = bdatapath + * weightfile = 'weight_ring_n%05d.fits' % (nside) + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_UTF_8); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "healpy/src/_sphtools.pyx":355 * cdef int Nspec, Nspec2 * if not hasattr(alms, '__len__'): * raise ValueError('alms must be an array or a sequence of arrays') # <<<<<<<<<<<<<< * if not hasattr(alms[0], '__len__'): * alms_lonely = True */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_alms_must_be_an_array_or_a_seque); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 348, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_alms_must_be_an_array_or_a_seque); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 355, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); - /* "healpy/src/_sphtools.pyx":361 + /* "healpy/src/_sphtools.pyx":368 * * if not hasattr(alms2, '__len__'): * raise ValueError('alms2 must be an array or a sequence of arrays') # <<<<<<<<<<<<<< * if not hasattr(alms2[0], '__len__'): * alms2 = [alms2] - */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_alms2_must_be_an_array_or_a_sequ); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 361, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_alms2_must_be_an_array_or_a_sequ); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 368, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); - /* "healpy/src/_sphtools.pyx":367 + /* "healpy/src/_sphtools.pyx":374 * * if Nspec != Nspec2: * raise ValueError('alms and alms2 must have same number of spectra') # <<<<<<<<<<<<<< * * ############################################## */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_alms_and_alms2_must_have_same_nu); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 367, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_alms_and_alms2_must_have_same_nu); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); - /* "healpy/src/_sphtools.pyx":376 + /* "healpy/src/_sphtools.pyx":383 * for i in xrange(Nspec): * if alms[i].size != almsize or alms2[i].size != almsize: * raise ValueError('all alms must have same size') # <<<<<<<<<<<<<< * * lmax, mmax = alm_getlmmax(alms[0], lmax, mmax) */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_all_alms_must_have_same_size); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_all_alms_must_have_same_size); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); - /* "healpy/src/_sphtools.pyx":505 + /* "healpy/src/_sphtools.pyx":512 * * if not isinstance(alm, (list, tuple, np.ndarray)) or len(alm) == 0: * raise ValueError('Invalid input.') # <<<<<<<<<<<<<< * * # C++ rotate_alm only handles 1 or 3 maps. The function handling 3 maps */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Invalid_input); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 505, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Invalid_input); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); - /* "healpy/src/_sphtools.pyx":532 + /* "healpy/src/_sphtools.pyx":539 * cdef int alm_getn(int l, int m): * if not m <= l: * raise ValueError("mmax must be <= lmax") # <<<<<<<<<<<<<< * return ((m+1)*(m+2))/2 + (m+1)*(l-m) * */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_mmax_must_be_lmax); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 532, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_mmax_must_be_lmax); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< * * info.buf = PyArray_DATA(self) */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":799 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 989, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":995 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "../../../../anaconda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1001 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 1001, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); /* "healpy/src/_sphtools.pyx":54 * DATAPATH = None @@ -11491,7 +12702,7 @@ static int __Pyx_InitCachedConstants(void) { * global DATAPATH * if DATAPATH is None: */ - __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_get_datapath, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_get_datapath, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 54, __pyx_L1_error) /* "healpy/src/_sphtools.pyx":60 * return DATAPATH @@ -11500,10 +12711,10 @@ static int __Pyx_InitCachedConstants(void) { * """Computes the spinned alm of a 2 Healpix maps. * */ - __pyx_tuple__17 = PyTuple_Pack(21, __pyx_n_s_maps, __pyx_n_s_spin, __pyx_n_s_lmax, __pyx_n_s_mmax, __pyx_n_s_maps_c, __pyx_n_s_masks, __pyx_n_s_lmax_2, __pyx_n_s_mmax_2, __pyx_n_s_nside, __pyx_n_s_npix, __pyx_n_s_M1, __pyx_n_s_M2, __pyx_n_s_m, __pyx_n_s_mask, __pyx_n_s_n_alm, __pyx_n_s_alms, __pyx_n_s_A1, __pyx_n_s_A2, __pyx_n_s_w_arr, __pyx_n_s_i, __pyx_n_s_c_datapath); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 60, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); - __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(4, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_map2alm_spin_healpy, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_tuple__22 = PyTuple_Pack(21, __pyx_n_s_maps, __pyx_n_s_spin, __pyx_n_s_lmax, __pyx_n_s_mmax, __pyx_n_s_maps_c, __pyx_n_s_masks, __pyx_n_s_lmax_2, __pyx_n_s_mmax_2, __pyx_n_s_nside, __pyx_n_s_npix, __pyx_n_s_M1, __pyx_n_s_M2, __pyx_n_s_m, __pyx_n_s_mask, __pyx_n_s_n_alm, __pyx_n_s_alms, __pyx_n_s_A1, __pyx_n_s_A2, __pyx_n_s_w_arr, __pyx_n_s_i, __pyx_n_s_c_datapath); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(4, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_map2alm_spin_healpy, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 60, __pyx_L1_error) /* "healpy/src/_sphtools.pyx":136 * return alms @@ -11512,70 +12723,70 @@ static int __Pyx_InitCachedConstants(void) { * """Computes maps from a set of 2 spinned alm * */ - __pyx_tuple__19 = PyTuple_Pack(13, __pyx_n_s_alms, __pyx_n_s_nside, __pyx_n_s_spin, __pyx_n_s_lmax, __pyx_n_s_mmax, __pyx_n_s_alms_c, __pyx_n_s_npix, __pyx_n_s_maps, __pyx_n_s_M1, __pyx_n_s_M2, __pyx_n_s_A1, __pyx_n_s_A2, __pyx_n_s_alm); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 136, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); - __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(5, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_alm2map_spin_healpy, 136, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_tuple__24 = PyTuple_Pack(13, __pyx_n_s_alms, __pyx_n_s_nside, __pyx_n_s_spin, __pyx_n_s_lmax, __pyx_n_s_mmax, __pyx_n_s_alms_c, __pyx_n_s_npix, __pyx_n_s_maps, __pyx_n_s_M1, __pyx_n_s_M2, __pyx_n_s_A1, __pyx_n_s_A2, __pyx_n_s_alm); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(5, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_alm2map_spin_healpy, 136, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 136, __pyx_L1_error) /* "healpy/src/_sphtools.pyx":178 * return maps * * def map2alm(m, lmax = None, mmax = None, niter = 3, use_weights = False, # <<<<<<<<<<<<<< - * datapath = None): + * datapath = None, gal_cut = 0): * """Computes the alm of a Healpix map. */ - __pyx_tuple__21 = PyTuple_Pack(32, __pyx_n_s_m, __pyx_n_s_lmax, __pyx_n_s_mmax, __pyx_n_s_niter, __pyx_n_s_use_weights, __pyx_n_s_datapath, __pyx_n_s_info, __pyx_n_s_polarization, __pyx_n_s_mi, __pyx_n_s_mq, __pyx_n_s_mu, __pyx_n_s_mask_mi, __pyx_n_s_mask_mq, __pyx_n_s_mask_mu, __pyx_n_s_lmax_2, __pyx_n_s_mmax_2, __pyx_n_s_nside, __pyx_n_s_npix, __pyx_n_s_MI, __pyx_n_s_MQ, __pyx_n_s_MU, __pyx_n_s_n_alm, __pyx_n_s_almI, __pyx_n_s_almG, __pyx_n_s_almC, __pyx_n_s_AI, __pyx_n_s_AG, __pyx_n_s_AC, __pyx_n_s_w_arr, __pyx_n_s_i, __pyx_n_s_c_datapath, __pyx_n_s_weightfile); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); - __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(6, 0, 32, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_map2alm, 178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 178, __pyx_L1_error) + __pyx_tuple__26 = PyTuple_Pack(33, __pyx_n_s_m, __pyx_n_s_lmax, __pyx_n_s_mmax, __pyx_n_s_niter, __pyx_n_s_use_weights, __pyx_n_s_datapath, __pyx_n_s_gal_cut, __pyx_n_s_info, __pyx_n_s_polarization, __pyx_n_s_mi, __pyx_n_s_mq, __pyx_n_s_mu, __pyx_n_s_mask, __pyx_n_s_nside, __pyx_n_s_npix, __pyx_n_s_mask_gal, __pyx_n_s_lmax_2, __pyx_n_s_mmax_2, __pyx_n_s_MI, __pyx_n_s_MQ, __pyx_n_s_MU, __pyx_n_s_n_alm, __pyx_n_s_almI, __pyx_n_s_almG, __pyx_n_s_almC, __pyx_n_s_AI, __pyx_n_s_AG, __pyx_n_s_AC, __pyx_n_s_w_arr, __pyx_n_s_i, __pyx_n_s_c_datapath, __pyx_n_s_bdatapath, __pyx_n_s_weightfile); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(7, 0, 33, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_map2alm, 178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 178, __pyx_L1_error) - /* "healpy/src/_sphtools.pyx":311 + /* "healpy/src/_sphtools.pyx":318 * * * def alm2cl(alms, alms2 = None, lmax = None, mmax = None, lmax_out = None): # <<<<<<<<<<<<<< * """Computes (cross-)spectra from alm(s). If alm2 is given, cross-spectra between * alm and alm2 are computed. If alm (and alm2 if provided) contains n alm, */ - __pyx_tuple__23 = PyTuple_Pack(22, __pyx_n_s_alms, __pyx_n_s_alms2, __pyx_n_s_lmax, __pyx_n_s_mmax, __pyx_n_s_lmax_out, __pyx_n_s_Nspec, __pyx_n_s_Nspec2, __pyx_n_s_alms_lonely, __pyx_n_s_almsize, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_l, __pyx_n_s_m, __pyx_n_s_limit, __pyx_n_s_lmax_2, __pyx_n_s_mmax_2, __pyx_n_s_lmax_out_2, __pyx_n_s_powspec, __pyx_n_s_alm1, __pyx_n_s_alm2, __pyx_n_s_spectra, __pyx_n_s_n); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 311, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); - __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(5, 0, 22, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_alm2cl, 311, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_tuple__28 = PyTuple_Pack(22, __pyx_n_s_alms, __pyx_n_s_alms2, __pyx_n_s_lmax, __pyx_n_s_mmax, __pyx_n_s_lmax_out, __pyx_n_s_Nspec, __pyx_n_s_Nspec2, __pyx_n_s_alms_lonely, __pyx_n_s_almsize, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_l, __pyx_n_s_m, __pyx_n_s_limit, __pyx_n_s_lmax_2, __pyx_n_s_mmax_2, __pyx_n_s_lmax_out_2, __pyx_n_s_powspec, __pyx_n_s_alm1, __pyx_n_s_alm2, __pyx_n_s_spectra, __pyx_n_s_n); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 318, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(5, 0, 22, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_alm2cl, 318, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 318, __pyx_L1_error) - /* "healpy/src/_sphtools.pyx":423 + /* "healpy/src/_sphtools.pyx":430 * @cython.wraparound(False) * @cython.boundscheck(False) * def almxfl(alm, fl, mmax = None, inplace = False): # <<<<<<<<<<<<<< * """Multiply an a_lm by a vector b_l. * */ - __pyx_tuple__25 = PyTuple_Pack(14, __pyx_n_s_alm, __pyx_n_s_fl, __pyx_n_s_mmax, __pyx_n_s_inplace, __pyx_n_s_alm_2, __pyx_n_s_fl_2, __pyx_n_s_lmax_2, __pyx_n_s_mmax_2, __pyx_n_s_l, __pyx_n_s_m, __pyx_n_s_f, __pyx_n_s_maxm, __pyx_n_s_i, __pyx_n_s_flsize); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); - __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_almxfl, 423, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_tuple__30 = PyTuple_Pack(14, __pyx_n_s_alm, __pyx_n_s_fl, __pyx_n_s_mmax, __pyx_n_s_inplace, __pyx_n_s_alm_2, __pyx_n_s_fl_2, __pyx_n_s_lmax_2, __pyx_n_s_mmax_2, __pyx_n_s_l, __pyx_n_s_m, __pyx_n_s_f, __pyx_n_s_maxm, __pyx_n_s_i, __pyx_n_s_flsize); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_almxfl, 430, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 430, __pyx_L1_error) - /* "healpy/src/_sphtools.pyx":472 + /* "healpy/src/_sphtools.pyx":479 * * * def rotate_alm(alm not None, double psi, double theta, double phi, lmax=None, # <<<<<<<<<<<<<< * mmax=None): * """ */ - __pyx_tuple__27 = PyTuple_Pack(13, __pyx_n_s_alm, __pyx_n_s_psi, __pyx_n_s_theta, __pyx_n_s_phi, __pyx_n_s_lmax, __pyx_n_s_mmax, __pyx_n_s_a, __pyx_n_s_ai, __pyx_n_s_AI, __pyx_n_s_ag, __pyx_n_s_ac, __pyx_n_s_AG, __pyx_n_s_AC); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 472, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); - __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(6, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_rotate_alm, 472, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_tuple__32 = PyTuple_Pack(13, __pyx_n_s_alm, __pyx_n_s_psi, __pyx_n_s_theta, __pyx_n_s_phi, __pyx_n_s_lmax, __pyx_n_s_mmax, __pyx_n_s_a, __pyx_n_s_ai, __pyx_n_s_AI, __pyx_n_s_ag, __pyx_n_s_ac, __pyx_n_s_AG, __pyx_n_s_AC); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 479, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(6, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_rotate_alm, 479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 479, __pyx_L1_error) - /* "healpy/src/_sphtools.pyx":536 + /* "healpy/src/_sphtools.pyx":543 * * * def alm_getlmmax(a, lmax, mmax): # <<<<<<<<<<<<<< * if lmax is None: * if mmax is None: */ - __pyx_tuple__29 = PyTuple_Pack(3, __pyx_n_s_a, __pyx_n_s_lmax, __pyx_n_s_mmax); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 536, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); - __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_alm_getlmmax, 536, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 536, __pyx_L1_error) + __pyx_tuple__34 = PyTuple_Pack(3, __pyx_n_s_a, __pyx_n_s_lmax, __pyx_n_s_mmax); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_zonca_zonca_p_software_hea, __pyx_n_s_alm_getlmmax, 543, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -11689,11 +12900,11 @@ PyMODINIT_FUNC PyInit__sphtools(void) sizeof(PyHeapTypeObject), #endif 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(3, 9, __pyx_L1_error) - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(2, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(2, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(2, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(2, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(2, 861, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error) /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ @@ -11717,7 +12928,7 @@ PyMODINIT_FUNC PyInit__sphtools(void) * from libc.math cimport sqrt, floor, fabs * cimport libc * from healpy import npix2nside, nside2npix # <<<<<<<<<<<<<< - * from healpy.pixelfunc import maptype + * from healpy.pixelfunc import maptype, pix2ang * import os */ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) @@ -11744,15 +12955,18 @@ PyMODINIT_FUNC PyInit__sphtools(void) /* "healpy/src/_sphtools.pyx":10 * cimport libc * from healpy import npix2nside, nside2npix - * from healpy.pixelfunc import maptype # <<<<<<<<<<<<<< + * from healpy.pixelfunc import maptype, pix2ang # <<<<<<<<<<<<<< * import os * import cython */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_maptype); __Pyx_GIVEREF(__pyx_n_s_maptype); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_maptype); + __Pyx_INCREF(__pyx_n_s_pix2ang); + __Pyx_GIVEREF(__pyx_n_s_pix2ang); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_pix2ang); __pyx_t_1 = __Pyx_Import(__pyx_n_s_healpy_pixelfunc, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11760,11 +12974,15 @@ PyMODINIT_FUNC PyInit__sphtools(void) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_maptype, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_pix2ang); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pix2ang, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "healpy/src/_sphtools.pyx":11 * from healpy import npix2nside, nside2npix - * from healpy.pixelfunc import maptype + * from healpy.pixelfunc import maptype, pix2ang * import os # <<<<<<<<<<<<<< * import cython * from libcpp cimport bool as cbool @@ -11841,7 +13059,7 @@ PyMODINIT_FUNC PyInit__sphtools(void) * return maps * * def map2alm(m, lmax = None, mmax = None, niter = 3, use_weights = False, # <<<<<<<<<<<<<< - * datapath = None): + * datapath = None, gal_cut = 0): * """Computes the alm of a Healpix map. */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6healpy_9_sphtools_7map2alm, NULL, __pyx_n_s_healpy__sphtools); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) @@ -11849,52 +13067,52 @@ PyMODINIT_FUNC PyInit__sphtools(void) if (PyDict_SetItem(__pyx_d, __pyx_n_s_map2alm, __pyx_t_1) < 0) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "healpy/src/_sphtools.pyx":311 + /* "healpy/src/_sphtools.pyx":318 * * * def alm2cl(alms, alms2 = None, lmax = None, mmax = None, lmax_out = None): # <<<<<<<<<<<<<< * """Computes (cross-)spectra from alm(s). If alm2 is given, cross-spectra between * alm and alm2 are computed. If alm (and alm2 if provided) contains n alm, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6healpy_9_sphtools_9alm2cl, NULL, __pyx_n_s_healpy__sphtools); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6healpy_9_sphtools_9alm2cl, NULL, __pyx_n_s_healpy__sphtools); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_alm2cl, __pyx_t_1) < 0) __PYX_ERR(0, 311, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_alm2cl, __pyx_t_1) < 0) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "healpy/src/_sphtools.pyx":423 + /* "healpy/src/_sphtools.pyx":430 * @cython.wraparound(False) * @cython.boundscheck(False) * def almxfl(alm, fl, mmax = None, inplace = False): # <<<<<<<<<<<<<< * """Multiply an a_lm by a vector b_l. * */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6healpy_9_sphtools_11almxfl, NULL, __pyx_n_s_healpy__sphtools); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6healpy_9_sphtools_11almxfl, NULL, __pyx_n_s_healpy__sphtools); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_almxfl, __pyx_t_1) < 0) __PYX_ERR(0, 423, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_almxfl, __pyx_t_1) < 0) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "healpy/src/_sphtools.pyx":472 + /* "healpy/src/_sphtools.pyx":479 * * * def rotate_alm(alm not None, double psi, double theta, double phi, lmax=None, # <<<<<<<<<<<<<< * mmax=None): * """ */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6healpy_9_sphtools_13rotate_alm, NULL, __pyx_n_s_healpy__sphtools); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6healpy_9_sphtools_13rotate_alm, NULL, __pyx_n_s_healpy__sphtools); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotate_alm, __pyx_t_1) < 0) __PYX_ERR(0, 472, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotate_alm, __pyx_t_1) < 0) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "healpy/src/_sphtools.pyx":536 + /* "healpy/src/_sphtools.pyx":543 * * * def alm_getlmmax(a, lmax, mmax): # <<<<<<<<<<<<<< * if lmax is None: * if mmax is None: */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6healpy_9_sphtools_15alm_getlmmax, NULL, __pyx_n_s_healpy__sphtools); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6healpy_9_sphtools_15alm_getlmmax, NULL, __pyx_n_s_healpy__sphtools); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_alm_getlmmax, __pyx_t_1) < 0) __PYX_ERR(0, 536, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_alm_getlmmax, __pyx_t_1) < 0) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "healpy/src/_sphtools.pyx":1 @@ -11907,12 +13125,12 @@ PyMODINIT_FUNC PyInit__sphtools(void) if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../anaconda/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr + /* "_common.pxd":135 + * return map * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * cdef inline Alm[xcomplex[double]]* ndarray2alm(np.ndarray[np.complex128_t, ndim=1, mode='c'] array, int lmax, int mmax) except *: # <<<<<<<<<<<<<< + * """ View a contiguous ndarray as an Alm. """ + * cdef arr[xcomplex[double]] *a = new arr[xcomplex[double]](&array[0], array.size) */ /*--- Wrapped vars code ---*/ @@ -11973,7 +13191,7 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { /* GetModuleGlobalName */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; -#if CYTHON_COMPILING_IN_CPYTHON +#if !CYTHON_AVOID_BORROWED_REFS result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); @@ -11988,6 +13206,144 @@ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { return result; } +/* PyCFunctionFastCall */ + #if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL); +} +#endif // CYTHON_FAST_PYCCALL + +/* PyFunctionFastCall */ + #if CYTHON_FAST_PYCALL +#include "frameobject.h" +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = PyThreadState_GET(); + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = f->f_localsplus; + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif // CPython < 3.6 +#endif // CYTHON_FAST_PYCALL + /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { @@ -12041,6 +13397,11 @@ static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else @@ -12048,6 +13409,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif } } return __Pyx__PyObject_CallOneArg(func, arg); @@ -12229,7 +13594,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); @@ -12244,7 +13609,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); @@ -12259,7 +13624,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { @@ -12300,7 +13665,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, } /* PyErrFetchRestore */ - #if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; @@ -12501,7 +13866,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = PyThreadState_GET(); PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { @@ -12547,7 +13912,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } /* PyIntBinop */ - #if CYTHON_COMPILING_IN_CPYTHON + #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { if (op1 == op2) { Py_RETURN_TRUE; @@ -12563,7 +13928,7 @@ static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED } } #endif - #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a; @@ -12639,6 +14004,11 @@ static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED /* PyObjectCallNoArg */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else @@ -12653,7 +14023,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #endif /* PyIntBinop */ - #if CYTHON_COMPILING_IN_CPYTHON + #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { @@ -12666,12 +14036,14 @@ static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED return PyLong_Type.tp_as_number->nb_add(op1, op2); } #endif - #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; +#ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; +#endif const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { @@ -12683,58 +14055,74 @@ static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; +#ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; +#endif } case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; +#ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; +#endif } case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; +#ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; +#endif } case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; +#ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; +#endif } case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; +#ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; +#endif } case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; +#ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; +#endif } default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } x = a + b; return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG long_long: llx = lla + llb; return PyLong_FromLongLong(llx); +#endif + + } #endif if (PyFloat_CheckExact(op1)) { @@ -13316,15 +14704,29 @@ static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); - if (unlikely(!method)) goto bad; -#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(!method)) goto done; +#if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(method))) { PyObject *self = PyMethod_GET_SELF(method); if (likely(self)) { PyObject *args; PyObject *function = PyMethod_GET_FUNCTION(method); + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {self, arg}; + result = __Pyx_PyFunction_FastCall(function, args, 2); + goto done; + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {self, arg}; + result = __Pyx_PyCFunction_FastCall(function, args, 2); + goto done; + } + #endif args = PyTuple_New(2); - if (unlikely(!args)) goto bad; + if (unlikely(!args)) goto done; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg); @@ -13339,7 +14741,7 @@ static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { } #endif result = __Pyx_PyObject_CallOneArg(method, arg); -bad: +done: Py_XDECREF(method); return result; } @@ -13408,7 +14810,7 @@ static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { } /* PyIntBinop */ - #if CYTHON_COMPILING_IN_CPYTHON + #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op2))) { @@ -13421,12 +14823,14 @@ static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED return PyLong_Type.tp_as_number->nb_add(op1, op2); } #endif - #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op2))) { const long a = intval; long b, x; +#ifdef HAVE_LONG_LONG const PY_LONG_LONG lla = intval; PY_LONG_LONG llb, llx; +#endif const digit* digits = ((PyLongObject*)op2)->ob_digit; const Py_ssize_t size = Py_SIZE(op2); if (likely(__Pyx_sst_abs(size) <= 1)) { @@ -13438,58 +14842,74 @@ static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; +#ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; +#endif } case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; +#ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; +#endif } case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; +#ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; +#endif } case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; +#ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; +#endif } case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; +#ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; +#endif } case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; +#ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; +#endif } default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } x = a + b; return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG long_long: llx = lla + llb; return PyLong_FromLongLong(llx); +#endif + + } #endif if (PyFloat_CheckExact(op2)) { @@ -13537,8 +14957,103 @@ static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, in PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } +/* SaveResetException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { + PyObject *exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + return PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetException */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { +#endif + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; @@ -13612,7 +15127,7 @@ static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, in } /* ImportFrom */ - static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, @@ -13626,7 +15141,7 @@ static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, in } /* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; @@ -13706,7 +15221,7 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { } /* AddTraceback */ - #include "compile.h" + #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( @@ -13779,7 +15294,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; - py_frame->f_lineno = py_line; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); @@ -13807,8 +15322,8 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif - /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + /* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -13816,14 +15331,18 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif } } { @@ -13835,7 +15354,7 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) @@ -13857,7 +15376,7 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -13865,14 +15384,18 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif } } { @@ -13883,8 +15406,8 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } } -/* None */ - #if CYTHON_CCOMPLEX +/* Declarations */ + #if CYTHON_CCOMPLEX #ifdef __cplusplus static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { return ::std::complex< double >(x, y); @@ -13903,61 +15426,86 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } #endif -/* None */ - #if CYTHON_CCOMPLEX +/* Arithmetic */ + #if CYTHON_CCOMPLEX #else - static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { return (a.real == b.real) && (a.imag == b.imag); } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { __pyx_t_double_complex z; z.real = a.real + b.real; z.imag = a.imag + b.imag; return z; } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { __pyx_t_double_complex z; z.real = a.real - b.real; z.imag = a.imag - b.imag; return z; } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { __pyx_t_double_complex z; z.real = a.real * b.real - a.imag * b.imag; z.imag = a.real * b.imag + a.imag * b.real; return z; } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - double denom = b.real * b.real + b.imag * b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; + #if 1 + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabs(b.real) >= fabs(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + double r = b.imag / b.real; + double s = 1.0 / (b.real + b.imag * r); + return __pyx_t_double_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + double r = b.real / b.imag; + double s = 1.0 / (b.imag + b.real * r); + return __pyx_t_double_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + double denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_double_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { + #endif + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) { __pyx_t_double_complex z; z.real = -a.real; z.imag = -a.imag; return z; } - static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) { return (a.real == 0) && (a.imag == 0); } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) { __pyx_t_double_complex z; z.real = a.real; z.imag = -a.imag; return z; } #if 1 - static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) { #if !defined(HAVE_HYPOT) || defined(_MSC_VER) return sqrt(z.real*z.real + z.imag*z.imag); #else return hypot(z.real, z.imag); #endif } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { __pyx_t_double_complex z; double r, lnr, theta, z_r, z_theta; if (b.imag == 0 && b.real == (int)b.real) { @@ -13975,24 +15523,32 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { case 1: return a; case 2: - z = __Pyx_c_prod(a, a); - return __Pyx_c_prod(a, a); + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(a, a); case 3: - z = __Pyx_c_prod(a, a); - return __Pyx_c_prod(z, a); + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, a); case 4: - z = __Pyx_c_prod(a, a); - return __Pyx_c_prod(z, z); + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, z); } } if (a.imag == 0) { if (a.real == 0) { return a; + } else if (b.imag == 0) { + z.real = pow(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2(0, -1); } - r = a.real; - theta = 0; } else { - r = __Pyx_c_abs(a); + r = __Pyx_c_abs_double(a); theta = atan2(a.imag, a.real); } lnr = log(r); @@ -14006,7 +15562,7 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif /* None */ - static CYTHON_INLINE long __Pyx_pow_long(long b, long e) { + static CYTHON_INLINE long __Pyx_pow_long(long b, long e) { long t = b; switch (e) { case 3: @@ -14030,8 +15586,8 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { return t; } -/* None */ - #if CYTHON_CCOMPLEX +/* Declarations */ + #if CYTHON_CCOMPLEX #ifdef __cplusplus static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { return ::std::complex< float >(x, y); @@ -14050,61 +15606,86 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } #endif -/* None */ - #if CYTHON_CCOMPLEX +/* Arithmetic */ + #if CYTHON_CCOMPLEX #else - static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { return (a.real == b.real) && (a.imag == b.imag); } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { __pyx_t_float_complex z; z.real = a.real + b.real; z.imag = a.imag + b.imag; return z; } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { __pyx_t_float_complex z; z.real = a.real - b.real; z.imag = a.imag - b.imag; return z; } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { __pyx_t_float_complex z; z.real = a.real * b.real - a.imag * b.imag; z.imag = a.real * b.imag + a.imag * b.real; return z; } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - float denom = b.real * b.real + b.imag * b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; + #if 1 + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabsf(b.real) >= fabsf(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + float r = b.imag / b.real; + float s = 1.0 / (b.real + b.imag * r); + return __pyx_t_float_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + float r = b.real / b.imag; + float s = 1.0 / (b.imag + b.real * r); + return __pyx_t_float_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + float denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_float_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { + #endif + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) { __pyx_t_float_complex z; z.real = -a.real; z.imag = -a.imag; return z; } - static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) { return (a.real == 0) && (a.imag == 0); } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) { __pyx_t_float_complex z; z.real = a.real; z.imag = -a.imag; return z; } #if 1 - static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) { #if !defined(HAVE_HYPOT) || defined(_MSC_VER) return sqrtf(z.real*z.real + z.imag*z.imag); #else return hypotf(z.real, z.imag); #endif } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { __pyx_t_float_complex z; float r, lnr, theta, z_r, z_theta; if (b.imag == 0 && b.real == (int)b.real) { @@ -14122,24 +15703,32 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { case 1: return a; case 2: - z = __Pyx_c_prodf(a, a); - return __Pyx_c_prodf(a, a); + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(a, a); case 3: - z = __Pyx_c_prodf(a, a); - return __Pyx_c_prodf(z, a); + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, a); case 4: - z = __Pyx_c_prodf(a, a); - return __Pyx_c_prodf(z, z); + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, z); } } if (a.imag == 0) { if (a.real == 0) { return a; + } else if (b.imag == 0) { + z.real = powf(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2f(0, -1); } - r = a.real; - theta = 0; } else { - r = __Pyx_c_absf(a); + r = __Pyx_c_abs_float(a); theta = atan2f(a.imag, a.real); } lnr = logf(r); @@ -14153,7 +15742,7 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { @@ -14161,14 +15750,18 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { return PyInt_FromLong((long) value); } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif } } else { if (sizeof(enum NPY_TYPES) <= sizeof(long)) { return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif } } { @@ -14180,7 +15773,7 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 @@ -14247,8 +15840,10 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif } } else { #if CYTHON_USE_PYLONG_INTERNALS @@ -14315,8 +15910,10 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif } } { @@ -14365,7 +15962,7 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 @@ -14432,8 +16029,10 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif } } else { #if CYTHON_USE_PYLONG_INTERNALS @@ -14500,8 +16099,10 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif } } { @@ -14550,7 +16151,7 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } /* CIntFromPy */ - static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { + static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 @@ -14617,8 +16218,10 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif if (sizeof(size_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif } } else { #if CYTHON_USE_PYLONG_INTERNALS @@ -14685,8 +16288,10 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { #endif if (sizeof(size_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif } } { @@ -14735,7 +16340,7 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } /* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { + static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); @@ -14751,7 +16356,7 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) { } /* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule + #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; @@ -14769,7 +16374,7 @@ static PyObject *__Pyx_ImportModule(const char *name) { #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType + #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) @@ -14834,7 +16439,7 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class #endif /* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { @@ -14935,7 +16540,9 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; +#endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 @@ -14944,8 +16551,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; -#if PY_MAJOR_VERSION < 3 + #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); @@ -14954,11 +16562,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { name = "long"; res = PyNumber_Long(x); } -#else + #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } + #endif +#else + res = PyNumber_Int(x); #endif if (res) { #if PY_MAJOR_VERSION < 3 diff --git a/src/healpy/healpy/src/_sphtools.pyx b/src/healpy/healpy/src/_sphtools.pyx index 10d1f71..9593275 100644 --- a/src/healpy/healpy/src/_sphtools.pyx +++ b/src/healpy/healpy/src/_sphtools.pyx @@ -7,7 +7,7 @@ from libcpp.string cimport string from libc.math cimport sqrt, floor, fabs cimport libc from healpy import npix2nside, nside2npix -from healpy.pixelfunc import maptype +from healpy.pixelfunc import maptype, pix2ang import os import cython from libcpp cimport bool as cbool @@ -29,18 +29,18 @@ cdef extern from "alm_healpix_tools.h": Alm[xcomplex[double]] &almC, int num_iter, arr[double] &weight) - cdef void map2alm_spin( Healpix_Map[double] &map1, + cdef void map2alm_spin( Healpix_Map[double] &map1, Healpix_Map[double] &map2, - Alm[xcomplex[double]] &alm1, - Alm[xcomplex[double]] &alm2, - int spin, - arr[double] &weight, + Alm[xcomplex[double]] &alm1, + Alm[xcomplex[double]] &alm2, + int spin, + arr[double] &weight, cbool add_alm) - cdef void alm2map_spin( Alm[xcomplex[double]] &alm1, - Alm[xcomplex[double]] &alm2, - Healpix_Map[double] &map1, + cdef void alm2map_spin( Alm[xcomplex[double]] &alm1, + Alm[xcomplex[double]] &alm2, + Healpix_Map[double] &map1, Healpix_Map[double] &map2, - int spin) + int spin) cdef extern from "alm_powspec_tools.h": cdef void c_rotate_alm "rotate_alm" (Alm[xcomplex[double]] &alm, double psi, double theta, double phi) @@ -70,7 +70,7 @@ def map2alm_spin_healpy(maps, spin, lmax = None, mmax = None): Maximum l of the power spectrum. Default: 3*nside-1 mmax : int, scalar, optional Maximum m of the alm. Default: lmax - + Returns ------- alms : list of 2 arrays @@ -97,7 +97,7 @@ def map2alm_spin_healpy(maps, spin, lmax = None, mmax = None): # Check all maps have same npix if maps_c[1].size != npix: raise ValueError("Input maps must have same size") - + # View the ndarray as a Healpix_Map M1 = ndarray2map(maps_c[0], RING) M2 = ndarray2map(maps_c[1], RING) @@ -113,17 +113,17 @@ def map2alm_spin_healpy(maps, spin, lmax = None, mmax = None): # View the ndarray as an Alm # Alms = [ndarray2alm(alm, lmax_, mmax_) for alm in alms] - A1 = ndarray2alm(alms[0], lmax_, mmax_) - A2 = ndarray2alm(alms[1], lmax_, mmax_) - + A1 = ndarray2alm(alms[0], lmax_, mmax_) + A2 = ndarray2alm(alms[1], lmax_, mmax_) + # ring weights cdef arr[double] * w_arr = new arr[double]() cdef int i cdef char *c_datapath w_arr.allocAndFill(2 * nside, 1.) - + map2alm_spin(M1[0], M2[0], A1[0], A2[0], spin, w_arr[0], False) - + # restore input map with UNSEEN pixels for m, mask in zip(maps_c, masks): if mask: @@ -141,14 +141,14 @@ def alm2map_spin_healpy(alms, nside, spin, lmax, mmax=None): alms : list of 2 arrays list of 2 alms nside : int - requested nside of the output map + requested nside of the output map spin : int spin of the alms (either 1, 2 or 3) lmax : int, scalar Maximum l of the power spectrum. mmax : int, scalar, optional Maximum m of the alm. Default: lmax - + Returns ------- m : list of 2 arrays @@ -167,22 +167,22 @@ def alm2map_spin_healpy(alms, nside, spin, lmax, mmax=None): mmax = lmax # View the ndarray as an Alm - A1 = ndarray2alm(alms_c[0], lmax, mmax) - A2 = ndarray2alm(alms_c[1], lmax, mmax) - + A1 = ndarray2alm(alms_c[0], lmax, mmax) + A2 = ndarray2alm(alms_c[1], lmax, mmax) + alm2map_spin(A1[0], A2[0], M1[0], M2[0], spin) - + del M1, M2, A1, A2 return maps -def map2alm(m, lmax = None, mmax = None, niter = 3, use_weights = False, - datapath = None): +def map2alm(m, lmax = None, mmax = None, niter = 3, use_weights = False, + datapath = None, gal_cut = 0): """Computes the alm of a Healpix map. Parameters ---------- m : array-like, shape (Npix,) or (3, Npix) - The input map or a list of 3 input maps (polariztion). + The input map or a list of 3 input maps (polarization). lmax : int, scalar, optional Maximum l of the power spectrum. Default: 3*nside-1 mmax : int, scalar, optional @@ -191,7 +191,9 @@ def map2alm(m, lmax = None, mmax = None, niter = 3, use_weights = False, Number of iteration (default: 1) use_weights: bool, scalar, optional If True, use the ring weighting. Default: False. - + gal_cut : float [degrees] + pixels at latitude in [-gal_cut;+gal_cut] are not taken into account + Returns ------- alm : array or tuple of arrays @@ -201,30 +203,47 @@ def map2alm(m, lmax = None, mmax = None, niter = 3, use_weights = False, info = maptype(m) if info == 0: polarization = False - mi = np.ascontiguousarray(m, dtype=np.float64) + mi = m.astype(np.float64, order='C', copy=True) elif info == 1: polarization = False - mi = np.ascontiguousarray(m[0], dtype=np.float64) + mi = m[0].astype(np.float64, order='C', copy=True) elif info == 3: polarization = True - mi = np.ascontiguousarray(m[0], dtype=np.float64) - mq = np.ascontiguousarray(m[1], dtype=np.float64) - mu = np.ascontiguousarray(m[2], dtype=np.float64) + mi = m[0].astype(np.float64, order='C', copy=True) + mq = m[1].astype(np.float64, order='C', copy=True) + mu = m[2].astype(np.float64, order='C', copy=True) else: raise ValueError("Wrong input map (must be a valid healpix map " "or a sequence of 1 or 3 maps)") - # create UNSEEN mask for I map - mask_mi = False if count_bad(mi) == 0 else mkmask(mi) - # same for polarization maps if needed + # replace UNSEEN pixels with zeros + mask = mkmask(mi) + if mask is not False: + mi[mask] = 0 if polarization: - mask_mq = False if count_bad(mq) == 0 else mkmask(mq) - mask_mu = False if count_bad(mu) == 0 else mkmask(mu) - - # Adjust lmax and mmax - cdef int lmax_, mmax_, nside, npix + mask = mkmask(mq) + if mask is not False: + mq[mask] = 0 + mask = mkmask(mu) + if mask is not False: + mu[mask] = 0 + + cdef int nside, npix npix = mi.size nside = npix2nside(npix) + + # Optionally apply a galactic cut + if gal_cut is not None and gal_cut > 0: + mask_gal = pix2ang(nside, np.arange(npix), lonlat=True)[1] + mask_gal = np.abs(mask_gal) < gal_cut + mi[mask_gal] = 0 + if polarization: + mq[mask_gal] = 0 + mu[mask_gal] = 0 + del mask_gal + + # Adjust lmax and mmax + cdef int lmax_, mmax_ if lmax is None: lmax_ = 3 * nside - 1 else: @@ -238,22 +257,13 @@ def map2alm(m, lmax = None, mmax = None, niter = 3, use_weights = False, if polarization: if mq.size != npix or mu.size != npix: raise ValueError("Input maps must have same size") - + # View the ndarray as a Healpix_Map MI = ndarray2map(mi, RING) if polarization: MQ = ndarray2map(mq, RING) MU = ndarray2map(mu, RING) - # replace UNSEEN pixels with zeros - if mask_mi is not False: - mi[mask_mi] = 0.0 - if polarization: - if mask_mq is not False: - mq[mask_mq] = 0.0 - if mask_mu is not False: - mu[mask_mu] = 0.0 - # Create an ndarray object that will contain the alm for output (to be returned) n_alm = alm_getn(lmax_, mmax_) @@ -267,7 +277,7 @@ def map2alm(m, lmax = None, mmax = None, niter = 3, use_weights = False, if polarization: AG = ndarray2alm(almG, lmax_, mmax_) AC = ndarray2alm(almC, lmax_, mmax_) - + # ring weights cdef arr[double] * w_arr = new arr[double]() cdef int i @@ -275,7 +285,13 @@ def map2alm(m, lmax = None, mmax = None, niter = 3, use_weights = False, if use_weights: if datapath is None: datapath = get_datapath() - c_datapath = datapath + # For Python3: datapath must be a str, bdatapath must be bytes + if isinstance(datapath, unicode) : + bdatapath = datapath.encode('UTF-8') + else : + bdatapath = datapath + datapath = datapath.decode('UTF-8') + c_datapath = bdatapath weightfile = 'weight_ring_n%05d.fits' % (nside) if not os.path.isfile(os.path.join(datapath, weightfile)): raise IOError('Weight file not found in %s' % (datapath)) @@ -284,25 +300,16 @@ def map2alm(m, lmax = None, mmax = None, niter = 3, use_weights = False, w_arr[0][i] += 1 else: w_arr.allocAndFill(2 * nside, 1.) - + if polarization: map2alm_pol_iter(MI[0], MQ[0], MU[0], AI[0], AG[0], AC[0], niter, w_arr[0]) else: map2alm_iter(MI[0], AI[0], niter, w_arr[0]) - - # restore input map with UNSEEN pixels - if mask_mi is not False: - mi[mask_mi] = UNSEEN - if polarization: - if mask_mq is not False: - mq[mask_mq] = UNSEEN - if mask_mu is not False: - mu[mask_mu] = UNSEEN - + del w_arr if polarization: del MI, MQ, MU, AI, AG, AC - return almI, almG, almC + return np.array([almI, almG, almC]) else: del MI, AI return almI @@ -333,7 +340,7 @@ def alm2cl(alms, alms2 = None, lmax = None, mmax = None, lmax_out = None): Returns ------- cl : array or tuple of n(n+1)/2 arrays - the spectrum <*alm* x *alm2*> if *alm* (and *alm2*) is one alm, or + the spectrum <*alm* x *alm2*> if *alm* (and *alm2*) is one alm, or the auto- and cross-spectra <*alm*[i] x *alm2*[j]> if alm (and alm2) contains more than one spectra. If more than one spectrum is returned, they are ordered by diagonal. @@ -356,16 +363,16 @@ def alm2cl(alms, alms2 = None, lmax = None, mmax = None, lmax_out = None): if alms2 is None: alms2 = alms - + if not hasattr(alms2, '__len__'): raise ValueError('alms2 must be an array or a sequence of arrays') if not hasattr(alms2[0], '__len__'): alms2 = [alms2] Nspec2 = len(alms2) - + if Nspec != Nspec2: raise ValueError('alms and alms2 must have same number of spectra') - + ############################################## # Check sizes of alm's and lmax/mmax/lmax_out # @@ -410,12 +417,12 @@ def alm2cl(alms, alms2 = None, lmax = None, mmax = None, lmax_out = None): alm1_[j].imag * alm2_[j].imag) powspec_[l] /= (2 * l + 1) spectra.append(powspec_) - + # if only one alm was given, returns only cl and not a list with one cl if alms_lonely: spectra = spectra[0] - return spectra + return np.array(spectra) @cython.wraparound(False) @@ -449,13 +456,13 @@ def almxfl(alm, fl, mmax = None, inplace = False): alm_ = np.ascontiguousarray(alm, dtype = np.complex128) else: alm_ = np.array(alm, dtype = np.complex128, copy = True) - + fl_ = np.ascontiguousarray(fl, dtype = np.complex128) cdef int lmax_, mmax_ cdef int l, m lmax_, mmax_ = alm_getlmmax(alm_, None, mmax) - + cdef np.complex128_t f cdef int maxm, i cdef int flsize = fl_.size @@ -590,7 +597,7 @@ cpdef mkmask(np.ndarray[double, ndim=1] m): mask[i] = 1 mask.dtype = bool return mask - + @cython.wraparound(False) @cython.boundscheck(False) cpdef int count_bad(np.ndarray[double, ndim=1] m): diff --git a/src/healpy/healpy/test/test_doctest_cython.py b/src/healpy/healpy/test/test_doctest_cython.py deleted file mode 100644 index c837557..0000000 --- a/src/healpy/healpy/test/test_doctest_cython.py +++ /dev/null @@ -1,20 +0,0 @@ -import unittest -import doctest -from .. import _query_disc -from .. import _pixelfunc - -# FIXME: I can't get py.test to recognize test suites returned with -# doctest.DocTestSuite. - -class TestDoctestCython(unittest.TestCase): - - def test_query_disc(self): - failed, passed = doctest.testmod(_query_disc) - self.assertEqual(failed, 0) - - def test_pixelfunc(self): - failed, passed = doctest.testmod(_pixelfunc) - self.assertEqual(failed, 0) - -if __name__ == '__main__': - unittest.main() diff --git a/src/healpy/healpy/test/test_fitsfunc.py b/src/healpy/healpy/test/test_fitsfunc.py index 0a608df..e9d4664 100644 --- a/src/healpy/healpy/test/test_fitsfunc.py +++ b/src/healpy/healpy/test/test_fitsfunc.py @@ -46,6 +46,12 @@ def test_read_map_filename(self): write_map(self.filename, self.m) read_map(self.filename) + def test_read_map_filename_with_header(self): + write_map(self.filename, self.m) + m, h = read_map(self.filename, h=True) + header = dict(h) + self.assertEqual(header['NSIDE'], 512) + def test_read_map_hdulist(self): write_map(self.filename, self.m) hdulist = pf.open(self.filename) @@ -57,11 +63,39 @@ def test_read_map_hdu(self): read_map(hdu) def test_read_map_all(self): - write_map(self.filename, [self.m, self.m, self.m]) + write_map(self.filename, [self.m, self.m, self.m], overwrite=True) read_m = read_map(self.filename, None) for rm in read_m: np.testing.assert_array_almost_equal(self.m, rm) + def test_read_map_multiple_dtype(self): + dtypes = [np.int32, np.float32, np.float64] + m = [] + for dtype in dtypes: + m.append(self.m.astype(dtype)) + write_map(self.filename, m, overwrite=True) + read_m = read_map(self.filename, None, dtype=dtypes) + for rm, dtype in zip(read_m, dtypes): + self.assertEqual(rm.dtype, dtype) + + def test_read_map_single_dtype(self): + dtypes = [np.int32, np.float32, np.float64] + m = [] + for dtype in dtypes: + m.append(self.m.astype(dtype)) + write_map(self.filename, m, overwrite=True) + dtype = np.float32 + read_m = read_map(self.filename, None, dtype=dtype) + self.assertEqual(read_m.dtype, dtype) + + def test_read_map_all_with_header(self): + write_map(self.filename, [self.m, self.m, self.m], overwrite=True) + read_m, h = read_map(self.filename, None, h=True) + header = dict(h) + self.assertEqual(header['NSIDE'], 512) + for rm in read_m: + np.testing.assert_array_almost_equal(self.m, rm) + def test_read_write_partial(self): m = self.m.astype(float) m[:11 * self.nside * self.nside] = UNSEEN @@ -92,7 +126,7 @@ def test_read_write_iterable_dtype(self): write_map(self.filename, [self.m, self.m, self.m], dtype=[np.float64, np.float32, np.int32]) - read_m = read_map(self.filename, field=(0, 1, 2), + read_m = read_map(self.filename, field=(0, 1, 2), dtype=[np.float32, np.int32, np.float64]) for rm, dtype in zip(read_m, [np.float32, np.int32, np.float64]): np.testing.assert_almost_equal(dtype(self.m), rm) @@ -169,6 +203,12 @@ def test_read_alm_filename(self): write_alm('testalm_128.fits',self.alms,lmax=128,mmax=128) read_alm('testalm_128.fits') + def test_read_alm_filename_array(self): + write_alm('testalm_256.fits',self.alms,overwrite=True) + testalm1 = np.array(self.alms) + testalm2 = read_alm('testalm_256.fits', [1,2,3]) + np.testing.assert_array_almost_equal(testalm1, testalm2) + def test_read_alm_hdulist(self): write_alm('testalm_128.fits',self.alms,lmax=128,mmax=128) hdulist = pf.open('testalm_128.fits') diff --git a/src/healpy/healpy/test/test_sphtfunc.py b/src/healpy/healpy/test/test_sphtfunc.py index b23d69c..dd3e41b 100644 --- a/src/healpy/healpy/test/test_sphtfunc.py +++ b/src/healpy/healpy/test/test_sphtfunc.py @@ -89,11 +89,9 @@ def test_smoothing_masked(self): smoothed_f90 = hp.ma(hp.read_map(os.path.join(self.path, 'data', 'wmap_band_iqumap_r9_7yr_W_v4_udgraded32_masked_smoothed10deg_fortran.fits'), (0,1,2))) # fortran does not restore the mask - for mm in smoothed_f90: - mm.mask = smoothed[0].mask - for i in range(3): - np.testing.assert_array_almost_equal(smoothed[i].filled(), smoothed_f90[i].filled(), decimal=6) - + smoothed_f90.mask = smoothed.mask + np.testing.assert_array_almost_equal(smoothed.filled(), smoothed_f90.filled(), decimal=6) + def test_gauss_beam(self): idl_gauss_beam = np.array(pf.open(os.path.join(self.path, 'data', 'gaussbeam_10arcmin_lmax512_pol.fits'))[0].data).T gauss_beam = hp.gauss_beam(np.radians(10./60.), lmax=512, pol=True) @@ -110,10 +108,11 @@ def test_map2alm(self): tmp = np.empty(orig.size * 2) tmp[::2] = orig maps = [orig, orig.astype(np.float32), tmp[::2]] - for input in maps: - alm = hp.map2alm(input, iter=10) - output = hp.alm2map(alm, nside) - np.testing.assert_allclose(input, output, atol=1e-4) + for use_weights in [False, True]: + for input in maps: + alm = hp.map2alm(input, iter=10, use_weights=use_weights) + output = hp.alm2map(alm, nside) + np.testing.assert_allclose(input, output, atol=1e-4) def test_map2alm_pol(self): tmp = [np.empty(o.size*2) for o in self.mapiqu] @@ -121,11 +120,34 @@ def test_map2alm_pol(self): t[::2] = o maps = [self.mapiqu, [o.astype(np.float32) for o in self.mapiqu], [t[::2] for t in tmp]] - for input in maps: - alm = hp.map2alm(input, iter=10) - output = hp.alm2map(alm, 32) - for i, o in zip(input, output): - np.testing.assert_allclose(i, o, atol=1e-4) + for use_weights in [False, True]: + for input in maps: + alm = hp.map2alm(input, iter=10, use_weights=use_weights) + output = hp.alm2map(alm, 32) + for i, o in zip(input, output): + np.testing.assert_allclose(i, o, atol=1e-4) + + def test_map2alm_pol_gal_cut(self): + tmp = [np.empty(o.size*2) for o in self.mapiqu] + for t, o in zip(tmp, self.mapiqu): + t[::2] = o + maps = [self.mapiqu, [o.astype(np.float32) for o in self.mapiqu], + [t[::2] for t in tmp]] + for use_weights in [False, True]: + for input in maps: + gal_cut = 30 + nside = hp.get_nside(input) + npix = hp.nside2npix(nside) + gal_mask = np.abs(hp.pix2ang( + nside, np.arange(npix), lonlat=True)[1]) < gal_cut + alm = hp.map2alm( + input, iter=10, use_weights=use_weights, gal_cut=gal_cut) + output = hp.alm2map(alm, 32) + for i, o in zip(input, output): + # Testing requires low tolerances because of the + # mask boundary + i[gal_mask] = 0 + np.testing.assert_allclose(i, o, atol=1e-2) def test_rotate_alm(self): almigc = hp.map2alm(self.mapiqu) @@ -137,6 +159,59 @@ def test_rotate_alm(self): # FIXME: rtol=1e-6 works here, except on Debian with Python 3.4. np.testing.assert_allclose(i, o, rtol=1e-5) + def test_rotate_alm2(self): + # Test rotate_alm against the Fortran library + lmax = 64 + nalm = hp.Alm.getsize(lmax) + alm = np.zeros([3, nalm], dtype=np.complex) + for i in range(3): + for ell in range(lmax+1): + for m in range(ell): + ind = hp.Alm.getidx(lmax, ell, m) + alm[i, ind] = (i+1)*10 + ell + 1j*m + psi = np.pi/3. + theta = 0.5 + phi = 0.01 + hp.rotate_alm(alm, psi, theta, phi) + + ref_0_0_0 = 0.00000000000 + 0.00000000000j + ref_0_21_0 = -64.0056622444 + 0.00000000000j + ref_0_21_21 = -3.19617408364 + 2.00219590117j + ref_0_42_0 = 87.8201360825 + 0.00000000000j + ref_0_42_21 = -6.57242309702 + 50.1128079361j + ref_0_42_42 = 0.792592362074 - .928452597766j + ref_0_63_0 = -49.6732554742 + 0.00000000000j + ref_0_63_21 = -51.2812623888 - 61.6289129316j + ref_0_63_42 = -9.32823219430 + 79.0787993482j + ref_0_63_63 = -.157204566965 + 0.324692958700j + ref_1_0_0 = 0.00000000000 + 0.00000000000j + ref_1_21_0 = -85.5520809077 + 0.00000000000j + ref_1_21_21 = -3.57384285749 + 2.93255811219j + ref_1_42_0 = 107.541172254 + 0.00000000000j + ref_1_42_21 = -2.77944941833 + 57.1015322415j + ref_1_42_42 = 0.794212854046 - 1.10982745343j + ref_1_63_0 = -60.7153303746 + 0.00000000000j + ref_1_63_21 = -61.0915123767 - 65.9943878923j + ref_1_63_42 = -4.86354653261 + 86.5277253196j + ref_1_63_63 = -.147165377786 + 0.360474777237j + + ref = np.array([ + ref_0_0_0, ref_0_21_0, ref_0_21_21, ref_0_42_0, ref_0_42_21, + ref_0_42_42, ref_0_63_0, ref_0_63_21, ref_0_63_42, ref_0_63_63, + ref_1_0_0, ref_1_21_0, ref_1_21_21, ref_1_42_0, ref_1_42_21, + ref_1_42_42, ref_1_63_0, ref_1_63_21, ref_1_63_42, ref_1_63_63]) + + mine = [] + for i in [0, 1]: + for ell in range(0, lmax+1, 21): + for m in range(0, ell+1, 21): + ind = hp.Alm.getidx(lmax, ell, m) + mine.append(alm[i, ind]) + + mine = np.array(ref) + + np.testing.assert_allclose(ref, mine, rtol=1e-10) + def test_accept_ma_allows_only_keywords(self): """ Test whether 'smoothing' wrapped with accept_ma works with only keyword arguments. """ diff --git a/src/healpy/healpy/test/test_visufunc.py b/src/healpy/healpy/test/test_visufunc.py index c8fc2bb..e8f3528 100644 --- a/src/healpy/healpy/test/test_visufunc.py +++ b/src/healpy/healpy/test/test_visufunc.py @@ -8,13 +8,16 @@ from ..zoomtool import mollzoom class TestNoCrash(unittest.TestCase): - + def setUp(self): - self.nside = 1 + self.nside = 16 self.m = np.arange(hp.nside2npix(self.nside), dtype=np.double) self.ma = self.m.copy() self.ma[3] = hp.UNSEEN self.ma = hp.ma(self.ma) + self.m2 = self.m.copy() + self.m2[100:] = hp.UNSEEN + self.ma2 = hp.ma(self.m2) def test_cartview_nocrash(self): cartview(self.m) @@ -34,6 +37,9 @@ def test_azeqview_nocrash(self): def test_mollzoom_nocrash(self): mollzoom(self.m) + def test_mollzoom_histnocrash(self): + mollzoom(self.m, norm='hist') + def test_cartview_ma_nocrash(self): cartview(self.ma) @@ -49,5 +55,8 @@ def test_orthview_ma_nocrash(self): def test_mollzoom_ma_nocrash(self): mollzoom(self.ma) + def test_mollzoom_ma_hist_nocrash(self): + mollzoom(self.ma2, norm='hist') + def test_azeqview_ma_nocrash(self): azeqview(self.ma) diff --git a/src/healpy/healpy/version.py b/src/healpy/healpy/version.py index d0752d5..2365ead 100644 --- a/src/healpy/healpy/version.py +++ b/src/healpy/healpy/version.py @@ -1 +1 @@ -__version__='1.10.3' +__version__='1.11.0' diff --git a/src/healpy/healpy/visufunc.py b/src/healpy/healpy/visufunc.py index c6e583b..7278de8 100644 --- a/src/healpy/healpy/visufunc.py +++ b/src/healpy/healpy/visufunc.py @@ -69,7 +69,7 @@ def mollview(map=None,fig=None,rot=None,coord=None,unit='', cbar=True,cmap=None, notext=False, norm=None,hold=False,margins=None,sub=None, return_projected_map=False): - """Plot an healpix map (given as an array) in Mollweide projection. + """Plot a healpix map (given as an array) in Mollweide projection. Parameters ---------- @@ -101,7 +101,7 @@ def mollview(map=None,fig=None,rot=None,coord=None,unit='', The maximum range value flip : {'astro', 'geo'}, optional Defines the convention of projection : 'astro' (default, east towards left, west towards right) - or 'geo' (east towards roght, west towards left) + or 'geo' (east towards right, west towards left) remove_dip : bool, optional If :const:`True`, remove the dipole+monopole remove_mono : bool, optional @@ -235,7 +235,7 @@ def gnomview(map=None,fig=None,rot=None,coord=None,unit='', cmap=None, norm=None, hold=False,sub=None,margins=None,notext=False, return_projected_map=False): - """Plot an healpix map (given as an array) in Gnomonic projection. + """Plot a healpix map (given as an array) in Gnomonic projection. Parameters ---------- @@ -407,7 +407,7 @@ def cartview(map=None,fig=None,rot=None,zat=None,coord=None,unit='', cmap=None, norm=None,aspect=None, hold=False,sub=None,margins=None,notext=False, return_projected_map=False): - """Plot an healpix map (given as an array) in Cartesian projection. + """Plot a healpix map (given as an array) in Cartesian projection. Parameters ---------- @@ -582,7 +582,7 @@ def orthview(map=None,fig=None,rot=None,coord=None,unit='', cbar=True,cmap=None, notext=False, norm=None,hold=False,margins=None,sub=None, return_projected_map=False): - """Plot an healpix map (given as an array) in Orthographic projection. + """Plot a healpix map (given as an array) in Orthographic projection. Parameters ---------- diff --git a/src/healpy/original_setup.py b/src/healpy/original_setup.py index 51c2260..165c851 100755 --- a/src/healpy/original_setup.py +++ b/src/healpy/original_setup.py @@ -19,7 +19,6 @@ from subprocess import check_output, CalledProcessError, check_call from setuptools import setup from setuptools.dist import Distribution -from setuptools.command.test import test as TestCommand from distutils.command.build_clib import build_clib from distutils.errors import DistutilsExecError from distutils.dir_util import mkpath @@ -61,6 +60,11 @@ log.info('%s is installed; using Cython') from Cython.Distutils import build_ext, Extension +def set_builtin(name, value): + if isinstance(__builtins__, dict): + __builtins__[name] = value + else: + setattr(__builtins__, name, value) class build_external_clib(build_clib): """Subclass of Distutils' standard build_clib subcommand. Adds support for @@ -350,7 +354,7 @@ def finalize_options(self): self.distribution.fetch_build_eggs('numpy') # Prevent numpy from thinking it is still in its setup process: # See http://stackoverflow.com/questions/19919905 - __builtins__.__NUMPY_SETUP__ = False + set_builtin('__NUMPY_SETUP__', False) # Add Numpy header search path path import numpy @@ -372,19 +376,6 @@ def run(self): build_ext.run(self) -class PyTest(TestCommand): - """Custom Setuptools test command to run doctests with py.test. Based on - http://pytest.org/latest/goodpractises.html#integration-with-setuptools-test-commands""" - - def finalize_options(self): - TestCommand.finalize_options(self) - self.test_args.insert(0, '--doctest-modules') - - def run_tests(self): - import pytest - sys.exit(pytest.main(self.test_args)) - - exec(open('healpy/version.py').read()) @@ -399,10 +390,9 @@ def run_tests(self): 'Operating System :: POSIX', 'Programming Language :: C++', 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.2', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', 'Topic :: Scientific/Engineering :: Astronomy', 'Topic :: Scientific/Engineering :: Visualization' ], @@ -425,8 +415,7 @@ def run_tests(self): 'healpy.projaxes','healpy.version'], cmdclass={ 'build_ext': custom_build_ext, - 'build_clib': build_external_clib, - 'test': PyTest + 'build_clib': build_external_clib }, ext_modules=[ Extension('healpy._healpy_pixel_lib', @@ -435,9 +424,6 @@ def run_tests(self): Extension('healpy._healpy_sph_transform_lib', sources=['healpy/src/_healpy_sph_transform_lib.cc'], language='c++'), - Extension('healpy._healpy_fitsio_lib', - sources=['healpy/src/_healpy_fitsio_lib.cc'], - language='c++'), Extension("healpy._query_disc", ['healpy/src/_query_disc.pyx'], language='c++', @@ -453,7 +439,8 @@ def run_tests(self): ], package_data = {'healpy': ['data/*.fits', 'data/totcls.dat', 'test/data/*.fits', 'test/data/*.sh']}, install_requires=['matplotlib', 'numpy', 'six', 'astropy'], - tests_require=['pytest'], + setup_requires=['pytest-runner'], + tests_require=['pytest', 'pytest-cython'], test_suite='healpy', license='GPLv2' ) diff --git a/src/healpy/run_pykg_config.py b/src/healpy/run_pykg_config.py new file mode 100644 index 0000000..8a987ee --- /dev/null +++ b/src/healpy/run_pykg_config.py @@ -0,0 +1,6 @@ +# Helper to run pykg-config, whether it is installed or lives in a zipped egg. +from setuptools import Distribution +from pkg_resources import run_script +requirement = 'pykg-config >= 1.2.0' +Distribution().fetch_build_eggs(requirement) +run_script(requirement, 'pykg-config.py') diff --git a/src/healpy/setup.cfg.in b/src/healpy/setup.cfg.in index 861a9f5..16f85f5 100644 --- a/src/healpy/setup.cfg.in +++ b/src/healpy/setup.cfg.in @@ -1,3 +1,10 @@ +[aliases] +test = pytest + +[tool:pytest] +addopts = --doctest-modules --doctest-cython -v +testpaths = healpy + [egg_info] tag_build = tag_date = 0 diff --git a/src/healpy/setup.py.in b/src/healpy/setup.py.in index a5e68e8..29f0c96 100755 --- a/src/healpy/setup.py.in +++ b/src/healpy/setup.py.in @@ -19,7 +19,6 @@ from distutils.sysconfig import get_config_var, get_config_vars from subprocess import check_output, CalledProcessError, check_call from setuptools import setup from setuptools.dist import Distribution -from setuptools.command.test import test as TestCommand from distutils.command.build_clib import build_clib from distutils.errors import DistutilsExecError from distutils.dir_util import mkpath @@ -61,6 +60,11 @@ else: log.info('%s is installed; using Cython') from Cython.Distutils import build_ext, Extension +def set_builtin(name, value): + if isinstance(__builtins__, dict): + __builtins__[name] = value + else: + setattr(__builtins__, name, value) class build_external_clib(build_clib): """Subclass of Distutils' standard build_clib subcommand. Adds support for @@ -350,7 +354,7 @@ class custom_build_ext(build_ext): self.distribution.fetch_build_eggs('numpy') # Prevent numpy from thinking it is still in its setup process: # See http://stackoverflow.com/questions/19919905 - __builtins__.__NUMPY_SETUP__ = False + set_builtin('__NUMPY_SETUP__', False) # Add Numpy header search path path import numpy @@ -360,19 +364,6 @@ class custom_build_ext(build_ext): build_ext.run(self) -class PyTest(TestCommand): - """Custom Setuptools test command to run doctests with py.test. Based on - http://pytest.org/latest/goodpractises.html#integration-with-setuptools-test-commands""" - - def finalize_options(self): - TestCommand.finalize_options(self) - self.test_args.insert(0, '--doctest-modules') - - def run_tests(self): - import pytest - sys.exit(pytest.main(self.test_args)) - - exec(open('healpy/version.py').read()) @@ -387,10 +378,9 @@ setup(name='healpy', 'Operating System :: POSIX', 'Programming Language :: C++', 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.2', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', 'Topic :: Scientific/Engineering :: Astronomy', 'Topic :: Scientific/Engineering :: Visualization' ], @@ -404,7 +394,6 @@ setup(name='healpy', 'healpy.projaxes','healpy.version'], cmdclass={ 'build_ext': custom_build_ext, - 'test': PyTest }, ext_modules=[ Extension('healpy._healpy_pixel_lib', @@ -419,12 +408,6 @@ setup(name='healpy', libraries=['healpix_cxx', 'cfitsio', 'm'], extra_link_args=[@EXTRA@], language='c++'), - Extension('healpy._healpy_fitsio_lib', - sources=['healpy/src/_healpy_fitsio_lib.cc'], - include_dirs=[@INCDIR@], - libraries=['healpix_cxx', 'cfitsio', 'm'], - extra_link_args=[@EXTRA@], - language='c++'), Extension("healpy._query_disc", ['healpy/src/_query_disc.pyx'], include_dirs=[@INCDIR@], @@ -449,7 +432,8 @@ setup(name='healpy', ], package_data = {'healpy': ['data/*.fits', 'data/totcls.dat', 'test/data/*.fits', 'test/data/*.sh']}, install_requires=['matplotlib', 'numpy', 'six', 'astropy'], - tests_require=['pytest'], + setup_requires=['pytest-runner'], + tests_require=['pytest', 'pytest-cython'], test_suite='healpy', license='GPLv2' )