drizzle 1.15.0__cp312-cp312-win32.whl → 1.15.2__cp312-cp312-win32.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of drizzle might be problematic. Click here for more details.

Binary file
@@ -642,3 +642,157 @@ def test_context_planes():
642
642
 
643
643
  driz.add_image(image, inwcs)
644
644
  assert driz.outcon.shape == (2, 10, 10)
645
+
646
+
647
+ @pytest.mark.parametrize(
648
+ 'kernel',
649
+ [
650
+ 'square',
651
+ 'point',
652
+ 'turbo',
653
+ pytest.param(
654
+ 'lanczos2',
655
+ marks=pytest.mark.xfail(reason='Not a flux-conserving kernel'),
656
+ ),
657
+ pytest.param(
658
+ 'lanczos3',
659
+ marks=pytest.mark.xfail(reason='Not a flux-conserving kernel'),
660
+ ),
661
+ pytest.param(
662
+ 'gaussian',
663
+ marks=pytest.mark.xfail(reason='Not a flux-conserving kernel'),
664
+ ),
665
+ ],
666
+ )
667
+ def test_flux_conservation_nondistorted(kernel):
668
+ n = 200
669
+ in_shape = (n, n)
670
+
671
+ # input coordinate grid:
672
+ y, x = np.indices(in_shape, dtype=np.float64)
673
+
674
+ # simulate a gaussian "star":
675
+ fwhm = 2.9
676
+ x0 = 50.0
677
+ y0 = 68.0
678
+ sig = fwhm / (2.0 * np.sqrt(2.0 * np.log(2.0 * fwhm)))
679
+ sig2 = sig * sig
680
+ star = np.exp(-0.5 / sig2 * ((x.astype(np.float32) - x0)**2 + (y.astype(np.float32) - y0)**2))
681
+ in_sci = (star / np.sum(star)).astype(np.float32) # normalize to 1
682
+ in_wht = np.ones(in_shape, dtype=np.float32)
683
+
684
+ # linear shift:
685
+ xp = x + 0.5
686
+ yp = y + 0.2
687
+
688
+ pixmap = np.dstack([xp, yp])
689
+
690
+ out_shape = (int(yp.max()) + 1, int(xp.max()) + 1)
691
+ # make sure distorion is not moving flux out of the image towards negative
692
+ # coordinates (just because of the simple way of how we account for output
693
+ # image size)
694
+ assert np.min(xp) > -0.5 and np.min(yp) > -0.5
695
+
696
+ out_sci = np.zeros(out_shape, dtype=np.float32)
697
+ out_ctx = np.zeros(out_shape, dtype=np.int32)
698
+ out_wht = np.zeros(out_shape, dtype=np.float32)
699
+
700
+ cdrizzle.tdriz(
701
+ in_sci,
702
+ in_wht,
703
+ pixmap,
704
+ out_sci,
705
+ out_wht,
706
+ out_ctx,
707
+ pixfrac=1.0,
708
+ scale=1.0,
709
+ kernel=kernel,
710
+ in_units="cps",
711
+ expscale=1.0,
712
+ wtscale=1.0,
713
+ )
714
+
715
+ assert np.allclose(
716
+ np.sum(out_sci * out_wht),
717
+ np.sum(in_sci),
718
+ atol=0.0,
719
+ rtol=0.0001,
720
+ )
721
+
722
+ @pytest.mark.parametrize(
723
+ 'kernel',
724
+ [
725
+ 'square',
726
+ 'point',
727
+ 'turbo',
728
+ pytest.param(
729
+ 'lanczos2',
730
+ marks=pytest.mark.xfail(reason='Not a flux-conserving kernel'),
731
+ ),
732
+ pytest.param(
733
+ 'lanczos3',
734
+ marks=pytest.mark.xfail(reason='Not a flux-conserving kernel'),
735
+ ),
736
+ pytest.param(
737
+ 'gaussian',
738
+ marks=pytest.mark.xfail(reason='Not a flux-conserving kernel'),
739
+ ),
740
+ ],
741
+ )
742
+ def test_flux_conservation_distorted(kernel):
743
+ n = 200
744
+ in_shape = (n, n)
745
+
746
+ # input coordinate grid:
747
+ y, x = np.indices(in_shape, dtype=np.float64)
748
+
749
+ # simulate a gaussian "star":
750
+ fwhm = 2.9
751
+ x0 = 50.0
752
+ y0 = 68.0
753
+ sig = fwhm / (2.0 * np.sqrt(2.0 * np.log(2.0 * fwhm)))
754
+ sig2 = sig * sig
755
+ star = np.exp(-0.5 / sig2 * ((x.astype(np.float32) - x0)**2 + (y.astype(np.float32) - y0)**2))
756
+ in_sci = (star / np.sum(star)).astype(np.float32) # normalize to 1
757
+ in_wht = np.ones(in_shape, dtype=np.float32)
758
+
759
+ # linear shift:
760
+ xp = x + 0.5
761
+ yp = y + 0.2
762
+ # add distortion:
763
+ xp += 1e-4 * x**2 + 1e-5 * x * y
764
+ yp += 1e-3 * y**2 - 2e-5 * x * y
765
+
766
+ pixmap = np.dstack([xp, yp])
767
+
768
+ out_shape = (int(yp.max()) + 1, int(xp.max()) + 1)
769
+ # make sure distorion is not moving (pixels with) flux out of the image
770
+ # towards negative coordinates (just because of the simple way of how we
771
+ # account for output image size):
772
+ assert np.min(xp) > -0.5 and np.min(yp) > -0.5
773
+
774
+ out_sci = np.zeros(out_shape, dtype=np.float32)
775
+ out_ctx = np.zeros(out_shape, dtype=np.int32)
776
+ out_wht = np.zeros(out_shape, dtype=np.float32)
777
+
778
+ cdrizzle.tdriz(
779
+ in_sci,
780
+ in_wht,
781
+ pixmap,
782
+ out_sci,
783
+ out_wht,
784
+ out_ctx,
785
+ pixfrac=1.0,
786
+ scale=1.0,
787
+ kernel=kernel,
788
+ in_units="cps",
789
+ expscale=1.0,
790
+ wtscale=1.0,
791
+ )
792
+
793
+ assert np.allclose(
794
+ np.sum(out_sci * out_wht),
795
+ np.sum(in_sci),
796
+ atol=0.0,
797
+ rtol=0.0001,
798
+ )
@@ -9,7 +9,7 @@ from drizzle.cdrizzle import clip_polygon, invert_pixmap
9
9
  SQ2 = 1.0 / sqrt(2.0)
