foscat 3.1.2__tar.gz → 3.1.4__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.1.2 → foscat-3.1.4}/PKG-INFO +1 -1
  2. {foscat-3.1.2 → foscat-3.1.4}/setup.py +1 -1
  3. {foscat-3.1.2 → foscat-3.1.4}/src/foscat/FoCUS.py +3 -3
  4. {foscat-3.1.2 → foscat-3.1.4}/src/foscat/backend.py +5 -2
  5. {foscat-3.1.2 → foscat-3.1.4}/src/foscat/scat_cov.py +7 -10
  6. {foscat-3.1.2 → foscat-3.1.4}/src/foscat.egg-info/PKG-INFO +1 -1
  7. {foscat-3.1.2 → foscat-3.1.4}/README.md +0 -0
  8. {foscat-3.1.2 → foscat-3.1.4}/setup.cfg +0 -0
  9. {foscat-3.1.2 → foscat-3.1.4}/src/foscat/CNN.py +0 -0
  10. {foscat-3.1.2 → foscat-3.1.4}/src/foscat/CircSpline.py +0 -0
  11. {foscat-3.1.2 → foscat-3.1.4}/src/foscat/GCNN.py +0 -0
  12. {foscat-3.1.2 → foscat-3.1.4}/src/foscat/GetGPUinfo.py +0 -0
  13. {foscat-3.1.2 → foscat-3.1.4}/src/foscat/Softmax.py +0 -0
  14. {foscat-3.1.2 → foscat-3.1.4}/src/foscat/Spline1D.py +0 -0
  15. {foscat-3.1.2 → foscat-3.1.4}/src/foscat/Synthesis.py +0 -0
  16. {foscat-3.1.2 → foscat-3.1.4}/src/foscat/__init__.py +0 -0
  17. {foscat-3.1.2 → foscat-3.1.4}/src/foscat/backend_tens.py +0 -0
  18. {foscat-3.1.2 → foscat-3.1.4}/src/foscat/loss_backend_tens.py +0 -0
  19. {foscat-3.1.2 → foscat-3.1.4}/src/foscat/loss_backend_torch.py +0 -0
  20. {foscat-3.1.2 → foscat-3.1.4}/src/foscat/scat.py +0 -0
  21. {foscat-3.1.2 → foscat-3.1.4}/src/foscat/scat1D.py +0 -0
  22. {foscat-3.1.2 → foscat-3.1.4}/src/foscat/scat2D.py +0 -0
  23. {foscat-3.1.2 → foscat-3.1.4}/src/foscat/scat_cov1D.old.py +0 -0
  24. {foscat-3.1.2 → foscat-3.1.4}/src/foscat/scat_cov1D.py +0 -0
  25. {foscat-3.1.2 → foscat-3.1.4}/src/foscat/scat_cov2D.py +0 -0
  26. {foscat-3.1.2 → foscat-3.1.4}/src/foscat/scat_cov_map.py +0 -0
  27. {foscat-3.1.2 → foscat-3.1.4}/src/foscat/scat_cov_map2D.py +0 -0
  28. {foscat-3.1.2 → foscat-3.1.4}/src/foscat.egg-info/SOURCES.txt +0 -0
  29. {foscat-3.1.2 → foscat-3.1.4}/src/foscat.egg-info/dependency_links.txt +0 -0
  30. {foscat-3.1.2 → foscat-3.1.4}/src/foscat.egg-info/requires.txt +0 -0
  31. {foscat-3.1.2 → foscat-3.1.4}/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.1.2
3
+ Version: 3.1.4
4
4
  Summary: Generate synthetic Healpix or 2D data using Cross Scattering Transform
5
5
  Home-page: https://github.com/jmdelouis/FOSCAT
6
6
  Author: Jean-Marc DELOUIS
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
3
3
 
4
4
  setup(
5
5
  name='foscat',
6
- version='3.1.2',
6
+ version='3.1.4',
7
7
  description='Generate synthetic Healpix or 2D data using Cross Scattering Transform' ,
8
8
  long_description='Utilize the Cross Scattering Transform (described in https://arxiv.org/abs/2207.12527) to synthesize Healpix or 2D data that is suitable for component separation purposes, such as denoising. \n A demo package for this process can be found at https://github.com/jmdelouis/FOSCAT_DEMO. \n Complete doc can be found at https://foscat-documentation.readthedocs.io/en/latest/index.html. \n\n List of developers : J.-M. Delouis, T. Foulquier, L. Mousset, T. Odaka, F. Paul, E. Allys ' ,
9
9
  license='MIT',
@@ -33,7 +33,7 @@ class FoCUS:
33
33
  mpi_size=1,
34
34
  mpi_rank=0):
35
35
 
