foscat 2025.9.4__tar.gz → 2025.9.5__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-2025.9.4/src/foscat.egg-info → foscat-2025.9.5}/PKG-INFO +1 -1
- {foscat-2025.9.4 → foscat-2025.9.5}/pyproject.toml +1 -1
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/FoCUS.py +1 -1
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/Plot.py +55 -14
- {foscat-2025.9.4 → foscat-2025.9.5/src/foscat.egg-info}/PKG-INFO +1 -1
- {foscat-2025.9.4 → foscat-2025.9.5}/LICENSE +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/README.md +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/setup.cfg +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/BkBase.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/BkNumpy.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/BkTensorflow.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/BkTorch.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/CNN.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/CircSpline.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/GCNN.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/HOrientedConvol.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/HealBili.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/HealSpline.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/Softmax.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/SphericalStencil.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/Spline1D.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/Synthesis.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/UNET.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/__init__.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/alm.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/backend.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/backend_tens.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/heal_NN.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/healpix_unet_torch.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/loss_backend_tens.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/loss_backend_torch.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/scat.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/scat1D.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/scat2D.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/scat_cov.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/scat_cov1D.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/scat_cov2D.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/scat_cov_map.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat/scat_cov_map2D.py +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat.egg-info/SOURCES.txt +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat.egg-info/dependency_links.txt +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/src/foscat.egg-info/requires.txt +0 -0
- {foscat-2025.9.4 → foscat-2025.9.5}/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.9.
|
|
3
|
+
Version: 2025.9.5
|
|
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>
|
|
@@ -1065,28 +1065,69 @@ def _spectrum_polar_to_cartesian_core(
|
|
|
1065
1065
|
valid = np.isfinite(radial_index)
|
|
1066
1066
|
try:
|
|
1067
1067
|
from scipy.ndimage import map_coordinates
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
w
|
|
1075
|
-
|
|
1076
|
-
|
|
1068
|
+
|
|
1069
|
+
if method.lower() == "bicubic":
|
|
1070
|
+
# ===== Bicubic with circular angular wrap =====
|
|
1071
|
+
# Pad the angular axis by K columns on both sides so that the cubic kernel
|
|
1072
|
+
# has valid neighbors across the 0°/360° seam. K=2 is enough for a cubic kernel.
|
|
1073
|
+
K = 2
|
|
1074
|
+
# w has shape (Nscale, Norient)
|
|
1075
|
+
w_pad = np.concatenate([w[:, -K:], w, w[:, :K]], axis=1) # (ns, no+2K)
|
|
1076
|
+
|
|
1077
|
+
# Build coordinates for map_coordinates on the padded array:
|
|
1078
|
+
# - radial index stays the same, clipped to [0, ns-1] (no wrap)
|
|
1079
|
+
# - angular index is shifted by +K and wrapped into [0, no) before querying
|
|
1080
|
+
order = 3
|
|
1081
|
+
coords = np.vstack([radial_index.ravel(), angular_index.ravel()])
|
|
1082
|
+
|
|
1083
|
+
# clip the radial coordinate to the valid [eps, ns-1-eps] band
|
|
1084
|
+
eps = 1e-6
|
|
1085
|
+
coords[0, :] = np.where(
|
|
1086
|
+
np.isfinite(coords[0, :]),
|
|
1087
|
+
np.clip(coords[0, :], 0.0 + eps, (ns - 1) - eps),
|
|
1088
|
+
0.0,
|
|
1089
|
+
)
|
|
1090
|
+
|
|
1091
|
+
# wrap angular coordinate to [0, no) then shift by +K to address the padded array
|
|
1092
|
+
ang = np.mod(coords[1, :], float(no)) + K # [K, no+K)
|
|
1093
|
+
coords[1, :] = ang
|
|
1094
|
+
|
|
1095
|
+
# Now sample the padded array; 'nearest' mode is fine thanks to explicit padding
|
|
1096
|
+
sampled = map_coordinates(
|
|
1097
|
+
w_pad, coords, order=order, mode="nearest", cval=fill_value, prefilter=True
|
|
1098
|
+
).reshape(n_pixels, n_pixels)
|
|
1099
|
+
|
|
1100
|
+
img = np.where(valid, sampled, fill_value)
|
|
1101
|
+
|
|
1102
|
+
else:
|
|
1103
|
+
# ===== Bilinear (or other) without special padding =====
|
|
1104
|
+
order = 1
|
|
1105
|
+
coords = np.vstack([radial_index.ravel(), angular_index.ravel()])
|
|
1106
|
+
eps = 1e-6
|
|
1107
|
+
coords[0, :] = np.where(
|
|
1108
|
+
np.isfinite(coords[0, :]),
|
|
1109
|
+
np.clip(coords[0, :], 0.0 + eps, (ns - 1) - eps),
|
|
1110
|
+
0.0,
|
|
1111
|
+
)
|
|
1112
|
+
# For non-bicubic, SciPy's mode="wrap" is sufficient on the angular axis
|
|
1113
|
+
sampled = map_coordinates(
|
|
1114
|
+
w, coords, order=order, mode="wrap", cval=fill_value, prefilter=True
|
|
1115
|
+
).reshape(n_pixels, n_pixels)
|
|
1116
|
+
img = np.where(valid, sampled, fill_value)
|
|
1117
|
+
|
|
1077
1118
|
except Exception:
|
|
1078
|
-
# bilinear fallback
|
|
1119
|
+
# ---- Vectorized bilinear fallback with explicit angular wrap ----
|
|
1079
1120
|
r_idx = np.floor(radial_index).astype(np.int64)
|
|
1080
1121
|
t_idx = np.floor(angular_index).astype(np.int64)
|
|
1081
|
-
r_idx = np.clip(r_idx, 0, ns-2)
|
|
1122
|
+
r_idx = np.clip(r_idx, 0, ns - 2)
|
|
1082
1123
|
t0 = np.mod(t_idx, no)
|
|
1083
|
-
t1 = np.mod(t_idx+1, no)
|
|
1124
|
+
t1 = np.mod(t_idx + 1, no)
|
|
1084
1125
|
tr = np.clip(radial_index - r_idx, 0.0, 1.0)
|
|
1085
1126
|
ta = np.clip(angular_index - t_idx, 0.0, 1.0)
|
|
1086
1127
|
f00 = w[r_idx, t0]
|
|
1087
1128
|
f01 = w[r_idx, t1]
|
|
1088
|
-
f10 = w[r_idx+1,
|
|
1089
|
-
f11 = w[r_idx+1,
|
|
1129
|
+
f10 = w[r_idx + 1, t0]
|
|
1130
|
+
f11 = w[r_idx + 1, t1]
|
|
1090
1131
|
g0 = (1.0 - ta) * f00 + ta * f01
|
|
1091
1132
|
g1 = (1.0 - ta) * f10 + ta * f11
|
|
1092
1133
|
img = (1.0 - tr) * g0 + tr * g1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: foscat
|
|
3
|
-
Version: 2025.9.
|
|
3
|
+
Version: 2025.9.5
|
|
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>
|
|
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
|
|
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
|