foscat 3.0.26__tar.gz → 3.0.28__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 (30) hide show
  1. {foscat-3.0.26 → foscat-3.0.28}/PKG-INFO +1 -1
  2. {foscat-3.0.26 → foscat-3.0.28}/setup.py +1 -1
  3. {foscat-3.0.26 → foscat-3.0.28}/src/foscat/FoCUS.py +1 -1
  4. {foscat-3.0.26 → foscat-3.0.28}/src/foscat/scat1D.py +34 -24
  5. {foscat-3.0.26 → foscat-3.0.28}/src/foscat/scat_cov1D.py +48 -1
  6. {foscat-3.0.26 → foscat-3.0.28}/src/foscat.egg-info/PKG-INFO +1 -1
  7. {foscat-3.0.26 → foscat-3.0.28}/README.md +0 -0
  8. {foscat-3.0.26 → foscat-3.0.28}/setup.cfg +0 -0
  9. {foscat-3.0.26 → foscat-3.0.28}/src/foscat/CNN.py +0 -0
  10. {foscat-3.0.26 → foscat-3.0.28}/src/foscat/CircSpline.py +0 -0
  11. {foscat-3.0.26 → foscat-3.0.28}/src/foscat/GCNN.py +0 -0
  12. {foscat-3.0.26 → foscat-3.0.28}/src/foscat/GetGPUinfo.py +0 -0
  13. {foscat-3.0.26 → foscat-3.0.28}/src/foscat/Softmax.py +0 -0
  14. {foscat-3.0.26 → foscat-3.0.28}/src/foscat/Spline1D.py +0 -0
  15. {foscat-3.0.26 → foscat-3.0.28}/src/foscat/Synthesis.py +0 -0
  16. {foscat-3.0.26 → foscat-3.0.28}/src/foscat/__init__.py +0 -0
  17. {foscat-3.0.26 → foscat-3.0.28}/src/foscat/backend.py +0 -0
  18. {foscat-3.0.26 → foscat-3.0.28}/src/foscat/backend_tens.py +0 -0
  19. {foscat-3.0.26 → foscat-3.0.28}/src/foscat/loss_backend_tens.py +0 -0
  20. {foscat-3.0.26 → foscat-3.0.28}/src/foscat/loss_backend_torch.py +0 -0
  21. {foscat-3.0.26 → foscat-3.0.28}/src/foscat/scat.py +0 -0
  22. {foscat-3.0.26 → foscat-3.0.28}/src/foscat/scat2D.py +0 -0
  23. {foscat-3.0.26 → foscat-3.0.28}/src/foscat/scat_cov.py +0 -0
  24. {foscat-3.0.26 → foscat-3.0.28}/src/foscat/scat_cov2D.py +0 -0
  25. {foscat-3.0.26 → foscat-3.0.28}/src/foscat/scat_cov_map.py +0 -0
  26. {foscat-3.0.26 → foscat-3.0.28}/src/foscat/scat_cov_map2D.py +0 -0
  27. {foscat-3.0.26 → foscat-3.0.28}/src/foscat.egg-info/SOURCES.txt +0 -0
  28. {foscat-3.0.26 → foscat-3.0.28}/src/foscat.egg-info/dependency_links.txt +0 -0
  29. {foscat-3.0.26 → foscat-3.0.28}/src/foscat.egg-info/requires.txt +0 -0
  30. {foscat-3.0.26 → foscat-3.0.28}/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.0.26
3
+ Version: 3.0.28
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.0.26',
6
+ version='3.0.28',
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',
@@ -32,7 +32,7 @@ class FoCUS:
32
32
  mpi_size=1,
33
33
  mpi_rank=0):
34
34
 
35
- self.__version__ = '3.0.26'
35
+ self.__version__ = '3.0.28'
36
36
  # P00 coeff for normalization for scat_cov
37
37
  self.TMPFILE_VERSION=TMPFILE_VERSION
38
38
  self.P1_dic = None
@@ -39,31 +39,41 @@ class scat1D:
39
39
  return self.backend.bk_reshape(table,[table.shape[0],ndata])
40
40
 
41
41
  # ---------------------------------------------−---------
42
- def flatten(self,S2L=False):
43
- if not S2L:
44
- if isinstance(self.P00,np.ndarray):
45
- return np.concatenate([self.build_flat(self.S0),
46
- self.build_flat(self.S1),
47
- self.build_flat(self.P00),
48
- self.build_flat(self.S2)],1)
49
- else:
50
- return self.backend.bk_concat([self.build_flat(self.S0),
51
- self.build_flat(self.S1),
52
- self.build_flat(self.P00),
53
- self.build_flat(self.S2)],1)
42
+ def flatten(self,S2L=True,P00=True):
43
+ tmp=[self.build_flat(self.S0),self.build_flat(self.S1)]
44
+
45
+ if P00:
46
+ tmp=tmp+[self.build_flat(self.P00)]
47
+
48
+ tmp=tmp+[self.build_flat(self.S2)]
49
+
50
+ if S2L:
51
+ tmp=tmp+[self.build_flat(self.S2L)]
52
+
53
+ if isinstance(self.P00,np.ndarray):
54
+ return np.concatenate(tmp,1)
54
55
  else:
