foscat 3.0.42__tar.gz → 3.0.44__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.
- {foscat-3.0.42 → foscat-3.0.44}/PKG-INFO +1 -1
- {foscat-3.0.42 → foscat-3.0.44}/setup.py +1 -1
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat/FoCUS.py +1 -1
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat/scat_cov.py +79 -88
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat.egg-info/PKG-INFO +1 -1
- {foscat-3.0.42 → foscat-3.0.44}/README.md +0 -0
- {foscat-3.0.42 → foscat-3.0.44}/setup.cfg +0 -0
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat/CNN.py +0 -0
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat/CircSpline.py +0 -0
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat/GCNN.py +0 -0
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat/GetGPUinfo.py +0 -0
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat/Softmax.py +0 -0
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat/Spline1D.py +0 -0
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat/Synthesis.py +0 -0
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat/__init__.py +0 -0
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat/backend.py +0 -0
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat/backend_tens.py +0 -0
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat/loss_backend_tens.py +0 -0
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat/loss_backend_torch.py +0 -0
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat/scat.py +0 -0
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat/scat1D.py +0 -0
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat/scat2D.py +0 -0
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat/scat_cov1D.py +0 -0
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat/scat_cov2D.py +0 -0
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat/scat_cov_map.py +0 -0
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat/scat_cov_map2D.py +0 -0
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat.egg-info/SOURCES.txt +0 -0
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat.egg-info/dependency_links.txt +0 -0
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat.egg-info/requires.txt +0 -0
- {foscat-3.0.42 → foscat-3.0.44}/src/foscat.egg-info/top_level.txt +0 -0
|
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
|
|
|
3
3
|
|
|
4
4
|
setup(
|
|
5
5
|
name='foscat',
|
|
6
|
-
version='3.0.
|
|
6
|
+
version='3.0.44',
|
|
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',
|
|
@@ -68,63 +68,31 @@ class scat_cov:
|
|
|
68
68
|
self.backend.constant(self.C01),
|
|
69
69
|
self.backend.constant(self.C11),
|
|
70
70
|
s1=s1, c10=c10,backend=self.backend)
|
|
71
|
-
|
|
71
|
+
|
|
72
|
+
def conv2complex(self,val):
|
|
73
|
+
if val.dtype=='complex64' or val.dtype=='complex128' :
|
|
74
|
+
return val
|
|
75
|
+
else:
|
|
76
|
+
return self.backend.bk_complex(val,0*val)
|
|
77
|
+
return val
|
|
72
78
|
# ---------------------------------------------−---------
|
|
73
79
|
def flatten(self):
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
self.S1.flatten(),
|
|
91
|
-
self.P00.flatten(),
|
|
92
|
-
self.C01.flatten(),
|
|
93
|
-
self.C11.flatten()],0)
|
|
94
|
-
else:
|
|
95
|
-
return np.concatenate([self.S0.flatten(),
|
|
96
|
-
self.S1.flatten(),
|
|
97
|
-
self.P00.flatten(),
|
|
98
|
-
self.C01.flatten(),
|
|
99
|
-
self.C10.flatten(),
|
|
100
|
-
self.C11.flatten()],0)
|
|
101
|
-
else:
|
|
102
|
-
if self.S1 is None:
|
|
103
|
-
if self.C10 is None:
|
|
104
|
-
return self.backend.bk_concat([self.backend.bk_flattenR(self.S0),
|
|
105
|
-
self.backend.bk_flattenR(self.P00),
|
|
106
|
-
self.backend.bk_flattenR(self.C01),
|
|
107
|
-
self.backend.bk_flattenR(self.C11)],0)
|
|
108
|
-
else:
|
|
109
|
-
return self.backend.bk_concat([self.backend.bk_flattenR(self.S0),
|
|
110
|
-
self.backend.bk_flattenR(self.P00),
|
|
111
|
-
self.backend.bk_flattenR(self.C01),
|
|
112
|
-
self.backend.bk_flattenR(self.C10),
|
|
113
|
-
self.backend.bk_flattenR(self.C11)],0)
|
|
114
|
-
else:
|
|
115
|
-
if self.C10 is None:
|
|
116
|
-
return self.backend.bk_concat([self.backend.bk_flattenR(self.S0),
|
|
117
|
-
self.backend.bk_flattenR(self.S1),
|
|
118
|
-
self.backend.bk_flattenR(self.P00),
|
|
119
|
-
self.backend.bk_flattenR(self.C01),
|
|
120
|
-
self.backend.bk_flattenR(self.C11)],0)
|
|
121
|
-
else:
|
|
122
|
-
return self.backend.bk_concat([self.backend.bk_flattenR(self.S0),
|
|
123
|
-
self.backend.bk_flattenR(self.S1),
|
|
124
|
-
self.backend.bk_flattenR(self.P00),
|
|
125
|
-
self.backend.bk_flattenR(self.C01),
|
|
126
|
-
self.backend.bk_flattenR(self.C10),
|
|
127
|
-
self.backend.bk_flattenR(self.C11)],0)
|
|
80
|
+
tmp=[self.conv2complex(self.backend.bk_reshape(self.S0[0],[self.S0.shape[1]]))]
|
|
81
|
+
if self.S1 is not None:
|
|
82
|
+
tmp=tmp+[self.conv2complex(self.backend.bk_reshape(self.S1[0],
|
|
83
|
+
[self.S1.shape[1]*self.S1.shape[2]*self.S1.shape[3]]))]
|
|
84
|
+
tmp=tmp+[self.conv2complex(self.backend.bk_reshape(self.P00[0],
|
|
85
|
+
[self.S1.shape[1]*self.S1.shape[2]*self.S1.shape[3]])),
|
|
86
|
+
self.conv2complex(self.backend.bk_reshape(self.C01[0],
|
|
87
|
+
[self.C01.shape[1]*self.C01.shape[2]*self.C01.shape[3]*self.C01.shape[4]]))]
|
|
88
|
+
if self.C10 is not None:
|
|
89
|
+
tmp=tmp+[self.conv2complex(self.backend.bk_reshape(self.C10[0],
|
|
90
|
+
[self.C01.shape[1]*self.C01.shape[2]*self.C01.shape[3]*self.C01.shape[4]]))]
|
|
91
|
+
|
|
92
|
+
tmp=tmp+[self.conv2complex(self.backend.bk_reshape(self.C11[0],
|
|
93
|
+
[self.C11.shape[1]*self.C11.shape[2]*self.C11.shape[3]*self.C11.shape[4]*self.C11.shape[5]]))]
|
|
94
|
+
|
|
95
|
+
return self.backend.bk_concat(tmp,0)
|
|
128
96
|
|
|
129
97
|
# ---------------------------------------------−---------
|
|
130
98
|
def flattenMask(self):
|
|
@@ -780,32 +748,6 @@ class scat_cov:
|
|
|
780
748
|
if hold:
|
|
781
749
|
plt.figure(figsize=(16, 8))
|
|
782
750
|
|
|
783
|
-
if self.S1 is not None:
|
|
784
|
-
plt.subplot(2, 2, 1)
|
|
785
|
-
tmp=abs(self.get_np(self.S1))
|
|
786
|
-
test=None
|
|
787
|
-
if len(tmp.shape)>3:
|
|
788
|
-
for k in range(tmp.shape[3]):
|
|
789
|
-
for i1 in range(tmp.shape[0]):
|
|
790
|
-
for i2 in range(tmp.shape[1]):
|
|
791
|
-
if test is None:
|
|
792
|
-
test=1
|
|
793
|
-
plt.plot(tmp[i1,i2,:,k],color=color, label=r'%s $S_1$' % (name), lw=lw)
|
|
794
|
-
else:
|
|
795
|
-
plt.plot(tmp[i1,i2,:,k],color=color, lw=lw)
|
|
796
|
-
else:
|
|
797
|
-
for i1 in range(tmp.shape[0]):
|
|
798
|
-
for i2 in range(tmp.shape[1]):
|
|
799
|
-
if test is None:
|
|
800
|
-
test=1
|
|
801
|
-
plt.plot(tmp[i1,i2,:],color=color, label=r'%s $S_1$' % (name), lw=lw)
|
|
802
|
-
else:
|
|
803
|
-
plt.plot(tmp[i1,i2,:],color=color, lw=lw)
|
|
804
|
-
plt.yscale('log')
|
|
805
|
-
plt.legend()
|
|
806
|
-
plt.ylabel('S1')
|
|
807
|
-
plt.xlabel(r'$j_{1}$')
|
|
808
|
-
|
|
809
751
|
test=None
|
|
810
752
|
plt.subplot(2, 2, 2)
|
|
811
753
|
tmp=abs(self.get_np(self.P00))
|
|
@@ -831,17 +773,62 @@ class scat_cov:
|
|
|
831
773
|
plt.ylabel('P00')
|
|
832
774
|
plt.xlabel(r'$j_{1}$')
|
|
833
775
|
plt.legend()
|
|
776
|
+
|
|
777
|
+
if self.S1 is not None:
|
|
778
|
+
plt.subplot(2, 2, 1)
|
|
779
|
+
tmp=abs(self.get_np(self.S1))
|
|
780
|
+
test=None
|
|
781
|
+
if len(tmp.shape)>3:
|
|
782
|
+
for k in range(tmp.shape[3]):
|
|
783
|
+
for i1 in range(tmp.shape[0]):
|
|
784
|
+
for i2 in range(tmp.shape[1]):
|
|
785
|
+
if test is None:
|
|
786
|
+
test=1
|
|
787
|
+
if norm:
|
|
788
|
+
plt.plot(tmp[i1,i2,:,k,]/ntmp[i1,i2,:,k],color=color, label=r'%s norm. $S_1$' % (name), lw=lw)
|
|
789
|
+
else:
|
|
790
|
+
plt.plot(tmp[i1,i2,:,k],color=color, label=r'%s $S_1$' % (name), lw=lw)
|
|
791
|
+
else:
|
|
792
|
+
if norm:
|
|
793
|
+
plt.plot(tmp[i1,i2,:,k]/ntmp[i1,i2,:,k],color=color, lw=lw)
|
|
794
|
+
else:
|
|
795
|
+
plt.plot(tmp[i1,i2,:,k],color=color, lw=lw)
|
|
796
|
+
else:
|
|
797
|
+
for i1 in range(tmp.shape[0]):
|
|
798
|
+
for i2 in range(tmp.shape[1]):
|
|
799
|
+
if test is None:
|
|
800
|
+
test=1
|
|
801
|
+
plt.plot(tmp[i1,i2,:],color=color, label=r'%s $S_1$' % (name), lw=lw)
|
|
802
|
+
else:
|
|
803
|
+
plt.plot(tmp[i1,i2,:],color=color, lw=lw)
|
|
804
|
+
plt.yscale('log')
|
|
805
|
+
plt.legend()
|
|
806
|
+
if norm:
|
|
807
|
+
plt.ylabel(r'$\frac{S_1}{\sqrt{P_{00}}}$')
|
|
808
|
+
else:
|
|
809
|
+
plt.ylabel('$S_1$')
|
|
810
|
+
plt.xlabel(r'$j_{1}$')
|
|
834
811
|
|
|
835
812
|
ax1=plt.subplot(2, 2, 3)
|
|
836
813
|
ax2 = ax1.twiny()
|
|
837
814
|
n=0
|
|
838
815
|
tmp=abs(self.get_np(self.C01))
|
|
839
|
-
|
|
840
|
-
|
|
816
|
+
if norm:
|
|
817
|
+
lname=r'%s norm. $C_{01}$' % (name)
|
|
818
|
+
ax1.set_ylabel(r'$\frac{C_{01}}{\sqrt{P_{00,j_1}P_{00,j_2}}}$')
|
|
819
|
+
else:
|
|
820
|
+
lname=r'%s $C_{01}$' % (name)
|
|
821
|
+
ax1.set_ylabel(r'$C_{01}$')
|
|
822
|
+
|
|
841
823
|
if self.C10 is not None:
|
|
842
824
|
tmp=abs(self.get_np(self.C01))
|
|
843
|
-
|
|
844
|
-
|
|
825
|
+
if norm:
|
|
826
|
+
lname=r'%s norm. $C_{10}$' % (name)
|
|
827
|
+
ax1.set_ylabel(r'$\frac{C_{10}}{\sqrt{P_{00,j_1}P_{00,j_2}}}$')
|
|
828
|
+
else:
|
|
829
|
+
lname=r'%s $C_{10}$' % (name)
|
|
830
|
+
ax1.set_ylabel(r'$C_{10}$')
|
|
831
|
+
|
|
845
832
|
test=None
|
|
846
833
|
tabx=[]
|
|
847
834
|
tabnx=[]
|
|
@@ -992,7 +979,11 @@ class scat_cov:
|
|
|
992
979
|
tab2nx=tab2nx+['%d'%(i2)]
|
|
993
980
|
ax1.axvline(n-0.5,ls=':',color='gray')
|
|
994
981
|
plt.yscale('log')
|
|
995
|
-
|
|
982
|
+
if norm:
|
|
983
|
+
ax1.set_ylabel(r'$\frac{C_{11}}{\sqrt{P_{00,j_1}P_{00,j_2}}}$')
|
|
984
|
+
else:
|
|
985
|
+
ax1.set_ylabel(r'$C_{11}$')
|
|
986
|
+
|
|
996
987
|
ax1.set_xticks(tabx)
|
|
997
988
|
ax1.set_xticklabels(tabnx,fontsize=6)
|
|
998
989
|
ax1.set_xlabel(r"$j_{2},j_{3}$",fontsize=6)
|
|
@@ -1845,12 +1836,12 @@ class funct(FOC.FoCUS):
|
|
|
1845
1836
|
if not cross:
|
|
1846
1837
|
s0,vs0 = self.masked_mean(I1,vmask,axis=1,calc_var=True)
|
|
1847
1838
|
else:
|
|
1848
|
-
s0,vs0 =
|
|
1839
|
+
s0,vs0 = self.masked_mean(I1-I2,vmask,axis=1,calc_var=True)
|
|
1849
1840
|
else:
|
|
1850
1841
|
if not cross:
|
|
1851
1842
|
s0 = self.masked_mean(I1,vmask,axis=1)
|
|
1852
1843
|
else:
|
|
1853
|
-
s0 =
|
|
1844
|
+
s0 = self.masked_mean(I1-I2,vmask,axis=1)
|
|
1854
1845
|
|
|
1855
1846
|
|
|
1856
1847
|
#### COMPUTE S1, P00, C01 and C11
|
|
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
|
|
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
|