foscat 3.0.18__py3-none-any.whl → 3.0.20__py3-none-any.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.
- foscat/FoCUS.py +14 -9
- foscat/Synthesis.py +1 -2
- foscat/scat.py +41 -28
- foscat/scat1D.py +4 -0
- foscat/scat_cov.py +68 -41
- foscat/scat_cov1D.py +41 -27
- {foscat-3.0.18.dist-info → foscat-3.0.20.dist-info}/METADATA +1 -1
- {foscat-3.0.18.dist-info → foscat-3.0.20.dist-info}/RECORD +10 -10
- {foscat-3.0.18.dist-info → foscat-3.0.20.dist-info}/WHEEL +0 -0
- {foscat-3.0.18.dist-info → foscat-3.0.20.dist-info}/top_level.txt +0 -0
foscat/FoCUS.py
CHANGED
|
@@ -5,7 +5,7 @@ import foscat.backend as bk
|
|
|
5
5
|
from scipy.interpolate import griddata
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
TMPFILE_VERSION='
|
|
8
|
+
TMPFILE_VERSION='V3_0'
|
|
9
9
|
|
|
10
10
|
class FoCUS:
|
|
11
11
|
def __init__(self,
|
|
@@ -32,7 +32,7 @@ class FoCUS:
|
|
|
32
32
|
mpi_size=1,
|
|
33
33
|
mpi_rank=0):
|
|
34
34
|
|
|
35
|
-
self.__version__ = '3.0.
|
|
35
|
+
self.__version__ = '3.0.20'
|
|
36
36
|
# P00 coeff for normalization for scat_cov
|
|
37
37
|
self.TMPFILE_VERSION=TMPFILE_VERSION
|
|
38
38
|
self.P1_dic = None
|
|
@@ -872,7 +872,7 @@ class FoCUS:
|
|
|
872
872
|
except:
|
|
873
873
|
if self.use_2D==False:
|
|
874
874
|
if self.KERNELSZ*self.KERNELSZ>12*nside*nside:
|
|
875
|
-
l_kernel=
|
|
875
|
+
l_kernel=3
|
|
876
876
|
|
|
877
877
|
aa=np.cos(np.arange(self.NORIENT)/self.NORIENT*np.pi).reshape(1,self.NORIENT)
|
|
878
878
|
bb=np.sin(np.arange(self.NORIENT)/self.NORIENT*np.pi).reshape(1,self.NORIENT)
|
|
@@ -890,14 +890,19 @@ class FoCUS:
|
|
|
890
890
|
lidx=np.arange(12*nside*nside)
|
|
891
891
|
|
|
892
892
|
pw=np.pi/4.0
|
|
893
|
-
pw2=1/2
|
|
894
|
-
|
|
893
|
+
pw2=1/2
|
|
894
|
+
amp=1.0
|
|
895
|
+
|
|
895
896
|
if l_kernel==5:
|
|
896
897
|
pw=np.pi/4.0
|
|
897
|
-
pw2=1/2.
|
|
898
|
+
pw2=1/2.25
|
|
899
|
+
amp=1.0/9.2038
|
|
900
|
+
|
|
898
901
|
elif l_kernel==3:
|
|
899
|
-
pw=1.0
|
|
902
|
+
pw=1.0/np.sqrt(2)
|
|
900
903
|
pw2=1.0
|
|
904
|
+
amp=1/8.45
|
|
905
|
+
|
|
901
906
|
elif l_kernel==7:
|
|
902
907
|
pw=np.pi/4.0
|
|
903
908
|
pw2=1.0/3.0
|
|
@@ -920,7 +925,7 @@ class FoCUS:
|
|
|
920
925
|
w=np.exp(-pw2*delta[pidx]*(nside**2))
|
|
921
926
|
pidx=pidx[np.argsort(-w)[0:l_kernel**2]]
|
|
922
927
|
pidx=pidx[np.argsort(lidx[pidx])]
|
|
923
|
-
|
|
928
|
+
|
|
924
929
|
w=np.exp(-pw2*delta[pidx]*(nside**2))
|
|
925
930
|
iwav[k]=lidx[pidx]
|
|
926
931
|
wwav[k]=w
|
|
@@ -935,7 +940,7 @@ class FoCUS:
|
|
|
935
940
|
wav[k,:,:]=(np.cos(xx*aa+yy*bb)+complex(0.0,1.0)*np.sin(xx*aa+yy*bb))*np.expand_dims(w,-1)
|
|
936
941
|
|
|
937
942
|
wav=wav-np.expand_dims(np.mean(wav,1),1)
|
|
938
|
-
wav=wav/np.expand_dims(np.std(wav,1),1)
|
|
943
|
+
wav=amp*wav/np.expand_dims(np.std(wav,1),1)
|
|
939
944
|
wwav=wwav/np.expand_dims(np.sum(wwav,1),1)
|
|
940
945
|
|
|
941
946
|
nk=l_kernel*l_kernel
|
foscat/Synthesis.py
CHANGED
foscat/scat.py
CHANGED
|
@@ -3,11 +3,13 @@ import numpy as np
|
|
|
3
3
|
import pickle
|
|
4
4
|
import foscat.backend as bk
|
|
5
5
|
import healpy as hp
|
|
6
|
+
import sys
|
|
6
7
|
|
|
7
8
|
# Vérifier si TensorFlow est importé et défini
|
|
8
9
|
tf_defined = 'tensorflow' in sys.modules
|
|
9
10
|
|
|
10
11
|
if tf_defined:
|
|
12
|
+
import tensorflow as tf
|
|
11
13
|
tf_function = tf.function # Facultatif : si vous voulez utiliser TensorFlow dans ce script
|
|
12
14
|
else:
|
|
13
15
|
def tf_function(func):
|
|
@@ -63,44 +65,55 @@ class scat:
|
|
|
63
65
|
self.j1 , \
|
|
64
66
|
self.j2 ,backend=self.backend)
|
|
65
67
|
|
|
68
|
+
|
|
66
69
|
def domult(self,x,y):
|
|
67
|
-
|
|
70
|
+
try:
|
|
68
71
|
return x*y
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
except:
|
|
73
|
+
if x.dtype==y.dtype:
|
|
74
|
+
return x*y
|
|
75
|
+
if self.backend.bk_is_complex(x):
|
|
76
|
+
|
|
77
|
+
return self.backend.bk_complex(self.backend.bk_real(x)*y,self.backend.bk_imag(x)*y)
|
|
78
|
+
else:
|
|
79
|
+
return self.backend.bk_complex(self.backend.bk_real(y)*x,self.backend.bk_imag(y)*x)
|
|
80
|
+
|
|
76
81
|
def dodiv(self,x,y):
|
|
77
|
-
|
|
82
|
+
try:
|
|
78
83
|
return x/y
|
|
79
|
-
|
|
84
|
+
except:
|
|
85
|
+
if x.dtype==y.dtype:
|
|
86
|
+
return x/y
|
|
87
|
+
if self.backend.bk_is_complex(x):
|
|
80
88
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
89
|
+
return self.backend.bk_complex(self.backend.bk_real(x)/y,self.backend.bk_imag(x)/y)
|
|
90
|
+
else:
|
|
91
|
+
return self.backend.bk_complex(x/self.backend.bk_real(y),x/self.backend.bk_imag(y))
|
|
84
92
|
|
|
85
93
|
def domin(self,x,y):
|
|
86
|
-
|
|
94
|
+
try:
|
|
87
95
|
return x-y
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
96
|
+
except:
|
|
97
|
+
if x.dtype==y.dtype:
|
|
98
|
+
return x-y
|
|
99
|
+
|
|
100
|
+
if self.backend.bk_is_complex(x):
|
|
101
|
+
|
|
102
|
+
return self.backend.bk_complex(self.backend.bk_real(x)-y,self.backend.bk_imag(x)-y)
|
|
103
|
+
else:
|
|
104
|
+
return self.backend.bk_complex(x-self.backend.bk_real(y),x-self.backend.bk_imag(y))
|
|
94
105
|
|
|
95
106
|
def doadd(self,x,y):
|
|
96
|
-
|
|
107
|
+
try:
|
|
97
108
|
return x+y
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
109
|
+
except:
|
|
110
|
+
if x.dtype==y.dtype:
|
|
111
|
+
return x+y
|
|
112
|
+
if self.backend.bk_is_complex(x):
|
|
113
|
+
|
|
114
|
+
return self.backend.bk_complex(self.backend.bk_real(x)+y,self.backend.bk_imag(x)+y)
|
|
115
|
+
else:
|
|
116
|
+
return self.backend.bk_complex(x+self.backend.bk_real(y),x+self.backend.bk_imag(y))
|
|
104
117
|
|
|
105
118
|
def relu(self):
|
|
106
119
|
|
|
@@ -336,7 +349,7 @@ class scat:
|
|
|
336
349
|
if len(tmp.shape)==4:
|
|
337
350
|
for k in range(tmp.shape[3]):
|
|
338
351
|
for i1 in range(tmp.shape[0]):
|
|
339
|
-
for i2 in range(tmp.shape[
|
|
352
|
+
for i2 in range(tmp.shape[1]):
|
|
340
353
|
if test is None:
|
|
341
354
|
test=1
|
|
342
355
|
plt.plot(tmp[i1,i2,:,k],color=color, label=r'%s $P_{00}$' % (name), lw=lw)
|
foscat/scat1D.py
CHANGED
|
@@ -8,6 +8,7 @@ import sys
|
|
|
8
8
|
tf_defined = 'tensorflow' in sys.modules
|
|
9
9
|
|
|
10
10
|
if tf_defined:
|
|
11
|
+
import tensorflow as tf
|
|
11
12
|
tf_function = tf.function # Facultatif : si vous voulez utiliser TensorFlow dans ce script
|
|
12
13
|
else:
|
|
13
14
|
def tf_function(func):
|
|
@@ -62,6 +63,7 @@ class scat1D:
|
|
|
62
63
|
def domult(self,x,y):
|
|
63
64
|
if x.dtype==y.dtype:
|
|
64
65
|
return x*y
|
|
66
|
+
|
|
65
67
|
if self.backend.bk_is_complex(x):
|
|
66
68
|
|
|
67
69
|
return self.backend.bk_complex(self.backend.bk_real(x)*y,self.backend.bk_imag(x)*y)
|
|
@@ -80,6 +82,7 @@ class scat1D:
|
|
|
80
82
|
def domin(self,x,y):
|
|
81
83
|
if x.dtype==y.dtype:
|
|
82
84
|
return x-y
|
|
85
|
+
|
|
83
86
|
if self.backend.bk_is_complex(x):
|
|
84
87
|
|
|
85
88
|
return self.backend.bk_complex(self.backend.bk_real(x)-y,self.backend.bk_imag(x)-y)
|
|
@@ -89,6 +92,7 @@ class scat1D:
|
|
|
89
92
|
def doadd(self,x,y):
|
|
90
93
|
if x.dtype==y.dtype:
|
|
91
94
|
return x+y
|
|
95
|
+
|
|
92
96
|
if self.backend.bk_is_complex(x):
|
|
93
97
|
|
|
94
98
|
return self.backend.bk_complex(self.backend.bk_real(x)+y,self.backend.bk_imag(x)+y)
|
foscat/scat_cov.py
CHANGED
|
@@ -3,11 +3,13 @@ import numpy as np
|
|
|
3
3
|
import foscat.backend as bk
|
|
4
4
|
import pickle
|
|
5
5
|
import healpy as hp
|
|
6
|
+
import sys
|
|
6
7
|
|
|
7
8
|
# Vérifier si TensorFlow est importé et défini
|
|
8
9
|
tf_defined = 'tensorflow' in sys.modules
|
|
9
10
|
|
|
10
11
|
if tf_defined:
|
|
12
|
+
import tensorflow as tf
|
|
11
13
|
tf_function = tf.function # Facultatif : si vous voulez utiliser TensorFlow dans ce script
|
|
12
14
|
else:
|
|
13
15
|
def tf_function(func):
|
|
@@ -575,41 +577,53 @@ class scat_cov:
|
|
|
575
577
|
s1=s1, c10=c10,backend=self.backend)
|
|
576
578
|
|
|
577
579
|
def domult(self,x,y):
|
|
578
|
-
|
|
580
|
+
try:
|
|
579
581
|
return x*y
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
582
|
+
except:
|
|
583
|
+
if x.dtype==y.dtype:
|
|
584
|
+
return x*y
|
|
585
|
+
if self.backend.bk_is_complex(x):
|
|
586
|
+
|
|
587
|
+
return self.backend.bk_complex(self.backend.bk_real(x)*y,self.backend.bk_imag(x)*y)
|
|
588
|
+
else:
|
|
589
|
+
return self.backend.bk_complex(self.backend.bk_real(y)*x,self.backend.bk_imag(y)*x)
|
|
585
590
|
|
|
586
591
|
def dodiv(self,x,y):
|
|
587
|
-
|
|
592
|
+
try:
|
|
588
593
|
return x/y
|
|
589
|
-
|
|
594
|
+
except:
|
|
595
|
+
if x.dtype==y.dtype:
|
|
596
|
+
return x/y
|
|
597
|
+
if self.backend.bk_is_complex(x):
|
|
590
598
|
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
599
|
+
return self.backend.bk_complex(self.backend.bk_real(x)/y,self.backend.bk_imag(x)/y)
|
|
600
|
+
else:
|
|
601
|
+
return self.backend.bk_complex(x/self.backend.bk_real(y),x/self.backend.bk_imag(y))
|
|
594
602
|
|
|
595
603
|
def domin(self,x,y):
|
|
596
|
-
|
|
604
|
+
try:
|
|
597
605
|
return x-y
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
606
|
+
except:
|
|
607
|
+
if x.dtype==y.dtype:
|
|
608
|
+
return x-y
|
|
609
|
+
|
|
610
|
+
if self.backend.bk_is_complex(x):
|
|
611
|
+
|
|
612
|
+
return self.backend.bk_complex(self.backend.bk_real(x)-y,self.backend.bk_imag(x)-y)
|
|
613
|
+
else:
|
|
614
|
+
return self.backend.bk_complex(x-self.backend.bk_real(y),x-self.backend.bk_imag(y))
|
|
604
615
|
|
|
605
616
|
def doadd(self,x,y):
|
|
606
|
-
|
|
617
|
+
try:
|
|
607
618
|
return x+y
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
619
|
+
except:
|
|
620
|
+
if x.dtype==y.dtype:
|
|
621
|
+
return x+y
|
|
622
|
+
if self.backend.bk_is_complex(x):
|
|
623
|
+
|
|
624
|
+
return self.backend.bk_complex(self.backend.bk_real(x)+y,self.backend.bk_imag(x)+y)
|
|
625
|
+
else:
|
|
626
|
+
return self.backend.bk_complex(x+self.backend.bk_real(y),x+self.backend.bk_imag(y))
|
|
613
627
|
|
|
614
628
|
|
|
615
629
|
def __mul__(self, other):
|
|
@@ -734,7 +748,7 @@ class scat_cov:
|
|
|
734
748
|
return scat_cov(self.S0,self.backend.constant(p0),self.backend.constant(c01),
|
|
735
749
|
self.backend.constant(c11),s1=s1,c10=c10,backend=self.backend)
|
|
736
750
|
|
|
737
|
-
def plot(self, name=None, hold=True, color='blue', lw=1, legend=True):
|
|
751
|
+
def plot(self, name=None, hold=True, color='blue', lw=1, legend=True,norm=False):
|
|
738
752
|
|
|
739
753
|
import matplotlib.pyplot as plt
|
|
740
754
|
|
|
@@ -753,7 +767,7 @@ class scat_cov:
|
|
|
753
767
|
if len(tmp.shape)>3:
|
|
754
768
|
for k in range(tmp.shape[3]):
|
|
755
769
|
for i1 in range(tmp.shape[0]):
|
|
756
|
-
for i2 in range(tmp.shape[
|
|
770
|
+
for i2 in range(tmp.shape[1]):
|
|
757
771
|
if test is None:
|
|
758
772
|
test=1
|
|
759
773
|
plt.plot(tmp[i1,i2,:,k],color=color, label=r'%s $S_1$' % (name), lw=lw)
|
|
@@ -761,7 +775,7 @@ class scat_cov:
|
|
|
761
775
|
plt.plot(tmp[i1,i2,:,k],color=color, lw=lw)
|
|
762
776
|
else:
|
|
763
777
|
for i1 in range(tmp.shape[0]):
|
|
764
|
-
for i2 in range(tmp.shape[
|
|
778
|
+
for i2 in range(tmp.shape[1]):
|
|
765
779
|
if test is None:
|
|
766
780
|
test=1
|
|
767
781
|
plt.plot(tmp[i1,i2,:],color=color, label=r'%s $S_1$' % (name), lw=lw)
|
|
@@ -775,10 +789,11 @@ class scat_cov:
|
|
|
775
789
|
test=None
|
|
776
790
|
plt.subplot(2, 2, 2)
|
|
777
791
|
tmp=abs(self.get_np(self.P00))
|
|
792
|
+
ntmp=np.sqrt(tmp)
|
|
778
793
|
if len(tmp.shape)>3:
|
|
779
794
|
for k in range(tmp.shape[3]):
|
|
780
795
|
for i1 in range(tmp.shape[0]):
|
|
781
|
-
for i2 in range(tmp.shape[
|
|
796
|
+
for i2 in range(tmp.shape[1]):
|
|
782
797
|
if test is None:
|
|
783
798
|
test=1
|
|
784
799
|
plt.plot(tmp[i1,i2,:,k],color=color, label=r'%s $P_{00}$' % (name), lw=lw)
|
|
@@ -786,7 +801,7 @@ class scat_cov:
|
|
|
786
801
|
plt.plot(tmp[i1,i2,:,k],color=color, lw=lw)
|
|
787
802
|
else:
|
|
788
803
|
for i1 in range(tmp.shape[0]):
|
|
789
|
-
for i2 in range(tmp.shape[
|
|
804
|
+
for i2 in range(tmp.shape[1]):
|
|
790
805
|
if test is None:
|
|
791
806
|
test=1
|
|
792
807
|
plt.plot(tmp[i1,i2,:],color=color, label=r'%s $P_{00}$' % (name), lw=lw)
|
|
@@ -818,15 +833,18 @@ class scat_cov:
|
|
|
818
833
|
for i2 in range(j1.max()+1):
|
|
819
834
|
for i3 in range(tmp.shape[3]):
|
|
820
835
|
for i4 in range(tmp.shape[4]):
|
|
836
|
+
dtmp=tmp[i0,i1,j1==i2,i3,i4]
|
|
837
|
+
if norm:
|
|
838
|
+
dtmp=dtmp/ntmp[i0,i1,i2,i3]
|
|
821
839
|
if j2[j1==i2].shape[0]==1:
|
|
822
|
-
ax1.plot(j2[j1==i2]+n,
|
|
840
|
+
ax1.plot(j2[j1==i2]+n,dtmp,'.', \
|
|
823
841
|
color=color, lw=lw)
|
|
824
842
|
else:
|
|
825
843
|
if legend and test is None:
|
|
826
|
-
ax1.plot(j2[j1==i2]+n,
|
|
844
|
+
ax1.plot(j2[j1==i2]+n,dtmp, \
|
|
827
845
|
color=color, label=lname, lw=lw)
|
|
828
846
|
test=1
|
|
829
|
-
ax1.plot(j2[j1==i2]+n,
|
|
847
|
+
ax1.plot(j2[j1==i2]+n,dtmp, \
|
|
830
848
|
color=color, lw=lw)
|
|
831
849
|
tabnx=tabnx+[r'%d'%(k) for k in j2[j1==i2]]
|
|
832
850
|
tabx=tabx+[k+n for k in j2[j1==i2]]
|
|
@@ -839,15 +857,18 @@ class scat_cov:
|
|
|
839
857
|
for i1 in range(tmp.shape[1]):
|
|
840
858
|
for i2 in range(j1.max()+1):
|
|
841
859
|
for i3 in range(tmp.shape[3]):
|
|
860
|
+
dtmp=tmp[i0,i1,j1==i2,i3]
|
|
861
|
+
if norm:
|
|
862
|
+
dtmp=dtmp/ntmp[i0,i1,i2]
|
|
842
863
|
if j2[j1==i2].shape[0]==1:
|
|
843
|
-
ax1.plot(j2[j1==i2]+n,
|
|
864
|
+
ax1.plot(j2[j1==i2]+n,dtmp,'.', \
|
|
844
865
|
color=color, lw=lw)
|
|
845
866
|
else:
|
|
846
867
|
if legend and test is None:
|
|
847
|
-
ax1.plot(j2[j1==i2]+n,
|
|
868
|
+
ax1.plot(j2[j1==i2]+n,dtmp, \
|
|
848
869
|
color=color, label=lname, lw=lw)
|
|
849
870
|
test=1
|
|
850
|
-
ax1.plot(j2[j1==i2]+n,
|
|
871
|
+
ax1.plot(j2[j1==i2]+n,dtmp, \
|
|
851
872
|
color=color, lw=lw)
|
|
852
873
|
tabnx=tabnx+[r'%d'%(k) for k in j2[j1==i2]]
|
|
853
874
|
tabx=tabx+[k+n for k in j2[j1==i2]]
|
|
@@ -903,15 +924,18 @@ class scat_cov:
|
|
|
903
924
|
for i3 in range(tmp.shape[3]):
|
|
904
925
|
for i4 in range(tmp.shape[4]):
|
|
905
926
|
for i5 in range(tmp.shape[5]):
|
|
927
|
+
dtmp=tmp[i0,i1,idx,i3,i4,i5]
|
|
928
|
+
if norm:
|
|
929
|
+
dtmp=dtmp/ntmp[i0,i1,i2,i3]
|
|
906
930
|
if len(idx)==1:
|
|
907
|
-
ax1.plot(np.arange(len(idx))+n,
|
|
931
|
+
ax1.plot(np.arange(len(idx))+n,dtmp,'.', \
|
|
908
932
|
color=color, lw=lw)
|
|
909
933
|
else:
|
|
910
934
|
if legend and test is None:
|
|
911
|
-
ax1.plot(np.arange(len(idx))+n,
|
|
935
|
+
ax1.plot(np.arange(len(idx))+n,dtmp, \
|
|
912
936
|
color=color, label=lname, lw=lw)
|
|
913
937
|
test=1
|
|
914
|
-
ax1.plot(np.arange(len(idx))+n,
|
|
938
|
+
ax1.plot(np.arange(len(idx))+n,dtmp, \
|
|
915
939
|
color=color, lw=lw)
|
|
916
940
|
tabnx=tabnx+[r'%d,%d'%(j2[k],j3[k]) for k in idx]
|
|
917
941
|
tabx=tabx+[k+n for k in range(len(idx))]
|
|
@@ -927,15 +951,18 @@ class scat_cov:
|
|
|
927
951
|
for i2b in range(j2[j1==i2].max()+1):
|
|
928
952
|
idx=np.where((j1==i2)*(j2==i2b))[0]
|
|
929
953
|
for i3 in range(tmp.shape[3]):
|
|
954
|
+
dtmp=tmp[i0,i1,idx,i3]
|
|
955
|
+
if norm:
|
|
956
|
+
dtmp=dtmp/ntmp[i0,i1,i2]
|
|
930
957
|
if len(idx)==1:
|
|
931
|
-
ax1.plot(np.arange(len(idx))+n,
|
|
958
|
+
ax1.plot(np.arange(len(idx))+n,dtmp,'.', \
|
|
932
959
|
color=color, lw=lw)
|
|
933
960
|
else:
|
|
934
961
|
if legend and test is None:
|
|
935
|
-
ax1.plot(np.arange(len(idx))+n,
|
|
962
|
+
ax1.plot(np.arange(len(idx))+n,dtmp, \
|
|
936
963
|
color=color, label=lname, lw=lw)
|
|
937
964
|
test=1
|
|
938
|
-
ax1.plot(np.arange(len(idx))+n,
|
|
965
|
+
ax1.plot(np.arange(len(idx))+n,dtmp, \
|
|
939
966
|
color=color, lw=lw)
|
|
940
967
|
tabnx=tabnx+[r'%d,%d'%(j2[k],j3[k]) for k in idx]
|
|
941
968
|
tabx=tabx+[k+n for k in range(len(idx))]
|
foscat/scat_cov1D.py
CHANGED
|
@@ -3,12 +3,14 @@ import numpy as np
|
|
|
3
3
|
import foscat.backend as bk
|
|
4
4
|
import pickle
|
|
5
5
|
import matplotlib.pyplot as plt
|
|
6
|
+
import sys
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
# Vérifier si TensorFlow est importé et défini
|
|
9
10
|
tf_defined = 'tensorflow' in sys.modules
|
|
10
11
|
|
|
11
12
|
if tf_defined:
|
|
13
|
+
import tensorflow as tf
|
|
12
14
|
tf_function = tf.function # Facultatif : si vous voulez utiliser TensorFlow dans ce script
|
|
13
15
|
else:
|
|
14
16
|
def tf_function(func):
|
|
@@ -373,42 +375,54 @@ class scat_cov1D:
|
|
|
373
375
|
(self.C01 - other),
|
|
374
376
|
c11,
|
|
375
377
|
s1=s1, c10=c10,backend=self.backend)
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
if x.dtype==y.dtype:
|
|
378
|
+
def domult(self,x,y):
|
|
379
|
+
try:
|
|
379
380
|
return x*y
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
381
|
+
except:
|
|
382
|
+
if x.dtype==y.dtype:
|
|
383
|
+
return x*y
|
|
384
|
+
if self.backend.bk_is_complex(x):
|
|
385
|
+
|
|
386
|
+
return self.backend.bk_complex(self.backend.bk_real(x)*y,self.backend.bk_imag(x)*y)
|
|
387
|
+
else:
|
|
388
|
+
return self.backend.bk_complex(self.backend.bk_real(y)*x,self.backend.bk_imag(y)*x)
|
|
389
|
+
|
|
386
390
|
def dodiv(self,x,y):
|
|
387
|
-
|
|
391
|
+
try:
|
|
388
392
|
return x/y
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
393
|
+
except:
|
|
394
|
+
if x.dtype==y.dtype:
|
|
395
|
+
return x/y
|
|
396
|
+
if self.backend.bk_is_complex(x):
|
|
397
|
+
|
|
398
|
+
return self.backend.bk_complex(self.backend.bk_real(x)/y,self.backend.bk_imag(x)/y)
|
|
399
|
+
else:
|
|
400
|
+
return self.backend.bk_complex(x/self.backend.bk_real(y),x/self.backend.bk_imag(y))
|
|
394
401
|
|
|
395
402
|
def domin(self,x,y):
|
|
396
|
-
|
|
403
|
+
try:
|
|
397
404
|
return x-y
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
405
|
+
except:
|
|
406
|
+
if x.dtype==y.dtype:
|
|
407
|
+
return x-y
|
|
408
|
+
|
|
409
|
+
if self.backend.bk_is_complex(x):
|
|
410
|
+
|
|
411
|
+
return self.backend.bk_complex(self.backend.bk_real(x)-y,self.backend.bk_imag(x)-y)
|
|
412
|
+
else:
|
|
413
|
+
return self.backend.bk_complex(x-self.backend.bk_real(y),x-self.backend.bk_imag(y))
|
|
403
414
|
|
|
404
415
|
def doadd(self,x,y):
|
|
405
|
-
|
|
416
|
+
try:
|
|
406
417
|
return x+y
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
418
|
+
except:
|
|
419
|
+
if x.dtype==y.dtype:
|
|
420
|
+
return x+y
|
|
421
|
+
if self.backend.bk_is_complex(x):
|
|
422
|
+
|
|
423
|
+
return self.backend.bk_complex(self.backend.bk_real(x)+y,self.backend.bk_imag(x)+y)
|
|
424
|
+
else:
|
|
425
|
+
return self.backend.bk_complex(x+self.backend.bk_real(y),x+self.backend.bk_imag(y))
|
|
412
426
|
|
|
413
427
|
|
|
414
428
|
def __mul__(self, other):
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
foscat/CircSpline.py,sha256=610sgsWeZzRXYh7gYEqUmGQVrXoHSaFGKjH5mCdh4jU,1684
|
|
2
|
-
foscat/FoCUS.py,sha256=
|
|
2
|
+
foscat/FoCUS.py,sha256=dcWz86Xt_ZjiRYFZTuhK1gFbDns2hDeg9fJhG1tNsz8,67309
|
|
3
3
|
foscat/GCNN.py,sha256=TEW81DGRM4WL7RzH50VKQ-_oHbl5i3iQKuhdkkgKEO8,3831
|
|
4
4
|
foscat/GetGPUinfo.py,sha256=6sJWKO_OeiA0SoGQQdCT_h3D8rZtrv_4hpBc8H3nZls,731
|
|
5
5
|
foscat/Softmax.py,sha256=aCghstI2fchd8FHsBUcmPR4FGlCH9DglS7XMEWlKr8A,2709
|
|
6
6
|
foscat/Spline1D.py,sha256=9oeM8SSHjpfUE5z72YxGt1RVt22vJYM1zhHbNBW8phw,1232
|
|
7
|
-
foscat/Synthesis.py,sha256=
|
|
7
|
+
foscat/Synthesis.py,sha256=oYtHFVTqalVzBQs5okJBnP4pzXFhBMds-pytdEm4Bqs,12611
|
|
8
8
|
foscat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
foscat/backend.py,sha256=BJkx5CRxUHZr8WH4rvApuE8dIo1Y61fbtyfYhGByIIk,30402
|
|
10
10
|
foscat/backend_tens.py,sha256=zEFZ71j0nMNP9_91tz21ZVBTayr75l-sfONOLkJ8DyI,1432
|
|
11
11
|
foscat/loss_backend_tens.py,sha256=WbGC4vy1pBg_bxUXnlCRiXX9WszN6MaUWUc_lUvZNvQ,1667
|
|
12
12
|
foscat/loss_backend_torch.py,sha256=Fj_W3VwGgeD79eQ4jOxOmhZ548UKDRUb3JjUo2-gSWM,1755
|
|
13
|
-
foscat/scat.py,sha256=
|
|
14
|
-
foscat/scat1D.py,sha256=
|
|
13
|
+
foscat/scat.py,sha256=A7xk0o3-wHh-IuXeKSkapvo2J9Hs5yMQZVuGx1FE7A8,60077
|
|
14
|
+
foscat/scat1D.py,sha256=mSM_xDoQNoGYMV6JDmmfIX8n-Ulm6Ru8HtWqP8XTKqw,43914
|
|
15
15
|
foscat/scat2D.py,sha256=Xtisjc5KsbLQAlbn71P0Xg1UIu3r1gUKXoYG2vIMK1M,523
|
|
16
|
-
foscat/scat_cov.py,sha256=
|
|
17
|
-
foscat/scat_cov1D.py,sha256=
|
|
16
|
+
foscat/scat_cov.py,sha256=36Exeac1pXlnVzOWPBX0bSMMEyoUlzwK7kShDPeaF_s,107984
|
|
17
|
+
foscat/scat_cov1D.py,sha256=inAy_TWtUwJr6l9hX3u7r2Jud7DGy_CkjCfcjaUIdJI,58885
|
|
18
18
|
foscat/scat_cov2D.py,sha256=8_XvC-lOEVUWP9vT3Wx10G_ATeVeh0SdrSWuBV7Xf5k,536
|
|
19
19
|
foscat/scat_cov_map.py,sha256=ocU2xd41GtJhiU9S3dEv38KfPCvz0tJKY2f8lPxpm5c,2729
|
|
20
20
|
foscat/scat_cov_map2D.py,sha256=t4llIt7DVIyU1b_u-dJSX4lBr2FhDict8RnNnHpRvHM,2754
|
|
21
|
-
foscat-3.0.
|
|
22
|
-
foscat-3.0.
|
|
23
|
-
foscat-3.0.
|
|
24
|
-
foscat-3.0.
|
|
21
|
+
foscat-3.0.20.dist-info/METADATA,sha256=8A09buj_rHwPPsvJndDfgU4ecsQFcXzTel2RIuRZx3g,1013
|
|
22
|
+
foscat-3.0.20.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
23
|
+
foscat-3.0.20.dist-info/top_level.txt,sha256=AGySXBBAlJgb8Tj8af6m_F-aiNg2zNTcybCUPVOKjAg,7
|
|
24
|
+
foscat-3.0.20.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|