10
10
 
11
11
 
12
- def _is_poly_eq(p1, p2, rtol=0, atol=1e-12):
12
+ def _is_poly_eq(p1, p2, rtol=0, atol=4e-12):
13
13
  if len(p1) != len(p2):
14
14
  return False
15
15
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: drizzle
3
- Version: 1.15.0
3
+ Version: 1.15.2
4
4
  Summary: A package for combining dithered images into a single image
5
5
  Author-email: STScI <help@stsci.edu>
6
6
  License: Copyright (C) 2011,2014 Association of Universities for Research in
@@ -39,7 +39,7 @@ Project-URL: Homepage, https://github.com/spacetelescope/drizzle
39
39
  Project-URL: Bug Tracker, https://github.com/spacetelescope/drizzle/issues
40
40
  Project-URL: Documentation, http://spacetelescope.github.io/drizzle/
41
41
  Project-URL: Source Code, https://github.com/spacetelescope/drizzle
42
- Requires-Python: >=3.9
42
+ Requires-Python: >=3.10
43
43
  Description-Content-Type: text/x-rst
44
44
  License-File: LICENSE.rst
45
45
  Requires-Dist: numpy
@@ -91,7 +91,7 @@ the new GWCS code.
91
91
  Requirements
92
92
  ------------
93
93
 
94
- - Python 3.9 or later
94
+ - Python 3.10 or later
95
95
 
96
96
  - Numpy
97
97
 
@@ -1,18 +1,18 @@
1
1
  drizzle/__init__.py,sha256=7M-hCW6QcKqJl0bdkCixW08PBJzLdMz6UTTzz2CKbgc,271
