foscat 3.3.0__tar.gz → 3.3.3__tar.gz

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.
Files changed (31) hide show
  1. {foscat-3.3.0/src/foscat.egg-info → foscat-3.3.3}/PKG-INFO +1 -1
  2. {foscat-3.3.0 → foscat-3.3.3}/pyproject.toml +1 -1
  3. {foscat-3.3.0 → foscat-3.3.3}/src/foscat/alm.py +10 -4
  4. {foscat-3.3.0 → foscat-3.3.3}/src/foscat/backend.py +8 -0
  5. {foscat-3.3.0 → foscat-3.3.3}/src/foscat/scat_cov.py +1 -1
  6. {foscat-3.3.0 → foscat-3.3.3/src/foscat.egg-info}/PKG-INFO +1 -1
  7. {foscat-3.3.0 → foscat-3.3.3}/LICENCE +0 -0
  8. {foscat-3.3.0 → foscat-3.3.3}/README.md +0 -0
  9. {foscat-3.3.0 → foscat-3.3.3}/setup.cfg +0 -0
  10. {foscat-3.3.0 → foscat-3.3.3}/src/foscat/CNN.py +0 -0
  11. {foscat-3.3.0 → foscat-3.3.3}/src/foscat/CircSpline.py +0 -0
  12. {foscat-3.3.0 → foscat-3.3.3}/src/foscat/FoCUS.py +0 -0
  13. {foscat-3.3.0 → foscat-3.3.3}/src/foscat/GCNN.py +0 -0
  14. {foscat-3.3.0 → foscat-3.3.3}/src/foscat/Softmax.py +0 -0
  15. {foscat-3.3.0 → foscat-3.3.3}/src/foscat/Spline1D.py +0 -0
  16. {foscat-3.3.0 → foscat-3.3.3}/src/foscat/Synthesis.py +0 -0
  17. {foscat-3.3.0 → foscat-3.3.3}/src/foscat/__init__.py +0 -0
  18. {foscat-3.3.0 → foscat-3.3.3}/src/foscat/backend_tens.py +0 -0
  19. {foscat-3.3.0 → foscat-3.3.3}/src/foscat/loss_backend_tens.py +0 -0
  20. {foscat-3.3.0 → foscat-3.3.3}/src/foscat/loss_backend_torch.py +0 -0
  21. {foscat-3.3.0 → foscat-3.3.3}/src/foscat/scat.py +0 -0
  22. {foscat-3.3.0 → foscat-3.3.3}/src/foscat/scat1D.py +0 -0
  23. {foscat-3.3.0 → foscat-3.3.3}/src/foscat/scat2D.py +0 -0
  24. {foscat-3.3.0 → foscat-3.3.3}/src/foscat/scat_cov1D.py +0 -0
  25. {foscat-3.3.0 → foscat-3.3.3}/src/foscat/scat_cov2D.py +0 -0
  26. {foscat-3.3.0 → foscat-3.3.3}/src/foscat/scat_cov_map.py +0 -0
  27. {foscat-3.3.0 → foscat-3.3.3}/src/foscat/scat_cov_map2D.py +0 -0
  28. {foscat-3.3.0 → foscat-3.3.3}/src/foscat.egg-info/SOURCES.txt +0 -0
  29. {foscat-3.3.0 → foscat-3.3.3}/src/foscat.egg-info/dependency_links.txt +0 -0
  30. {foscat-3.3.0 → foscat-3.3.3}/src/foscat.egg-info/requires.txt +0 -0
  31. {foscat-3.3.0 → foscat-3.3.3}/src/foscat.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: foscat
3
- Version: 3.3.0
3
+ Version: 3.3.3
4
4
  Summary: Generate synthetic Healpix or 2D data using Cross Scattering Transform
5
5
  Author-email: Jean-Marc DELOUIS <jean.marc.delouis@ifremer.fr>
6
6
  Maintainer-email: Theo Foulquier <theo.foulquier@ifremer.fr>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "foscat"
3
- version = "3.3.0"
3
+ version = "3.3.3"
4
4
  description = "Generate synthetic Healpix or 2D data using Cross Scattering Transform"
5
5
  readme = "README.md"
6
6
  license = { text = "BSD-3-Clause" }
@@ -96,12 +96,18 @@ class alm():
96
96
  ii+=1
97
97
  return self.backend.bk_reshape(self.backend.bk_concat(ft_im,axis=0),[4*nside-1,3*nside])
98
98
 
99
- def anafast(self,im,map2=None):
99
+ def anafast(self,im,map2=None,nest=True):
100
100
  nside=int(np.sqrt(im.shape[0]//12))
101
101
  th,ph=hp.pix2ang(nside,np.arange(12*nside*nside))
102
- ft_im=self.comp_tf(self.backend.bk_complex(im,0*im),ph)
103
- if map2 is not None:
104
- ft_im2=self.comp_tf(self.backend.bk_complex(map2,0*im),ph)
102
+ if nest:
103
+ idx=hp.ring2nest(nside,np.arange(12*nside**2))
104
+ ft_im=self.comp_tf(self.backend.bk_complex(self.backend.bk_gather(im,idx),0*im),ph)
105
+ if map2 is not None:
106
+ ft_im2=self.comp_tf(self.backend.bk_complex(self.backend.bk_gather(map2,idx),0*im),ph)
107
+ else:
108
+ ft_im=self.comp_tf(self.backend.bk_complex(im,0*im),ph)
109
+ if map2 is not None:
110
+ ft_im2=self.comp_tf(self.backend.bk_complex(map2,0*im),ph)
105
111
 
106
112
  co_th=np.cos(np.unique(th))
107
113
 
@@ -932,6 +932,14 @@ class foscat_backend:
932
932
  return self.backend.zeros(shape,dtype=dtype)
933
933
  if self.BACKEND == self.NUMPY:
934
934
  return np.zeros(shape,dtype=dtype)
935
+
936
+ def bk_gather(self, data,idx):
937
+ if self.BACKEND == self.TENSORFLOW:
938
+ return self.backend.gather(data,idx)
939
+ if self.BACKEND == self.TORCH:
940
+ return data[idx]
941
+ if self.BACKEND == self.NUMPY:
942
+ return data[idx]
935
943
 
936
944
  def bk_fft(self, data):
937
945
  if self.BACKEND == self.TENSORFLOW:
@@ -1496,7 +1496,7 @@ class scat_cov:
1496
1496
  ax1.axvline(n - 0.5, ls=":", color="gray")
1497
1497
  plt.yscale("log")
1498
1498
  if norm:
1499
- ax1.set_ylabel(r"$\frac{S_4}{\sqrt{P_{00,j_1}P_{00,j_2}}}$")
1499
+ ax1.set_ylabel(r"$\frac{S_4}{\sqrt{S_{2,j_1}S_{2,j_2}}}$")
1500
1500
  else:
1501
1501
  ax1.set_ylabel(r"$S_4$")
1502
1502
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: foscat
3
- Version: 3.3.0
3
+ Version: 3.3.3
4
4
  Summary: Generate synthetic Healpix or 2D data using Cross Scattering Transform
5
5
  Author-email: Jean-Marc DELOUIS <jean.marc.delouis@ifremer.fr>
6
6
  Maintainer-email: Theo Foulquier <theo.foulquier@ifremer.fr>
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes