Run of fresh-snapshots for astlib

Try this locally (using the lintian-brush package):

debcheckout astlib
cd astlib
new-upstream --snapshot --no-update-changelog

Merge these changes:

git pull https://janitor.debian.net/git/astlib fresh-snapshots/main
git pull https://janitor.debian.net/git/astlib fresh-snapshots/pristine-tar
git pull https://janitor.debian.net/git/astlib fresh-snapshots/upstream

Summary

Merged new upstream version: 0.11.6 (was: 0.11.5).

Diff

Branch: main

diff --git a/PKG-INFO b/PKG-INFO
index dc30b89..a55a31f 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: astLib
-Version: 0.11.5
+Version: 0.11.6
 Summary: A set of python modules for producing simple plots, statistics, common calculations, coordinate conversions, and manipulating FITS images with World Coordinate System (WCS) information.
 Home-page: https://astlib.readthedocs.io
 Author: Matt Hilton & Steven Boada
diff --git a/astLib/__init__.py b/astLib/__init__.py
index 6cd5518..b76a156 100644
--- a/astLib/__init__.py
+++ b/astLib/__init__.py
@@ -13,4 +13,4 @@ See the LICENSE file for information on distribution.
 """
 
 __all__=['astCalc', 'astCoords', 'astImages', 'astPlots', 'astStats', 'astWCS', 'astSED']
-__version__ = '0.11.5'
+__version__ = '0.11.6'
diff --git a/astLib/astWCS.py b/astLib/astWCS.py
index 78d473d..ae378ba 100644
--- a/astLib/astWCS.py
+++ b/astLib/astWCS.py
@@ -58,7 +58,7 @@ class WCS:
     """
 
     def __init__(self, headerSource, extensionName = 0, mode = "image", zapKeywords = [],
-                 useAstropyWCS = True):
+                 useAstropyWCS = True, naxis = 2):
         """Creates a WCS object using either the information contained in the
         header of the specified .fits image, or from a pyfits.header object.
         Set mode = "pyfits" if the headerSource is a pyfits.header.
@@ -93,6 +93,7 @@ class WCS:
         self.mode = mode
         self.headerSource = headerSource
         self.extensionName = extensionName
+        self.naxis = naxis
 
         if self.mode == "image":
             img = pyfits.open(self.headerSource)
@@ -112,6 +113,12 @@ class WCS:
                         self.headerSource.remove(z)
             self.header=headerSource
         
+        # Scan for CUNIT values that upset astropy.wcs
+        for i in (1, 2):
+            if 'CUNIT%d' % (i) in self.header.keys():
+                if self.header['CUNIT%d' % (i)] == '' or self.header['CUNIT%d' % (i)] == 'degree':
+                    self.header['CUNIT%d' % (i)]='deg'
+        
         # This enables a shim to allow code written for astLib to use astropy.wcs underneath
         self.useAstropyWCS=useAstropyWCS
         if NUMPY_MODE == True:
@@ -166,7 +173,7 @@ class WCS:
             cardstring = cardstring+str(card)
         
         if self.useAstropyWCS == True:
-            self.AWCS = apywcs.WCS(self.header)         # For astropy.wcs shim
+            self.AWCS = apywcs.WCS(self.header, naxis = self.naxis) # For astropy.wcs shim
         self.WCSStructure = wcs.wcsinit(cardstring)
 
 
@@ -291,9 +298,9 @@ class WCS:
         
         else:
             # astropy.wcs shim
-            if self.header['NAXIS'] == 2:
+            if self.naxis == 2:
                 pixCoords = self.AWCS.all_world2pix(RADeg, decDeg, self._apywcsOrigin)
-            elif self.header['NAXIS'] == 3:
+            elif self.naxis == 3:
                 pixCoords = self.AWCS.all_world2pix(RADeg, decDeg, 0, self._apywcsOrigin)
             else:
                 raise Exception("Not handling NAXIS > 3 with astropy.wcs shim")
@@ -327,9 +334,9 @@ class WCS:
                 WCSCoords = wcs.pix2wcs(self.WCSStructure, float(x), float(y))
         else:
             # astropy.wcs shim
-            if self.header['NAXIS'] == 2:
+            if self.naxis == 2:
                 WCSCoords = self.AWCS.all_pix2world(x, y, self._apywcsOrigin)
-            elif self.header['NAXIS'] == 3:
+            elif self.naxis == 3:
                 WCSCoords = self.AWCS.all_pix2world(x, y, 0, self._apywcsOrigin)
             else:
                 raise Exception("Not handling NAXIS > 3 with astropy.wcs shim")
diff --git a/debian/changelog b/debian/changelog
index ba9ebf1..992c88a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+astlib (0.11.6-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Tue, 01 Jun 2021 15:18:27 -0000
+
 astlib (0.11.5-1) unstable; urgency=medium
 
   * New upstream version 0.11.5
diff --git a/setup.py b/setup.py
index 7898a20..0209247 100644
--- a/setup.py
+++ b/setup.py
@@ -63,7 +63,7 @@ class build_PyWCSTools_ext(build_ext):
         build_ext.build_extensions(self)
 
 setup(name='astLib',
-    version='0.11.5',
+    version='0.11.6',
     url='https://astlib.readthedocs.io',
     author='Matt Hilton & Steven Boada',
     author_email='matt.hilton@mykolab.com',

Branch: pristine-tar

diff --git a/astlib_0.11.6.orig.tar.gz.delta b/astlib_0.11.6.orig.tar.gz.delta
new file mode 100644
index 0000000..4857f10
Binary files /dev/null and b/astlib_0.11.6.orig.tar.gz.delta differ
diff --git a/astlib_0.11.6.orig.tar.gz.id b/astlib_0.11.6.orig.tar.gz.id
new file mode 100644
index 0000000..011c441
--- /dev/null
+++ b/astlib_0.11.6.orig.tar.gz.id
@@ -0,0 +1 @@
+12282a7a9b682e21899f1ee0716eb3190ff846e5

Branch: upstream

Tag: upstream/0.11.6

Diff is too long (more than 200 lines). Download the raw diff.

Debdiff

[The following lists of changes regard files as different if they have different names, permissions or owners.]

Files in second set of .debs but not in first

-rw-r--r--  root/root   /usr/lib/python3/dist-packages/astLib-0.11.6.egg-info

Files in first set of .debs but not in second

-rw-r--r--  root/root   /usr/lib/python3/dist-packages/astLib-0.11.5.egg-info

No differences were encountered between the control files of package python3-astlib

No differences were encountered between the control files of package python3-astlib-dbgsym

Resulting package

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-snapshots python3-astlib-dbgsym
apt install -t fresh-snapshots python3-astlib

Lintian Result

Full worker log Full build log Full dist log