foscat 2025.8.3__py3-none-any.whl → 2025.8.4__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 CHANGED
@@ -36,7 +36,7 @@ class FoCUS:
36
36
  mpi_rank=0
37
37
  ):
38
38
 
39
- self.__version__ = "2025.08.3"
39
+ self.__version__ = "2025.08.4"
40
40
  # P00 coeff for normalization for scat_cov
41
41
  self.TMPFILE_VERSION = TMPFILE_VERSION
42
42
  self.P1_dic = None
@@ -2380,9 +2380,11 @@ class FoCUS:
2380
2380
  res = v1 / vh
2381
2381
 
2382
2382
  oshape = [x.shape[0]] + [mask.shape[0]]
2383
- if len(x.shape)>1:
2383
+ if len(x.shape) > 3:
2384
2384
  oshape = oshape + list(x.shape[1:-2])
2385
-
2385
+ else:
2386
+ oshape = oshape + [1]
2387
+
2386
2388
  if calc_var:
2387
2389
  if self.backend.bk_is_complex(vtmp):
2388
2390
  res2 = self.backend.bk_sqrt(
foscat/scat_cov.py CHANGED
@@ -2763,34 +2763,6 @@ class funct(FOC.FoCUS):
2763
2763
 
2764
2764
  nside = nside * 2
2765
2765
 
2766
- if self.KERNELSZ > 5 and not self.use_2D:
2767
- # if the kernel size is bigger than 3 increase the binning before smoothing
2768
- if self.use_2D:
2769
- vmask = self.up_grade(
2770
- vmask, I1.shape[-2] * 2, nouty=I1.shape[-1] * 2,axis=-2
2771
- )
2772
- I1 = self.up_grade(
2773
- I1, I1.shape[-2] * 2, nouty=I1.shape[-1] * 2,axis=-2
2774
- )
2775
- if cross:
2776
- I2 = self.up_grade(
2777
- I2,
2778
- I2.shape[-2] * 2,
2779
- nouty=I2.shape[-1] * 2,axis=-2
2780
- )
2781
- elif self.use_1D:
2782
- vmask = self.up_grade(vmask, I1.shape[-1] * 2)
2783
- I1 = self.up_grade(I1, I1.shape[-1] * 2)
2784
- if cross:
2785
- I2 = self.up_grade(I2, I2.shape[-1] * 2)
2786
- nside = nside * 2
2787
- else:
2788
- I1 = self.up_grade(I1, nside * 2)
2789
- vmask = self.up_grade(vmask, nside * 2)
2790
- if cross:
2791
- I2 = self.up_grade(I2, nside * 2)
2792
- nside = nside * 2
2793
-
2794
2766
  # Normalize the masks because they have different pixel numbers
2795
2767
  # vmask /= self.backend.bk_reduce_sum(vmask, axis=1)[:, None] # [Nmask, Npix]
2796
2768
 
@@ -4123,6 +4095,7 @@ class funct(FOC.FoCUS):
4123
4095
  get_variance=False,
4124
4096
  ref_sigma=None,
4125
4097
  iso_ang=False,
4098
+ return_table=False,
4126
4099
  ):
