foscat 2025.7.2__tar.gz → 2025.8.3__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 (39) hide show
  1. {foscat-2025.7.2/src/foscat.egg-info → foscat-2025.8.3}/PKG-INFO +1 -1
  2. {foscat-2025.7.2 → foscat-2025.8.3}/pyproject.toml +1 -1
  3. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/BkTorch.py +34 -3
  4. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/CNN.py +1 -0
  5. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/FoCUS.py +387 -165
  6. foscat-2025.8.3/src/foscat/HOrientedConvol.py +546 -0
  7. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/HealSpline.py +8 -5
  8. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/Synthesis.py +27 -18
  9. foscat-2025.8.3/src/foscat/UNET.py +200 -0
  10. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/scat_cov.py +289 -178
  11. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/scat_cov_map2D.py +1 -1
  12. {foscat-2025.7.2 → foscat-2025.8.3/src/foscat.egg-info}/PKG-INFO +1 -1
  13. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat.egg-info/SOURCES.txt +2 -0
  14. {foscat-2025.7.2 → foscat-2025.8.3}/LICENSE +0 -0
  15. {foscat-2025.7.2 → foscat-2025.8.3}/README.md +0 -0
  16. {foscat-2025.7.2 → foscat-2025.8.3}/setup.cfg +0 -0
  17. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/BkBase.py +0 -0
  18. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/BkNumpy.py +0 -0
  19. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/BkTensorflow.py +0 -0
  20. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/CircSpline.py +0 -0
  21. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/GCNN.py +0 -0
  22. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/Softmax.py +0 -0
  23. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/Spline1D.py +0 -0
  24. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/__init__.py +0 -0
  25. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/alm.py +0 -0
  26. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/backend.py +0 -0
  27. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/backend_tens.py +0 -0
  28. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/heal_NN.py +0 -0
  29. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/loss_backend_tens.py +0 -0
  30. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/loss_backend_torch.py +0 -0
  31. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/scat.py +0 -0
  32. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/scat1D.py +0 -0
  33. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/scat2D.py +0 -0
  34. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/scat_cov1D.py +0 -0
  35. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/scat_cov2D.py +0 -0
  36. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat/scat_cov_map.py +0 -0
  37. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat.egg-info/dependency_links.txt +0 -0
  38. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat.egg-info/requires.txt +0 -0
  39. {foscat-2025.7.2 → foscat-2025.8.3}/src/foscat.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: foscat
3
- Version: 2025.7.2
3
+ Version: 2025.8.3
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,6 +1,6 @@
1
1
  [project]
2
2
  name = "foscat"
3
- version = "2025.07.2"
3
+ version = "2025.08.3"
4
4
  description = "Generate synthetic Healpix or 2D data using Cross Scattering Transform"
5
5
  readme = "README.md"
6
6
  license = { text = "BSD-3-Clause" }
@@ -196,10 +196,41 @@ class BkTorch(BackendBase.BackendBase):
196
196
  y = y.reshape(*leading_dims, O_c, Nx, Ny)
197
197
 
198
198
  return y
199
-
199
+
200
200
  def conv1d(self, x, w, strides=[1, 1, 1], padding="SAME"):
201
- # to be written!!!
202
- return x
201
+ """
202
+ Performs 1D convolution along the last axis of a 2D tensor x[n, m] with kernel w[K].
203
+
204
+ Parameters:
205
+ - x: torch.Tensor of shape [n, m]
206
+ - w: torch.Tensor of shape [K]
207
+ - strides: list of 3 ints; only strides[1] (along axis -1) is used
208
+ - padding: "SAME" or "VALID"
209
+
210
+ Returns:
211
+ - torch.Tensor of shape [n, m] (if SAME) or smaller (if VALID)
212
+ """
213
+ assert x.ndim == 2, "Input x must be a 2D tensor [n, m]"
214
+ assert w.ndim == 1, "Kernel w must be a 1D tensor [K]"
215
+ stride = strides[1]
216
+
217
+ # Reshape for PyTorch conv1d: [batch, channels, width]
218
+ x_reshaped = x.unsqueeze(1) # [n, 1, m]
219
+ w_flipped = w.flip(0).view(1, 1, -1) # [out_channels=1, in_channels=1, kernel_size]
220
+
221
+ if padding.upper() == "SAME":
222
+ pad_total = w.shape[0] - 1
223
+ pad_left = pad_total // 2
224
+ pad_right = pad_total - pad_left
225
+ x_reshaped = F.pad(x_reshaped, (pad_left, pad_right), mode='constant', value=0)
226
+ padding_mode = 'valid'
227
+ elif padding.upper() == "VALID":
228
+ padding_mode = 'valid'
229
+ else:
230
+ raise ValueError("padding must be either 'SAME' or 'VALID'")
231
+
232
+ out = F.conv1d(x_reshaped, w_flipped, stride=stride, padding=0) # manual padding applied above
233
+ return out.squeeze(1) # [n, m_out]
203
234
 
204
235
  def bk_threshold(self, x, threshold, greater=True):
205
236
 
@@ -91,6 +91,7 @@ class CNN:
91
91
  def get_weights(self):
92
92
  return self.x
93
93
 
94
+
94
95
  def eval(self, im, indices=None, weights=None):
95
96
 
96
97
  x = self.x