36
- self.__version__ = '3.1.2'
36
+ self.__version__ = '3.1.4'
37
37
  # P00 coeff for normalization for scat_cov
38
38
  self.TMPFILE_VERSION=TMPFILE_VERSION
39
39
  self.P1_dic = None
@@ -1627,7 +1627,7 @@ class FoCUS:
1627
1627
 
1628
1628
  def diff_data(self,x,y,is_complex=True,sigma=None):
1629
1629
  if sigma is None:
1630
- if is_complex:
1630
+ if self.backend.bk_is_complex(x):
1631
1631
  r=self.backend.bk_square(self.backend.bk_real(x)-self.backend.bk_real(y))
1632
1632
  i=self.backend.bk_square(self.backend.bk_imag(x)-self.backend.bk_imag(y))
1633
1633
  return self.backend.bk_reduce_sum(r+i)
@@ -1635,7 +1635,7 @@ class FoCUS:
1635
1635
  r=self.backend.bk_square(x-y)
1636
1636
  return self.backend.bk_reduce_sum(r)
1637
1637
  else:
1638
- if is_complex:
1638
+ if self.backend.bk_is_complex(x):
1639
1639
  r=self.backend.bk_square((self.backend.bk_real(x)-self.backend.bk_real(y))/sigma)
1640
1640
  i=self.backend.bk_square((self.backend.bk_imag(x)-self.backend.bk_imag(y))/sigma)
1641
1641
  return self.backend.bk_reduce_sum(r+i)
@@ -407,14 +407,17 @@ class foscat_backend:
407
407
  def bk_L1(self,x):
408
408
  if x.dtype==self.all_cbk_type:
409
409
  xr=self.bk_real(x)
410
- xi=self.bk_imag(x)
410
+ #xi=self.bk_imag(x)
411
411
 
412
412
  r=self.backend.sign(xr)*self.backend.sqrt(self.backend.sign(xr)*xr)
413
- i=self.backend.sign(xi)*self.backend.sqrt(self.backend.sign(xi)*xi)
413
+ return r
414
+ #i=self.backend.sign(xi)*self.backend.sqrt(self.backend.sign(xi)*xi)
415
+ """
414
416
  if self.BACKEND==self.TORCH:
415
417
  return r
416
418
  else:
417
419
  return self.bk_complex(r,i)
420
+ """
418
421
  else:
419
422
  return self.backend.sign(x)*self.backend.sqrt(self.backend.sign(x)*x)
420
423
 
@@ -1958,16 +1958,13 @@ class funct(FOC.FoCUS):
1958
1958
  if return_data:
1959
1959
  s0=I1
1960
1960
  else:
1961
- if calc_var:
1962
- if not cross:
1963
- s0,vs0 = self.masked_mean(I1,vmask,axis=1,calc_var=True)
1964
- else:
1965
- s0,vs0 = self.masked_mean(I1-I2,vmask,axis=1,calc_var=True)
1961
+ if not cross:
1962
+ s0,l_vs0 = self.masked_mean(I1,vmask,axis=1,calc_var=True)
1966
1963
  else:
1967
- if not cross:
1968
- s0 = self.masked_mean(I1,vmask,axis=1)
1969
- else:
1970
- s0 = self.masked_mean(I1-I2,vmask,axis=1)
1964
+ s0,l_vs0 = self.masked_mean(I1-I2,vmask,axis=1,calc_var=True)
1965
+
1966
+ vs0=self.backend.bk_concat([l_vs0,l_vs0],1)
1967
+ s0=self.backend.bk_concat([s0,l_vs0],1)
1971
1968
 
1972
1969
  #### COMPUTE S1, P00, C01 and C11
1973
1970
  nside_j3 = nside # NSIDE start (nside_j3 = nside / 2^j3)
@@ -2257,7 +2254,7 @@ class funct(FOC.FoCUS):
2257
2254
  if C01 is None:
2258
2255
  C01 = self.backend.bk_expand_dims(c01,off_C01) # Add a dimension for NC01
2259
2256
  if calc_var:
2260
- VC01 = vself.backend.bk_expand_dims(vc01,off_C01) # Add a dimension for NC01
2257
+ VC01 = self.backend.bk_expand_dims(vc01,off_C01) # Add a dimension for NC01
2261
2258
  else:
2262
2259
  C01 = self.backend.bk_concat([C01, self.backend.bk_expand_dims(c01,off_C01)],axis=2) # Add a dimension for NC01
2263
2260
  if calc_var:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: foscat
3
- Version: 3.1.2
3
+ Version: 3.1.4
4
4
  Summary: Generate synthetic Healpix or 2D data using Cross Scattering Transform
5
5
  Home-page: https://github.com/jmdelouis/FOSCAT
6
6
  Author: Jean-Marc DELOUIS
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