4127
4100
  """
4128
4101
  Calculates the scattering correlations for a batch of images, including:
@@ -4257,7 +4230,7 @@ class funct(FOC.FoCUS):
4257
4230
  )
4258
4231
  print("\n\n==========")
4259
4232
  J = Jmax # Number of steps for the loop on scales
4260
-
4233
+
4261
4234
  L = self.NORIENT
4262
4235
  norm_factor_S3 = 1.0
4263
4236
 
@@ -4826,6 +4799,12 @@ class funct(FOC.FoCUS):
4826
4799
  if data2 is None:
4827
4800
  if iso_ang:
4828
4801
  if ref_sigma is not None:
4802
+ if return_table:
4803
+ return (S1_iso / ref_sigma["S1_sigma"]), \
4804
+ (S2_iso / ref_sigma["S2_sigma"]) , \
4805
+ (S3_iso / ref_sigma["S3_sigma"]) , \
4806
+ (S4_iso / ref_sigma["S4_sigma"])
4807
+
4829
4808
  for_synthesis = self.backend.backend.cat(
4830
4809
  (
4831
4810
  mean_data / ref_sigma["std_data"],
@@ -4852,6 +4831,9 @@ class funct(FOC.FoCUS):
4852
4831
  dim=-1,
4853
4832
  )
4854
4833
  else:
4834
+ if return_table:
4835
+ return S1_iso,S2_iso,S3_iso,S4_iso
4836
+
4855
4837
  for_synthesis = self.backend.backend.cat(
4856
4838
  (
4857
4839
  mean_data / std_data,
@@ -4867,6 +4849,12 @@ class funct(FOC.FoCUS):
4867
4849
  )
4868
4850
  else:
4869
4851
  if ref_sigma is not None:
4852
+ if return_table:
4853
+ return (S1 / ref_sigma["S1_sigma"]), \
4854
+ (S2 / ref_sigma["S2_sigma"]), \
4855
+ (S3 / ref_sigma["S3_sigma"]), \
4856
+ (S4 / ref_sigma["S4_sigma"])
4857
+
4870
4858
  for_synthesis = self.backend.backend.cat(
4871
4859
  (
4872
4860
  mean_data / ref_sigma["std_data"],
@@ -4893,6 +4881,9 @@ class funct(FOC.FoCUS):
4893
4881
  dim=-1,
4894
4882
  )
4895
4883
  else:
4884
+ if return_table:
4885
+ return S1,S2,S3,S4
4886
+
4896
4887
  for_synthesis = self.backend.backend.cat(
4897
4888
  (
4898
4889
  mean_data / std_data,
@@ -4909,6 +4900,12 @@ class funct(FOC.FoCUS):
4909
4900
  else:
4910
4901
  if iso_ang:
4911
4902
  if ref_sigma is not None:
4903
+ if return_table:
4904
+ return (S1_iso / ref_sigma["S1_sigma"]), \
4905
+ (S2_iso / ref_sigma["S2_sigma"]), \
4906
+ (S3_iso / ref_sigma["S3_sigma"]), \
4907
+ (S4_iso / ref_sigma["S4_sigma"])
4908
+
4912
4909
  for_synthesis = self.backend.backend.cat(
4913
4910
  (
4914
4911
  mean_data / ref_sigma["std_data"],
@@ -4937,6 +4934,9 @@ class funct(FOC.FoCUS):
4937
4934
  dim=-1,
4938
4935
  )
4939
4936
  else:
4937
+ if return_table:
4938
+ return S1_iso,S2_iso,S3_iso,S4_iso
4939
+
4940
4940
  for_synthesis = self.backend.backend.cat(
4941
4941
  (
4942
4942
  mean_data / std_data,
@@ -4954,6 +4954,12 @@ class funct(FOC.FoCUS):
4954
4954
  )
4955
4955
  else:
4956
4956
  if ref_sigma is not None:
4957
+ if return_table:
4958
+ return (S1 / ref_sigma["S1_sigma"]), \
4959
+ (S2 / ref_sigma["S2_sigma"]), \
4960
+ (S3 / ref_sigma["S3_sigma"]), \
4961
+ (S4 / ref_sigma["S4_sigma"])
4962
+
4957
4963
  for_synthesis = self.backend.backend.cat(
4958
4964
  (
4959
4965
  mean_data / ref_sigma["std_data"],
@@ -4982,6 +4988,9 @@ class funct(FOC.FoCUS):
4982
4988
  dim=-1,
4983
4989
  )
4984
4990
  else:
4991
+ if return_table:
4992
+ return S1,S2,S3,S4
4993
+
4985
4994
  for_synthesis = self.backend.backend.cat(
4986
4995
  (
4987
4996
  mean_data / std_data,
@@ -6684,6 +6693,9 @@ class funct(FOC.FoCUS):
6684
6693
  grd_mask=l_grd_mask[k],
6685
6694
  )
6686
6695
 
6696
+ if not self.use_2D:
6697
+ self.clean_norm()
6698
+
6687
6699
  t2 = time.time()
6688
6700
  print("Total computation %.2fs" % (t2 - t1))
6689
6701
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: foscat
3
- Version: 2025.8.3
3
+ Version: 2025.8.4
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>
@@ -4,7 +4,7 @@ foscat/BkTensorflow.py,sha256=iIdLx6VTOfOEocfZBOGyizQn5geDLTfdWWAwDeQr9YA,20056
4
4
  foscat/BkTorch.py,sha256=fWkNTrgK1MkpkS-bNVmC0ihJY_WlPs98ndperSh63i8,19593
5
5
  foscat/CNN.py,sha256=4vky7jqTshL1aYLWsc-hQwf7gDjTVjL7I6HZiAsa6x4,5158
6
6
  foscat/CircSpline.py,sha256=CXi49FxF8ZoeZ17Ua8c1AZXe2B5ICEC9aCXb97atB3s,4028
7
- foscat/FoCUS.py,sha256=_PVSDd4W3surp_dolYUeo_kCd_7x8LohnosBPECvMRk,114643
7
+ foscat/FoCUS.py,sha256=iXcj6qcYaiREEcozd4xHfr983CwWFxNxvGIqEJw-JMI,114717
8
8
  foscat/GCNN.py,sha256=q7yWHCMJpP7-m3WvR3OQnp5taeYWaMxIY2hQ6SIb9gs,4487
9
9
  foscat/HOrientedConvol.py,sha256=S4Ru4holHT0ux6oMttHrKrXtxF4kGeVvoWE8AQs-RhI,21619
10
10
  foscat/HealSpline.py,sha256=YRotJ1NQuXYFyFiM8fp6qkATIwRJ8lqIVo4vGXpHO-w,7472
@@ -22,13 +22,13 @@ foscat/loss_backend_torch.py,sha256=k3z18Dj3SaLKK6ZIKcm7GO4U_YKYVP6LtHG1aIbxkYk,
22
22
  foscat/scat.py,sha256=qGYiBIysPt65MdmF07WWA4piVlTfA9-lFDTaicnqC2w,72822
23
23
  foscat/scat1D.py,sha256=W5Uu6wdQ4ZsFKXpof0f1OBl-1wjJmW7ruvddRWxe7uM,53726
24
24
  foscat/scat2D.py,sha256=boKj0ASqMMSy7uQLK6hPniG87m3hZGJBYBiq5v8F9IQ,532
25
- foscat/scat_cov.py,sha256=ZJh-aZ_XgvOvsT8aeMgyp9q8bKnUf7hQtC9AGNW4GpI,270857
25
+ foscat/scat_cov.py,sha256=QKPIjb5Tq00onp5uPX7qR6k5CoqUc_A1rrT3pDlnXyM,271522
26
26
  foscat/scat_cov1D.py,sha256=XOxsZZ5TYq8f34i2tUgIfzyaqaTDlICB3HzD2l_puro,531
27
27
  foscat/scat_cov2D.py,sha256=pAm0fKw8wyXram0TFbtw8tGcc8QPKuPXpQk0kh10r4U,7078
28
28
  foscat/scat_cov_map.py,sha256=9MzpwT2g9S3dmnjHEMK7PPLQ27oGQg2VFVsP_TDUU5E,2869
29
29
  foscat/scat_cov_map2D.py,sha256=zaIIYshXCqAeZ04I158GhD-Op4aoMlLnLEy7rxckVYY,2842
30
- foscat-2025.8.3.dist-info/licenses/LICENSE,sha256=i0ukIr8ZUpkSY2sZaE9XZK-6vuSU5iG6IgX_3pjatP8,1505
31
- foscat-2025.8.3.dist-info/METADATA,sha256=F6_v34qwWdIck5wGbKIKlrVs53dJo-SVITx8HpQf5AM,7215
32
- foscat-2025.8.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
33
- foscat-2025.8.3.dist-info/top_level.txt,sha256=AGySXBBAlJgb8Tj8af6m_F-aiNg2zNTcybCUPVOKjAg,7
34
- foscat-2025.8.3.dist-info/RECORD,,
30
+ foscat-2025.8.4.dist-info/licenses/LICENSE,sha256=i0ukIr8ZUpkSY2sZaE9XZK-6vuSU5iG6IgX_3pjatP8,1505
31
+ foscat-2025.8.4.dist-info/METADATA,sha256=ur8T9ywlSsVA5J7Bb1WwkwizQhwwaT1ncuEr4ofLYUw,7215
32
+ foscat-2025.8.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
33
+ foscat-2025.8.4.dist-info/top_level.txt,sha256=AGySXBBAlJgb8Tj8af6m_F-aiNg2zNTcybCUPVOKjAg,7
34
+ foscat-2025.8.4.dist-info/RECORD,,