foscat 3.7.1__py3-none-any.whl → 3.7.2__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 +1 -1
- foscat/backend.py +17 -0
- foscat/scat_cov.py +245 -80
- {foscat-3.7.1.dist-info → foscat-3.7.2.dist-info}/METADATA +1 -1
- {foscat-3.7.1.dist-info → foscat-3.7.2.dist-info}/RECORD +8 -8
- {foscat-3.7.1.dist-info → foscat-3.7.2.dist-info}/WHEEL +1 -1
- {foscat-3.7.1.dist-info → foscat-3.7.2.dist-info}/LICENSE +0 -0
- {foscat-3.7.1.dist-info → foscat-3.7.2.dist-info}/top_level.txt +0 -0
foscat/FoCUS.py
CHANGED
foscat/backend.py
CHANGED
|
@@ -1161,6 +1161,23 @@ class foscat_backend:
|
|
|
1161
1161
|
|
|
1162
1162
|
if self.BACKEND == self.NUMPY:
|
|
1163
1163
|
return x.astype(out_type)
|
|
1164
|
+
|
|
1165
|
+
def bk_variable(self,x):
|
|
1166
|
+
if self.BACKEND == self.TENSORFLOW:
|
|
1167
|
+
return self.backend.Variable(x)
|
|
1168
|
+
|
|
1169
|
+
return self.bk_cast(x)
|
|
1170
|
+
|
|
1171
|
+
def bk_assign(self,x,y):
|
|
1172
|
+
if self.BACKEND == self.TENSORFLOW:
|
|
1173
|
+
x.assign(y)
|
|
1174
|
+
x=y
|
|
1175
|
+
|
|
1176
|
+
def bk_constant(self,x):
|
|
1177
|
+
if self.BACKEND == self.TENSORFLOW:
|
|
1178
|
+
return self.backend.constant(x)
|
|
1179
|
+
|
|
1180
|
+
return self.bk_cast(x)
|
|
1164
1181
|
|
|
1165
1182
|
def to_numpy(self,x):
|
|
1166
1183
|
if isinstance(x, np.ndarray):
|
foscat/scat_cov.py
CHANGED
|
@@ -2540,7 +2540,9 @@ class funct(FOC.FoCUS):
|
|
|
2540
2540
|
-------
|
|
2541
2541
|
S1, S2, S3, S4 normalized
|
|
2542
2542
|
"""
|
|
2543
|
+
|
|
2543
2544
|
return_data = self.return_data
|
|
2545
|
+
|
|
2544
2546
|
# Check input consistency
|
|
2545
2547
|
if image2 is not None:
|
|
2546
2548
|
if list(image1.shape) != list(image2.shape):
|
|
@@ -3806,8 +3808,7 @@ class funct(FOC.FoCUS):
|
|
|
3806
3808
|
nside_j3 = nside # NSIDE start (nside_j3 = nside / 2^j3)
|
|
3807
3809
|
|
|
3808
3810
|
# a remettre comme avant
|
|
3809
|
-
M1_dic={}
|
|
3810
|
-
|
|
3811
|
+
M1_dic={}
|
|
3811
3812
|
M2_dic={}
|
|
3812
3813
|
|
|
3813
3814
|
for j3 in range(Jmax):
|
|
@@ -4545,6 +4546,7 @@ class funct(FOC.FoCUS):
|
|
|
4545
4546
|
return self.backend.bk_concat([s0]+S1+S2,axis=1),self.backend.bk_concat([vs0]+VS1+VS2,axis=1)
|
|
4546
4547
|
else:
|
|
4547
4548
|
return self.backend.bk_concat([s0]+S1+S2,axis=1)
|
|
4549
|
+
|
|
4548
4550
|
if not return_data:
|
|
4549
4551
|
S1 = self.backend.bk_concat(S1, 2)
|
|
4550
4552
|
S2 = self.backend.bk_concat(S2, 2)
|
|
@@ -4836,7 +4838,9 @@ class funct(FOC.FoCUS):
|
|
|
4836
4838
|
#
|
|
4837
4839
|
# ---------------------------------------------------------------------------
|
|
4838
4840
|
def scattering_cov(
|
|
4839
|
-
self, data,
|
|
4841
|
+
self, data,
|
|
4842
|
+
data2=None,
|
|
4843
|
+
Jmax=None,
|
|
4840
4844
|
if_large_batch=False,
|
|
4841
4845
|
S4_criteria=None,
|
|
4842
4846
|
use_ref=False,
|
|
@@ -4969,6 +4973,9 @@ class funct(FOC.FoCUS):
|
|
|
4969
4973
|
# convert numpy array input into self.backend.bk_ tensors
|
|
4970
4974
|
data = self.backend.bk_cast(data)
|
|
4971
4975
|
data_f = self.backend.bk_fftn(data, dim=(-2,-1))
|
|
4976
|
+
if data2 is not None:
|
|
4977
|
+
data2 = self.backend.bk_cast(data2)
|
|
4978
|
+
data2_f = self.backend.bk_fftn(data2, dim=(-2,-1))
|
|
4972
4979
|
|
|
4973
4980
|
# initialize tensors for scattering coefficients
|
|
4974
4981
|
S2 = self.backend.bk_zeros((N_image,J,L), dtype=data.dtype)
|
|
@@ -4979,6 +4986,8 @@ class funct(FOC.FoCUS):
|
|
|
4979
4986
|
J_S4={}
|
|
4980
4987
|
|
|
4981
4988
|
S3 = self.backend.bk_zeros((N_image,Ndata_S3,L,L), dtype=data_f.dtype)
|
|
4989
|
+
if data2 is not None:
|
|
4990
|
+
S3p = self.backend.bk_zeros((N_image,Ndata_S3,L,L), dtype=data_f.dtype)
|
|
4982
4991
|
S4_pre_norm = self.backend.bk_zeros((N_image,Ndata_S4,L,L,L), dtype=data_f.dtype)
|
|
4983
4992
|
S4 = self.backend.bk_zeros((N_image,Ndata_S4,L,L,L), dtype=data_f.dtype)
|
|
4984
4993
|
|
|
@@ -4987,39 +4996,22 @@ class funct(FOC.FoCUS):
|
|
|
4987
4996
|
S2_sigma = self.backend.bk_zeros((N_image,J,L), dtype=data.dtype)
|
|
4988
4997
|
S1_sigma = self.backend.bk_zeros((N_image,J,L), dtype=data.dtype)
|
|
4989
4998
|
S3_sigma = self.backend.bk_zeros((N_image,Ndata_S3,L,L), dtype=data_f.dtype)
|
|
4999
|
+
if data2 is not None:
|
|
5000
|
+
S3p_sigma = self.backend.bk_zeros((N_image,Ndata_S3,L,L), dtype=data_f.dtype)
|
|
4990
5001
|
S4_sigma = self.backend.bk_zeros((N_image,Ndata_S4,L,L,L), dtype=data_f.dtype)
|
|
4991
5002
|
|
|
4992
5003
|
if iso_ang:
|
|
4993
5004
|
S3_iso = self.backend.bk_zeros((N_image,Ndata_S3,L), dtype=data_f.dtype)
|
|
5005
|
+
if data2 is not None:
|
|
5006
|
+
S3p_iso = self.backend.bk_zeros((N_image,Ndata_S3,L,L), dtype=data_f.dtype)
|
|
5007
|
+
|
|
4994
5008
|
S4_iso = self.backend.bk_zeros((N_image,Ndata_S4,L,L), dtype=data_f.dtype)
|
|
4995
5009
|
if get_variance:
|
|
4996
5010
|
S3_sigma_iso = self.backend.bk_zeros((N_image,Ndata_S3,L), dtype=data_f.dtype)
|
|
5011
|
+
if data2 is not None:
|
|
5012
|
+
S3p_sigma_iso = self.backend.bk_zeros((N_image,Ndata_S3,L), dtype=data_f.dtype)
|
|
4997
5013
|
S4_sigma_iso = self.backend.bk_zeros((N_image,Ndata_S4,L,L), dtype=data_f.dtype)
|
|
4998
5014
|
|
|
4999
|
-
# calculate scattering fields
|
|
5000
|
-
if self.use_2D:
|
|
5001
|
-
if len(data.shape) == 2:
|
|
5002
|
-
I1 = self.backend.bk_ifftn(
|
|
5003
|
-
data_f[None,None,None,:,:] * filters_set[None,:J,:,:,:], dim=(-2,-1)
|
|
5004
|
-
).abs()
|
|
5005
|
-
else:
|
|
5006
|
-
I1 = self.backend.bk_ifftn(
|
|
5007
|
-
data_f[:,None,None,:,:] * filters_set[None,:J,:,:,:], dim=(-2,-1)
|
|
5008
|
-
).abs()
|
|
5009
|
-
elif self.use_1D:
|
|
5010
|
-
if len(data.shape) == 1:
|
|
5011
|
-
I1 = self.backend.bk_ifftn(
|
|
5012
|
-
data_f[None,None,None,:] * filters_set[None,:J,:,:], dim=(-1)
|
|
5013
|
-
).abs()
|
|
5014
|
-
else:
|
|
5015
|
-
I1 = self.backend.bk_ifftn(
|
|
5016
|
-
data_f[:,None,None,:] * filters_set[None,:J,:,:], dim=(-1)
|
|
5017
|
-
).abs()
|
|
5018
|
-
else:
|
|
5019
|
-
print('todo')
|
|
5020
|
-
|
|
5021
|
-
I1_f= self.backend.bk_fftn(I1, dim=(-2,-1))
|
|
5022
|
-
|
|
5023
5015
|
#
|
|
5024
5016
|
if edge:
|
|
5025
5017
|
if (M,N,J) not in self.edge_masks:
|
|
@@ -5028,12 +5020,87 @@ class funct(FOC.FoCUS):
|
|
|
5028
5020
|
edge_mask = edge_mask / edge_mask.mean((-2,-1))[:,:,None,None]
|
|
5029
5021
|
else:
|
|
5030
5022
|
edge_mask = 1
|
|
5031
|
-
|
|
5032
|
-
|
|
5023
|
+
|
|
5024
|
+
# calculate scattering fields
|
|
5025
|
+
if data2 is None:
|
|
5026
|
+
if self.use_2D:
|
|
5027
|
+
if len(data.shape) == 2:
|
|
5028
|
+
I1 = self.backend.bk_ifftn(
|
|
5029
|
+
data_f[None,None,None,:,:] * filters_set[None,:J,:,:,:], dim=(-2,-1)
|
|
5030
|
+
).abs()
|
|
5031
|
+
else:
|
|
5032
|
+
I1 = self.backend.bk_ifftn(
|
|
5033
|
+
data_f[:,None,None,:,:] * filters_set[None,:J,:,:,:], dim=(-2,-1)
|
|
5034
|
+
).abs()
|
|
5035
|
+
elif self.use_1D:
|
|
5036
|
+
if len(data.shape) == 1:
|
|
5037
|
+
I1 = self.backend.bk_ifftn(
|
|
5038
|
+
data_f[None,None,None,:] * filters_set[None,:J,:,:], dim=(-1)
|
|
5039
|
+
).abs()
|
|
5040
|
+
else:
|
|
5041
|
+
I1 = self.backend.bk_ifftn(
|
|
5042
|
+
data_f[:,None,None,:] * filters_set[None,:J,:,:], dim=(-1)
|
|
5043
|
+
).abs()
|
|
5044
|
+
else:
|
|
5045
|
+
print('todo')
|
|
5046
|
+
|
|
5047
|
+
S2 = (I1**2 * edge_mask).mean((-2,-1))
|
|
5048
|
+
S1 = (I1 * edge_mask).mean((-2,-1))
|
|
5033
5049
|
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5050
|
+
if get_variance:
|
|
5051
|
+
S2_sigma = (I1**2 * edge_mask).std((-2,-1))
|
|
5052
|
+
S1_sigma = (I1 * edge_mask).std((-2,-1))
|
|
5053
|
+
|
|
5054
|
+
I1_f= self.backend.bk_fftn(I1, dim=(-2,-1))
|
|
5055
|
+
|
|
5056
|
+
else:
|
|
5057
|
+
if self.use_2D:
|
|
5058
|
+
if len(data.shape) == 2:
|
|
5059
|
+
I1 = self.backend.bk_ifftn(
|
|
5060
|
+
data_f[None,None,None,:,:] * filters_set[None,:J,:,:,:], dim=(-2,-1)
|
|
5061
|
+
)
|
|
5062
|
+
I2 = self.backend.bk_ifftn(
|
|
5063
|
+
data2_f[None,None,None,:,:] * filters_set[None,:J,:,:,:], dim=(-2,-1)
|
|
5064
|
+
)
|
|
5065
|
+
else:
|
|
5066
|
+
I1 = self.backend.bk_ifftn(
|
|
5067
|
+
data_f[:,None,None,:,:] * filters_set[None,:J,:,:,:], dim=(-2,-1)
|
|
5068
|
+
)
|
|
5069
|
+
I2 = self.backend.bk_ifftn(
|
|
5070
|
+
data2_f[:,None,None,:,:] * filters_set[None,:J,:,:,:], dim=(-2,-1)
|
|
5071
|
+
)
|
|
5072
|
+
elif self.use_1D:
|
|
5073
|
+
if len(data.shape) == 1:
|
|
5074
|
+
I1 = self.backend.bk_ifftn(
|
|
5075
|
+
data_f[None,None,None,:] * filters_set[None,:J,:,:], dim=(-1)
|
|
5076
|
+
)
|
|
5077
|
+
I2 = self.backend.bk_ifftn(
|
|
5078
|
+
data2_f[None,None,None,:] * filters_set[None,:J,:,:], dim=(-1)
|
|
5079
|
+
)
|
|
5080
|
+
else:
|
|
5081
|
+
I1 = self.backend.bk_ifftn(
|
|
5082
|
+
data_f[:,None,None,:] * filters_set[None,:J,:,:], dim=(-1)
|
|
5083
|
+
)
|
|
5084
|
+
I2 = self.backend.bk_ifftn(
|
|
5085
|
+
data2_f[:,None,None,:] * filters_set[None,:J,:,:], dim=(-1)
|
|
5086
|
+
)
|
|
5087
|
+
else:
|
|
5088
|
+
print('todo')
|
|
5089
|
+
|
|
5090
|
+
I1=self.backend.bk_real(I1*self.backend.bk_conjugate(I2))
|
|
5091
|
+
|
|
5092
|
+
S2 = (I1 * edge_mask).mean((-2,-1))
|
|
5093
|
+
if get_variance:
|
|
5094
|
+
S2_sigma = (I1 * edge_mask).std((-2,-1))
|
|
5095
|
+
|
|
5096
|
+
I1=self.backend.bk_L1(I1)
|
|
5097
|
+
|
|
5098
|
+
S1 = (I1 * edge_mask).mean((-2,-1))
|
|
5099
|
+
|
|
5100
|
+
if get_variance:
|
|
5101
|
+
S1_sigma = (I1 * edge_mask).std((-2,-1))
|
|
5102
|
+
|
|
5103
|
+
I1_f= self.backend.bk_fftn(I1, dim=(-2,-1))
|
|
5037
5104
|
|
|
5038
5105
|
if pseudo_coef != 1:
|
|
5039
5106
|
I1 = I1**pseudo_coef
|
|
@@ -5049,9 +5116,13 @@ class funct(FOC.FoCUS):
|
|
|
5049
5116
|
dx3, dy3 = self.get_dxdy(j3,M,N)
|
|
5050
5117
|
I1_f_small = self.cut_high_k_off(I1_f[:,:j3+1], dx3, dy3) # Nimage, J, L, x, y
|
|
5051
5118
|
data_f_small = self.cut_high_k_off(data_f, dx3, dy3)
|
|
5119
|
+
if data2 is not None:
|
|
5120
|
+
data2_f_small = self.cut_high_k_off(data2_f, dx3, dy3)
|
|
5052
5121
|
if edge:
|
|
5053
5122
|
I1_small = self.backend.bk_ifftn(I1_f_small, dim=(-2,-1), norm='ortho')
|
|
5054
5123
|
data_small = self.backend.bk_ifftn(data_f_small, dim=(-2,-1), norm='ortho')
|
|
5124
|
+
if data2 is not None:
|
|
5125
|
+
data2_small = self.backend.bk_ifftn(data2_f_small, dim=(-2,-1), norm='ortho')
|
|
5055
5126
|
wavelet_f3 = self.cut_high_k_off(filters_set[j3], dx3, dy3) # L,x,y
|
|
5056
5127
|
_, M3, N3 = wavelet_f3.shape
|
|
5057
5128
|
wavelet_f3_squared = wavelet_f3**2
|
|
@@ -5068,15 +5139,17 @@ class funct(FOC.FoCUS):
|
|
|
5068
5139
|
if use_ref:
|
|
5069
5140
|
if normalization=='P11':
|
|
5070
5141
|
norm_factor_S3 = (ref_S2[:,None,j3,:] * ref_P11[:,j2,j3,:,:]**pseudo_coef)**0.5
|
|
5071
|
-
|
|
5142
|
+
elif normalization=='S2':
|
|
5072
5143
|
norm_factor_S3 = (ref_S2[:,None,j3,:] * ref_S2[:,j2,:,None]**pseudo_coef)**0.5
|
|
5144
|
+
norm_factor_S3 = 1.0
|
|
5073
5145
|
else:
|
|
5074
5146
|
if normalization=='P11':
|
|
5075
5147
|
# [N_image,l2,l3,x,y]
|
|
5076
5148
|
P11_temp = (I1_f2_wf3_small.abs()**2).mean((-2,-1)) * fft_factor
|
|
5077
5149
|
norm_factor_S3 = (S2[:,None,j3,:] * P11_temp**pseudo_coef)**0.5
|
|
5078
|
-
|
|
5150
|
+
elif normalization=='S2':
|
|
5079
5151
|
norm_factor_S3 = (S2[:,None,j3,:] * S2[:,j2,:,None]**pseudo_coef)**0.5
|
|
5152
|
+
norm_factor_S3 = 1.0
|
|
5080
5153
|
|
|
5081
5154
|
if not edge:
|
|
5082
5155
|
S3[:,Ndata_S3,:,:] = (
|
|
@@ -5096,6 +5169,26 @@ class funct(FOC.FoCUS):
|
|
|
5096
5169
|
S3_sigma[:,Ndata_S3,:,:] = (
|
|
5097
5170
|
data_small.view(N_image,1,1,M3,N3) * self.backend.bk_conjugate(I12_w3_small)
|
|
5098
5171
|
)[...,edge_dx:M3-edge_dx, edge_dy:N3-edge_dy].std((-2,-1)) * fft_factor / norm_factor_S3
|
|
5172
|
+
if data2 is not None:
|
|
5173
|
+
if not edge:
|
|
5174
|
+
S3p[:,Ndata_S3,:,:] = (
|
|
5175
|
+
data2_f_small.view(N_image,1,1,M3,N3) * self.backend.bk_conjugate(I1_f2_wf3_small)
|
|
5176
|
+
).mean((-2,-1)) * fft_factor / norm_factor_S3
|
|
5177
|
+
|
|
5178
|
+
if get_variance:
|
|
5179
|
+
S3p_sigma[:,Ndata_S3,:,:] = (
|
|
5180
|
+
data2_f_small.view(N_image,1,1,M3,N3) * self.backend.bk_conjugate(I1_f2_wf3_small)
|
|
5181
|
+
).std((-2,-1)) * fft_factor / norm_factor_S3
|
|
5182
|
+
else:
|
|
5183
|
+
|
|
5184
|
+
S3p[:,Ndata_S3,:,:] = (
|
|
5185
|
+
data2_small.view(N_image,1,1,M3,N3) * self.backend.bk_conjugate(I12_w3_small)
|
|
5186
|
+
)[...,edge_dx:M3-edge_dx, edge_dy:N3-edge_dy].mean((-2,-1)) * fft_factor / norm_factor_S3
|
|
5187
|
+
if get_variance:
|
|
5188
|
+
S3p_sigma[:,Ndata_S3,:,:] = (
|
|
5189
|
+
data2_small.view(N_image,1,1,M3,N3) * self.backend.bk_conjugate(I12_w3_small)
|
|
5190
|
+
)[...,edge_dx:M3-edge_dx, edge_dy:N3-edge_dy].std((-2,-1)) * fft_factor / norm_factor_S3
|
|
5191
|
+
|
|
5099
5192
|
Ndata_S3+=1
|
|
5100
5193
|
if j2 <= j3:
|
|
5101
5194
|
beg_n=Ndata_S4
|
|
@@ -5160,12 +5253,16 @@ class funct(FOC.FoCUS):
|
|
|
5160
5253
|
if use_ref:
|
|
5161
5254
|
P = (ref_S2[:,j3,:,None,None] * ref_S2[:,j2,None,:,None] )**(0.5*pseudo_coef)
|
|
5162
5255
|
else:
|
|
5163
|
-
P = (S2[:,j3,:,None,None] * S2[:,j2,None,:,None] )**(0.5*pseudo_coef)
|
|
5256
|
+
P = ((S2[:,j3,:,None,None] * S2[:,j2,None,:,None] )**(0.5*pseudo_coef))
|
|
5257
|
+
S4[:,beg_n:Ndata_S4,:,:,:]=S4_pre_norm[:,beg_n:Ndata_S4,:,:,:].clone()/(P.clone())
|
|
5164
5258
|
|
|
5165
|
-
|
|
5259
|
+
if get_variance:
|
|
5260
|
+
S4_sigma[:,beg_n:Ndata_S4,:,:,:] = S4_sigma[:,beg_n:Ndata_S4,:,:,:] / (P)
|
|
5261
|
+
else:
|
|
5262
|
+
S4[:,beg_n:Ndata_S4,:,:,:]=S4_pre_norm[:,beg_n:Ndata_S4,:,:,:].clone()
|
|
5166
5263
|
|
|
5167
5264
|
if get_variance:
|
|
5168
|
-
S4_sigma[:,beg_n:Ndata_S4,:,:,:] = S4_sigma[:,beg_n:Ndata_S4,:,:,:]
|
|
5265
|
+
S4_sigma[:,beg_n:Ndata_S4,:,:,:] = S4_sigma[:,beg_n:Ndata_S4,:,:,:]
|
|
5169
5266
|
|
|
5170
5267
|
"""
|
|
5171
5268
|
# define P11 from diagonals of S4
|
|
@@ -5199,9 +5296,13 @@ class funct(FOC.FoCUS):
|
|
|
5199
5296
|
for l1 in range(L):
|
|
5200
5297
|
for l2 in range(L):
|
|
5201
5298
|
S3_iso[...,(l2-l1)%L] += S3[...,l1,l2]
|
|
5299
|
+
if data2 is not None:
|
|
5300
|
+
S3p_iso[...,(l2-l1)%L] += S3p[...,l1,l2]
|
|
5202
5301
|
for l3 in range(L):
|
|
5203
5302
|
S4_iso[...,(l2-l1)%L,(l3-l1)%L] += S4[...,l1,l2,l3]
|
|
5204
5303
|
S3_iso /= L; S4_iso /= L
|
|
5304
|
+
if data2 is not None:
|
|
5305
|
+
S3p_iso /= L
|
|
5205
5306
|
|
|
5206
5307
|
if get_variance:
|
|
5207
5308
|
S2_sigma_iso = S2_sigma.mean(-1)
|
|
@@ -5209,9 +5310,13 @@ class funct(FOC.FoCUS):
|
|
|
5209
5310
|
for l1 in range(L):
|
|
5210
5311
|
for l2 in range(L):
|
|
5211
5312
|
S3_sigma_iso[...,(l2-l1)%L] += S3_sigma[...,l1,l2]
|
|
5313
|
+
if data2 is not None:
|
|
5314
|
+
S3p_sigma_iso[...,(l2-l1)%L] += S3p_sigma[...,l1,l2]
|
|
5212
5315
|
for l3 in range(L):
|
|
5213
5316
|
S4_sigma_iso[...,(l2-l1)%L,(l3-l1)%L] += S4_sigma[...,l1,l2,l3]
|
|
5214
5317
|
S3_sigma_iso /= L; S4_sigma_iso /= L
|
|
5318
|
+
if data2 is not None:
|
|
5319
|
+
S3p_sigma_iso /= L
|
|
5215
5320
|
|
|
5216
5321
|
mean_data=self.backend.bk_zeros((N_image,1), dtype=data.dtype)
|
|
5217
5322
|
std_data=self.backend.bk_zeros((N_image,1), dtype=data.dtype)
|
|
@@ -5226,59 +5331,119 @@ class funct(FOC.FoCUS):
|
|
|
5226
5331
|
ref_sigma['S2_sigma']=S2_sigma_iso
|
|
5227
5332
|
ref_sigma['S3_sigma']=S3_sigma_iso
|
|
5228
5333
|
ref_sigma['S4_sigma']=S4_sigma_iso
|
|
5334
|
+
if data2 is not None:
|
|
5335
|
+
ref_sigma['S3p_sigma']=S3p_sigma_iso
|
|
5229
5336
|
else:
|
|
5230
5337
|
ref_sigma['std_data']=std_data
|
|
5231
5338
|
ref_sigma['S1_sigma']=S1_sigma
|
|
5232
5339
|
ref_sigma['S2_sigma']=S2_sigma
|
|
5233
5340
|
ref_sigma['S3_sigma']=S3_sigma
|
|
5234
5341
|
ref_sigma['S4_sigma']=S4_sigma
|
|
5342
|
+
if data2 is not None:
|
|
5343
|
+
ref_sigma['S3p_sigma']=S3_sigma
|
|
5235
5344
|
|
|
5236
|
-
if
|
|
5237
|
-
if
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5345
|
+
if data2 is None:
|
|
5346
|
+
if iso_ang:
|
|
5347
|
+
if ref_sigma is not None:
|
|
5348
|
+
for_synthesis = self.backend.backend.cat((
|
|
5349
|
+
mean_data/ref_sigma['std_data'],
|
|
5350
|
+
std_data/ref_sigma['std_data'],
|
|
5351
|
+
(S2_iso/ref_sigma['S2_sigma']).reshape((N_image, -1)).log(),
|
|
5352
|
+
(S1_iso/ref_sigma['S1_sigma']).reshape((N_image, -1)).log(),
|
|
5353
|
+
(S3_iso/ref_sigma['S3_sigma']).reshape((N_image, -1)).real,
|
|
5354
|
+
(S3_iso/ref_sigma['S3_sigma']).reshape((N_image, -1)).imag,
|
|
5355
|
+
(S4_iso/ref_sigma['S4_sigma']).reshape((N_image, -1)).real,
|
|
5356
|
+
(S4_iso/ref_sigma['S4_sigma']).reshape((N_image, -1)).imag,
|
|
5357
|
+
),dim=-1)
|
|
5358
|
+
else:
|
|
5359
|
+
for_synthesis = self.backend.backend.cat((
|
|
5360
|
+
mean_data/std_data,
|
|
5361
|
+
std_data,
|
|
5362
|
+
S2_iso.reshape((N_image, -1)).log(),
|
|
5363
|
+
S1_iso.reshape((N_image, -1)).log(),
|
|
5364
|
+
S3_iso.reshape((N_image, -1)).real,
|
|
5365
|
+
S3_iso.reshape((N_image, -1)).imag,
|
|
5366
|
+
S4_iso.reshape((N_image, -1)).real,
|
|
5367
|
+
S4_iso.reshape((N_image, -1)).imag,
|
|
5368
|
+
),dim=-1)
|
|
5248
5369
|
else:
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5370
|
+
if ref_sigma is not None:
|
|
5371
|
+
for_synthesis = self.backend.backend.cat((
|
|
5372
|
+
mean_data/ref_sigma['std_data'],
|
|
5373
|
+
std_data/ref_sigma['std_data'],
|
|
5374
|
+
(S2/ref_sigma['S2_sigma']).reshape((N_image, -1)).log(),
|
|
5375
|
+
(S1/ref_sigma['S1_sigma']).reshape((N_image, -1)).log(),
|
|
5376
|
+
(S3/ref_sigma['S3_sigma']).reshape((N_image, -1)).real,
|
|
5377
|
+
(S3/ref_sigma['S3_sigma']).reshape((N_image, -1)).imag,
|
|
5378
|
+
(S4/ref_sigma['S4_sigma']).reshape((N_image, -1)).real,
|
|
5379
|
+
(S4/ref_sigma['S4_sigma']).reshape((N_image, -1)).imag,
|
|
5380
|
+
),dim=-1)
|
|
5381
|
+
else:
|
|
5382
|
+
for_synthesis = self.backend.backend.cat((
|
|
5383
|
+
mean_data/std_data,
|
|
5384
|
+
std_data,
|
|
5385
|
+
S2.reshape((N_image, -1)).log(),
|
|
5386
|
+
S1.reshape((N_image, -1)).log(),
|
|
5387
|
+
S3.reshape((N_image, -1)).real,
|
|
5388
|
+
S3.reshape((N_image, -1)).imag,
|
|
5389
|
+
S4.reshape((N_image, -1)).real,
|
|
5390
|
+
S4.reshape((N_image, -1)).imag,
|
|
5391
|
+
),dim=-1)
|
|
5259
5392
|
else:
|
|
5260
|
-
if
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5393
|
+
if iso_ang:
|
|
5394
|
+
if ref_sigma is not None:
|
|
5395
|
+
for_synthesis = self.backend.backend.cat((
|
|
5396
|
+
mean_data/ref_sigma['std_data'],
|
|
5397
|
+
std_data/ref_sigma['std_data'],
|
|
5398
|
+
(S2_iso/ref_sigma['S2_sigma']).reshape((N_image, -1)),
|
|
5399
|
+
(S1_iso/ref_sigma['S1_sigma']).reshape((N_image, -1)),
|
|
5400
|
+
(S3_iso/ref_sigma['S3_sigma']).reshape((N_image, -1)).real,
|
|
5401
|
+
(S3_iso/ref_sigma['S3_sigma']).reshape((N_image, -1)).imag,
|
|
5402
|
+
(S3p_iso/ref_sigma['S3p_sigma']).reshape((N_image, -1)).real,
|
|
5403
|
+
(S3p_iso/ref_sigma['S3p_sigma']).reshape((N_image, -1)).imag,
|
|
5404
|
+
(S4_iso/ref_sigma['S4_sigma']).reshape((N_image, -1)).real,
|
|
5405
|
+
(S4_iso/ref_sigma['S4_sigma']).reshape((N_image, -1)).imag,
|
|
5406
|
+
),dim=-1)
|
|
5407
|
+
else:
|
|
5408
|
+
for_synthesis = self.backend.backend.cat((
|
|
5409
|
+
mean_data/std_data,
|
|
5410
|
+
std_data,
|
|
5411
|
+
S2_iso.reshape((N_image, -1)),
|
|
5412
|
+
S1_iso.reshape((N_image, -1)),
|
|
5413
|
+
S3_iso.reshape((N_image, -1)).real,
|
|
5414
|
+
S3_iso.reshape((N_image, -1)).imag,
|
|
5415
|
+
S3p_iso.reshape((N_image, -1)).real,
|
|
5416
|
+
S3p_iso.reshape((N_image, -1)).imag,
|
|
5417
|
+
S4_iso.reshape((N_image, -1)).real,
|
|
5418
|
+
S4_iso.reshape((N_image, -1)).imag,
|
|
5419
|
+
),dim=-1)
|
|
5271
5420
|
else:
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5421
|
+
if ref_sigma is not None:
|
|
5422
|
+
for_synthesis = self.backend.backend.cat((
|
|
5423
|
+
mean_data/ref_sigma['std_data'],
|
|
5424
|
+
std_data/ref_sigma['std_data'],
|
|
5425
|
+
(S2/ref_sigma['S2_sigma']).reshape((N_image, -1)),
|
|
5426
|
+
(S1/ref_sigma['S1_sigma']).reshape((N_image, -1)),
|
|
5427
|
+
(S3/ref_sigma['S3_sigma']).reshape((N_image, -1)).real,
|
|
5428
|
+
(S3/ref_sigma['S3_sigma']).reshape((N_image, -1)).imag,
|
|
5429
|
+
(S3p/ref_sigma['S3p_sigma']).reshape((N_image, -1)).real,
|
|
5430
|
+
(S3p/ref_sigma['S3p_sigma']).reshape((N_image, -1)).imag,
|
|
5431
|
+
(S4/ref_sigma['S4_sigma']).reshape((N_image, -1)).real,
|
|
5432
|
+
(S4/ref_sigma['S4_sigma']).reshape((N_image, -1)).imag,
|
|
5433
|
+
),dim=-1)
|
|
5434
|
+
else:
|
|
5435
|
+
for_synthesis = self.backend.backend.cat((
|
|
5436
|
+
mean_data/std_data,
|
|
5437
|
+
std_data,
|
|
5438
|
+
S2.reshape((N_image, -1)),
|
|
5439
|
+
S1.reshape((N_image, -1)),
|
|
5440
|
+
S3.reshape((N_image, -1)).real,
|
|
5441
|
+
S3.reshape((N_image, -1)).imag,
|
|
5442
|
+
S3p.reshape((N_image, -1)).real,
|
|
5443
|
+
S3p.reshape((N_image, -1)).imag,
|
|
5444
|
+
S4.reshape((N_image, -1)).real,
|
|
5445
|
+
S4.reshape((N_image, -1)).imag,
|
|
5446
|
+
),dim=-1)
|
|
5282
5447
|
|
|
5283
5448
|
if not use_ref:
|
|
5284
5449
|
self.ref_scattering_cov_S2=S2
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: foscat
|
|
3
|
-
Version: 3.7.
|
|
3
|
+
Version: 3.7.2
|
|
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,26 +1,26 @@
|
|
|
1
1
|
foscat/CNN.py,sha256=j0F2a4Xf3LijhyD_WVZ6Eg_IjGuXw3ddH6Iudj1xVaw,4874
|
|
2
2
|
foscat/CircSpline.py,sha256=CXi49FxF8ZoeZ17Ua8c1AZXe2B5ICEC9aCXb97atB3s,4028
|
|
3
|
-
foscat/FoCUS.py,sha256=
|
|
3
|
+
foscat/FoCUS.py,sha256=DaK1YwUVwMwJikG676kp_OGWRxfytVlxU6f0bbjxCvs,102659
|
|
4
4
|
foscat/GCNN.py,sha256=5RV-FKuvqbD-k99TwiM4CttM2LMZE21WD0IK0j5Mkko,7599
|
|
5
5
|
foscat/Softmax.py,sha256=aBLQauoG0q2SJYPotV6U-cxAhsJcspWHNRWdnA_nAiQ,2854
|
|
6
6
|
foscat/Spline1D.py,sha256=rKzzenduaZZ-yBDJd35it6Gyrj1spqb7hoIaUgISPzY,2983
|
|
7
7
|
foscat/Synthesis.py,sha256=3oL-WIwOzjO6jYn-7J3TfAQSiPaQTqGtrmxcGBh1Gvs,13787
|
|
8
8
|
foscat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
foscat/alm.py,sha256=PaAaq82CH3JzH520eQpqTCivxE4VeJmmc6I_9HXIhcA,32480
|
|
10
|
-
foscat/backend.py,sha256=
|
|
10
|
+
foscat/backend.py,sha256=P_NmxrK8jMRgYMA8Qinpw-7QJcXcB4qt64Ya3cAD1Dg,45317
|
|
11
11
|
foscat/backend_tens.py,sha256=9Dp136m9frkclkwifJQLLbIpl3ETI3_txdPUZcKfuMw,1618
|
|
12
12
|
foscat/loss_backend_tens.py,sha256=dCOVN6faDtIpN3VO78HTmYP2i5fnFAf-Ddy5qVBlGrM,1783
|
|
13
13
|
foscat/loss_backend_torch.py,sha256=k3z18Dj3SaLKK6ZIKcm7GO4U_YKYVP6LtHG1aIbxkYk,1627
|
|
14
14
|
foscat/scat.py,sha256=qGYiBIysPt65MdmF07WWA4piVlTfA9-lFDTaicnqC2w,72822
|
|
15
15
|
foscat/scat1D.py,sha256=W5Uu6wdQ4ZsFKXpof0f1OBl-1wjJmW7ruvddRWxe7uM,53726
|
|
16
16
|
foscat/scat2D.py,sha256=boKj0ASqMMSy7uQLK6hPniG87m3hZGJBYBiq5v8F9IQ,532
|
|
17
|
-
foscat/scat_cov.py,sha256=
|
|
17
|
+
foscat/scat_cov.py,sha256=3q2rBhcgXGIhW30kSUb5LkfC_1wk_OypphlIPBTzEsE,241234
|
|
18
18
|
foscat/scat_cov1D.py,sha256=XOxsZZ5TYq8f34i2tUgIfzyaqaTDlICB3HzD2l_puro,531
|
|
19
19
|
foscat/scat_cov2D.py,sha256=HVYBNtpZgRlz6OOm0LwG_w8Q4Kld4Qc1n6XYeGoxIug,4802
|
|
20
20
|
foscat/scat_cov_map.py,sha256=Swt39-nYEaQkBzyX4EOAQBvUuYQpERzJ-uVxSWS2b-Y,2911
|
|
21
21
|
foscat/scat_cov_map2D.py,sha256=FqF45FBcoiQbvuVsrLWUIPRUc95GsKsrnH6fKzB3GlE,2841
|
|
22
|
-
foscat-3.7.
|
|
23
|
-
foscat-3.7.
|
|
24
|
-
foscat-3.7.
|
|
25
|
-
foscat-3.7.
|
|
26
|
-
foscat-3.7.
|
|
22
|
+
foscat-3.7.2.dist-info/LICENSE,sha256=i0ukIr8ZUpkSY2sZaE9XZK-6vuSU5iG6IgX_3pjatP8,1505
|
|
23
|
+
foscat-3.7.2.dist-info/METADATA,sha256=xVWiNu2F2NbJVh96gwtH7Hv4Q_UZd1WQvRxwcAYBlSk,7216
|
|
24
|
+
foscat-3.7.2.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
|
25
|
+
foscat-3.7.2.dist-info/top_level.txt,sha256=AGySXBBAlJgb8Tj8af6m_F-aiNg2zNTcybCUPVOKjAg,7
|
|
26
|
+
foscat-3.7.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|