55
- if isinstance(self.P00,np.ndarray):
56
- return np.concatenate([self.build_flat(self.S0),
57
- self.build_flat(self.S1),
58
- self.build_flat(self.P00),
59
- self.build_flat(self.S2),
60
- self.build_flat(self.S2L)],1)
61
- else:
62
- return self.backend.bk_concat([self.build_flat(self.S0),
63
- self.build_flat(self.S1),
64
- self.build_flat(self.P00),
65
- self.build_flat(self.S2),
66
- self.build_flat(self.S2L)],1)
56
+ return self.backend.bk_concat(tmp,1)
57
+ # ---------------------------------------------−---------
58
+ def flatten_name(self,S2L=True,P00=True):
59
+
60
+ tmp=['S0']
61
+
62
+
63
+ tmp=tmp+['S1_%d'%(k) for k in range(self.S1.shape[-1])]
64
+
65
+ if P00:
66
+ tmp=tmp+['P00_%d'%(k) for k in range(self.P00.shape[-1])]
67
+
68
+ j1,j2=self.get_j_idx()
69
+
70
+ tmp=tmp+['S2_%d-%d'%(j1[k],j2[k]) for k in range(self.S2.shape[-1])]
71
+
72
+ if S2L:
73
+ tmp=tmp+['S2L_%d-%d'%(j1[k],j2[k]) for k in range(self.S2.shape[-1])]
74
+
75
+ return tmp
76
+
67
77
  def get_j_idx(self):
68
78
  return self.j1,self.j2
69
79
 
@@ -784,6 +784,53 @@ class scat_cov1D:
784
784
  def get_norient(self):
785
785
  return self.P00.shape[3]
786
786
 
787
+ # ---------------------------------------------−---------
788
+ def build_flat(self,table):
789
+ shape=table.shape
790
+ ndata=1
791
+ for k in range(1,len(table.shape)):
792
+ ndata=ndata*table.shape[k]
793
+ return self.backend.bk_reshape(table,[table.shape[0],ndata])
794
+
795
+ # ---------------------------------------------−---------
796
+ def flatten(self):
797
+ tmp=[self.build_flat(self.P00)]
798
+
799
+ if self.S1 is not None:
800
+ tmp=tmp+[self.build_flat(self.S1)]
801
+
802
+ tmp=tmp+[self.build_flat(self.C01)]
803
+
804
+ if self.C10 is not None:
805
+ tmp=tmp+[self.build_flat(self.C10)]
806
+
807
+ tmp=tmp+[self.build_flat(self.C11)]
808
+
809
+ if isinstance(self.P00,np.ndarray):
810
+ return np.concatenate(tmp,1)
811
+ else:
812
+ return self.backend.bk_concat(tmp,1)
813
+
814
+ # ---------------------------------------------−---------
815
+ def flatten_name(self):
816
+ tmp=['P00_%d'%(k) for k in range(self.P00.shape[-1])]
817
+
818
+ if self.S1 is not None:
819
+ tmp=tmp+['S1_%d'%(k) for k in range(self.S1.shape[-1])]
820
+
821
+ j1,j2=self.get_j_idx()
822
+
823
+ tmp=tmp+['C01_%d-%d'%(j1[k],j2[k]) for k in range(self.C01.shape[-1])]
824
+
825
+ if self.C10 is not None:
826
+ tmp=tmp+['C10_%d-%d'%(j1[k],j2[k]) for k in range(self.C10.shape[-1])]
827
+
828
+ j1,j2,j3=self.get_jc11_idx()
829
+ tmp=tmp+['C11_%d-%d-%d'%(j1[k],j2[k],j3[k]) for k in range(self.C11.shape[-1])]
830
+
831
+ return tmp
832
+
833
+
787
834
  def add_data_from_log_slope(self,y,n,ds=3):
788
835
  if len(y)<ds:
789
836
  if len(y)==1:
@@ -1027,7 +1074,7 @@ class funct(FOC.FoCUS):
1027
1074
  # determine jmax and nside corresponding to the input map
1028
1075
  im_shape = image1.shape
1029
1076
 
1030
- npix=im_shape[axis]
1077
+ npix=im_shape[len(image1.shape)-1]
1031
1078
 
1032
1079
  J = int(np.log(npix) / np.log(2)) # Number of j scales
1033
1080
  Jmax = J - self.OSTEP # Number of steps for the loop on scales
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: foscat
3
- Version: 3.0.26
3
+ Version: 3.0.28
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