2
2
  drizzle/calc_pixmap.py,sha256=pM4Wvsjzc_gzb7NR23kLoxQy426ZXZF07tq59qqfEyA,1702
3
- drizzle/cdrizzle.cp312-win32.pyd,sha256=rDlWsRTtFZM-agWQq1OMlu6uNlMqtED0uFM5R_DnTX4,87552
3
+ drizzle/cdrizzle.cp312-win32.pyd,sha256=3WNZoxK1d2OMpjfQkaNm0yjf4dAw7OtaS7XXN3FcNiI,88064
4
4
  drizzle/doblot.py,sha256=Qr5FdfV9-GY93Do5Jb9VAX-Y7M4EusIzAwwneV76Ai4,2576
5
5
  drizzle/dodrizzle.py,sha256=3h8FE46FoHUdt9T4FjXlSOQvGU_OQZm3FRXX33I2XDM,6979
6
6
  drizzle/drizzle.py,sha256=jnsv5GUX-NZHJN3GQhkWmmxDp1QK9iSFeYDpgNpeVVY,23441
7
7
  drizzle/util.py,sha256=8qPA7C8nqRL7vAjJ3Ip6yLeaIauJXLtV9JBAzIDUNiY,5999
8
8
  drizzle/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  drizzle/tests/test_cdrizzle.py,sha256=JHwVwOQ-evOD1XMPyKStxODy3AGwzXa6PMDGJldmFik,714
10
- drizzle/tests/test_drizzle.py,sha256=pAEDodtD3DkeqdHaX_MUZjiPmTsDzBQk03idymgWPQY,21010
10
+ drizzle/tests/test_drizzle.py,sha256=n8rXSIL0hqoLs9p9zb106u4e1TKYdl89824lzRJO2UM,25193
11
11
  drizzle/tests/test_file_io.py,sha256=z6deDDdwGog03wC96poDDWoqafB2cfyR9q0PJzAaJ_g,5094
12
- drizzle/tests/test_overlap_calc.py,sha256=0vtswuOXa2bP4GLm2c5q1tuIWdXePfZ_6Xd0-odKia0,7062
12
+ drizzle/tests/test_overlap_calc.py,sha256=Fv5ntD7hbFF_8vkiTrHeTWP7hgjQ7kkvkeY_IOZ8_aw,7062
13
13
  drizzle/tests/test_pixmap.py,sha256=B8Xj0MjpeP6Tc2vIL7gV7kBDmyDdo5SEafxGHrTnESM,2131
14
- drizzle-1.15.0.dist-info/LICENSE.rst,sha256=sUXj5W73D9TcOw5ZXaDdcthYdY2b2dTJPsxBuZTOYWQ,1505
15
- drizzle-1.15.0.dist-info/METADATA,sha256=sRkBxOA3jsNoEtTX9RWCW0ug4jbHBdIIJ81G50_PxHA,17024
16
- drizzle-1.15.0.dist-info/WHEEL,sha256=Q5m5OU7k24Q9oJcD9pbryDsMdvQYL1N4fomXgd4i1qg,98
17
- drizzle-1.15.0.dist-info/top_level.txt,sha256=MA5uqwTj1sJBi-hCeQj9v3-sZ9nVUTe6bd_zGWTKy5A,8
18
- drizzle-1.15.0.dist-info/RECORD,,
14
+ drizzle-1.15.2.dist-info/LICENSE.rst,sha256=sUXj5W73D9TcOw5ZXaDdcthYdY2b2dTJPsxBuZTOYWQ,1505
15
+ drizzle-1.15.2.dist-info/METADATA,sha256=s-h5LKfkjzHE6-kJHhyx6-eeN1YK5QVcFZYswwUcU00,17026
16
+ drizzle-1.15.2.dist-info/WHEEL,sha256=N7fPzcANYQSP-1lTeUuLriuOSDjRoCV8Fj8BnfANnGQ,98
17
+ drizzle-1.15.2.dist-info/top_level.txt,sha256=MA5uqwTj1sJBi-hCeQj9v3-sZ9nVUTe6bd_zGWTKy5A,8
18
+ drizzle-1.15.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp312-cp312-win32
5
5