foscat 2025.11.1__py3-none-any.whl → 2026.2.1__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 +71 -16
- foscat/SphereDownGeo.py +380 -0
- foscat/SphereUpGeo.py +175 -0
- foscat/SphericalStencil.py +27 -246
- foscat/alm_loc.py +270 -0
- foscat/healpix_vit_torch-old.py +658 -0
- foscat/scat_cov.py +24 -24
- {foscat-2025.11.1.dist-info → foscat-2026.2.1.dist-info}/METADATA +1 -69
- {foscat-2025.11.1.dist-info → foscat-2026.2.1.dist-info}/RECORD +12 -8
- {foscat-2025.11.1.dist-info → foscat-2026.2.1.dist-info}/WHEEL +1 -1
- {foscat-2025.11.1.dist-info → foscat-2026.2.1.dist-info}/licenses/LICENSE +0 -0
- {foscat-2025.11.1.dist-info → foscat-2026.2.1.dist-info}/top_level.txt +0 -0
foscat/scat_cov.py
CHANGED
|
@@ -2419,13 +2419,13 @@ class funct(FOC.FoCUS):
|
|
|
2419
2419
|
if smooth_scale > 0:
|
|
2420
2420
|
for m in range(smooth_scale):
|
|
2421
2421
|
if cc.shape[0] > 12:
|
|
2422
|
-
cc, _ = self.ud_grade_2(
|
|
2423
|
-
ss, _ = self.ud_grade_2(
|
|
2422
|
+
cc, _ = self.ud_grade_2(cc)
|
|
2423
|
+
ss, _ = self.ud_grade_2(ss)
|
|
2424
2424
|
|
|
2425
2425
|
if cc.shape[-1] != tmp.shape[-1]:
|
|
2426
2426
|
ll_nside = int(np.sqrt(tmp.shape[-1] // 12))
|
|
2427
|
-
cc = self.up_grade(cc, ll_nside)
|
|
2428
|
-
ss = self.up_grade(ss, ll_nside)
|
|
2427
|
+
cc = self.up_grade(self.backend.bk_cast(cc), ll_nside)
|
|
2428
|
+
ss = self.up_grade(self.backend.bk_cast(ss), ll_nside)
|
|
2429
2429
|
|
|
2430
2430
|
# compute local phase from weighted cos and sin (same as before)
|
|
2431
2431
|
if self.BACKEND == "numpy":
|
|
@@ -2518,13 +2518,13 @@ class funct(FOC.FoCUS):
|
|
|
2518
2518
|
if smooth_scale > 0:
|
|
2519
2519
|
for m in range(smooth_scale):
|
|
2520
2520
|
if cc2.shape[1] > 12:
|
|
2521
|
-
cc2, _ = self.ud_grade_2(
|
|
2522
|
-
ss2, _ = self.ud_grade_2(
|
|
2521
|
+
cc2, _ = self.ud_grade_2(cc2)
|
|
2522
|
+
ss2, _ = self.ud_grade_2(ss2)
|
|
2523
2523
|
|
|
2524
2524
|
if cc2.shape[-1] != sim.shape[-1]:
|
|
2525
2525
|
ll_nside = int(np.sqrt(sim.shape[-1] // 12))
|
|
2526
|
-
cc2 = self.up_grade(cc2, ll_nside)
|
|
2527
|
-
ss2 = self.up_grade(ss2, ll_nside)
|
|
2526
|
+
cc2 = self.up_grade(self.backend.bk_cast(cc2), ll_nside)
|
|
2527
|
+
ss2 = self.up_grade(self.backend.bk_cast(ss2), ll_nside)
|
|
2528
2528
|
|
|
2529
2529
|
if self.BACKEND == "numpy":
|
|
2530
2530
|
phase2 = np.fmod(np.arctan2(ss2, cc2) + 2 * np.pi, 2 * np.pi)
|
|
@@ -2701,7 +2701,7 @@ class funct(FOC.FoCUS):
|
|
|
2701
2701
|
if nside is None:
|
|
2702
2702
|
nside = int(np.sqrt(npix // 12))
|
|
2703
2703
|
|
|
2704
|
-
J = int(np.
|
|
2704
|
+
J = int(np.log2(nside)+1) # Number of j scales
|
|
2705
2705
|
if cell_ids is not None:
|
|
2706
2706
|
J=np.min([J,int(np.log(cell_ids.shape[0]) / (2*np.log(2)))-1])
|
|
2707
2707
|
|
|
@@ -2712,7 +2712,7 @@ class funct(FOC.FoCUS):
|
|
|
2712
2712
|
if Jmax > J:
|
|
2713
2713
|
print("==========\n\n")
|
|
2714
2714
|
print(
|
|
2715
|
-
"The Jmax you requested is larger than the data size, which may cause problems while computing the scattering transform."
|
|
2715
|
+
"The Jmax you requested is larger than the data size ", J,", which may cause problems while computing the scattering transform."
|
|
2716
2716
|
)
|
|
2717
2717
|
print("\n\n==========")
|
|
2718
2718
|
|
|
@@ -2742,7 +2742,7 @@ class funct(FOC.FoCUS):
|
|
|
2742
2742
|
# if the kernel size is bigger than 3 increase the binning before smoothing
|
|
2743
2743
|
if self.use_2D:
|
|
2744
2744
|
vmask = self.up_grade(
|
|
2745
|
-
vmask, I1.shape[-2] * 2, nouty=I1.shape[-1] * 2,axis=-2
|
|
2745
|
+
self.backend.bk_cast(vmask), I1.shape[-2] * 2, nouty=I1.shape[-1] * 2,axis=-2
|
|
2746
2746
|
)
|
|
2747
2747
|
I1 = self.up_grade(
|
|
2748
2748
|
I1, I1.shape[-2] * 2, nouty=I1.shape[-1] * 2,axis=-2
|
|
@@ -3550,14 +3550,14 @@ class funct(FOC.FoCUS):
|
|
|
3550
3550
|
### Image I1,
|
|
3551
3551
|
# downscale the I1 [Nbatch, Npix_j3]
|
|
3552
3552
|
if j3 != Jmax - 1:
|
|
3553
|
-
I1 = self.smooth(I1, cell_ids=cell_ids_j3, nside=nside_j3)
|
|
3553
|
+
#I1 = self.smooth(I1, cell_ids=cell_ids_j3, nside=nside_j3)
|
|
3554
3554
|
I1, new_cell_ids_j3 = self.ud_grade_2(
|
|
3555
3555
|
I1, cell_ids=cell_ids_j3, nside=nside_j3
|
|
3556
3556
|
)
|
|
3557
3557
|
|
|
3558
3558
|
### Image I2
|
|
3559
3559
|
if cross:
|
|
3560
|
-
I2 = self.smooth(I2, cell_ids=cell_ids_j3, nside=nside_j3)
|
|
3560
|
+
#I2 = self.smooth(I2, cell_ids=cell_ids_j3, nside=nside_j3)
|
|
3561
3561
|
I2, new_cell_ids_j3 = self.ud_grade_2(
|
|
3562
3562
|
I2, cell_ids=cell_ids_j3, nside=nside_j3
|
|
3563
3563
|
)
|
|
@@ -3565,20 +3565,20 @@ class funct(FOC.FoCUS):
|
|
|
3565
3565
|
### Modules
|
|
3566
3566
|
for j2 in range(0, j3 + 1): # j2 =< j3
|
|
3567
3567
|
### Dictionary M1_dic[j2]
|
|
3568
|
-
M1_smooth = self.smooth(
|
|
3569
|
-
|
|
3570
|
-
) # [Nbatch, Npix_j3, Norient3]
|
|
3568
|
+
#M1_smooth = self.smooth(
|
|
3569
|
+
# M1_dic[j2], cell_ids=cell_ids_j3, nside=nside_j3
|
|
3570
|
+
#) # [Nbatch, Npix_j3, Norient3]
|
|
3571
3571
|
M1_dic[j2], new_cell_ids_j2 = self.ud_grade_2(
|
|
3572
|
-
|
|
3572
|
+
M1_dic[j2], cell_ids=cell_ids_j3, nside=nside_j3
|
|
3573
3573
|
) # [Nbatch, Npix_j3, Norient3]
|
|
3574
3574
|
|
|
3575
3575
|
### Dictionary M2_dic[j2]
|
|
3576
3576
|
if cross:
|
|
3577
|
-
M2_smooth = self.smooth(
|
|
3578
|
-
|
|
3579
|
-
) # [Nbatch, Npix_j3, Norient3]
|
|
3577
|
+
#M2_smooth = self.smooth(
|
|
3578
|
+
# M2_dic[j2], cell_ids=cell_ids_j3, nside=nside_j3
|
|
3579
|
+
#) # [Nbatch, Npix_j3, Norient3]
|
|
3580
3580
|
M2_dic[j2], new_cell_ids_j2 = self.ud_grade_2(
|
|
3581
|
-
|
|
3581
|
+
M2_dic[j2], cell_ids=cell_ids_j3, nside=nside_j3
|
|
3582
3582
|
) # [Nbatch, Npix_j3, Norient3]
|
|
3583
3583
|
### Mask
|
|
3584
3584
|
vmask, new_cell_ids_j3 = self.ud_grade_2(
|
|
@@ -6571,15 +6571,15 @@ class funct(FOC.FoCUS):
|
|
|
6571
6571
|
# Increase the resolution between each step
|
|
6572
6572
|
if self.use_2D:
|
|
6573
6573
|
imap = self.up_grade(
|
|
6574
|
-
omap,
|
|
6574
|
+
self.backend.bk_cast(omap),
|
|
6575
6575
|
imap.shape[1] * 2,
|
|
6576
6576
|
axis=-2,
|
|
6577
6577
|
nouty=imap.shape[2] * 2
|
|
6578
6578
|
)
|
|
6579
6579
|
elif self.use_1D:
|
|
6580
|
-
imap = self.up_grade(omap, imap.shape[1] * 2)
|
|
6580
|
+
imap = self.up_grade(self.backend.bk_cast(omap), imap.shape[1] * 2)
|
|
6581
6581
|
else:
|
|
6582
|
-
imap = self.up_grade(omap, l_nside)
|
|
6582
|
+
imap = self.up_grade(self.backend.bk_cast(omap), l_nside)
|
|
6583
6583
|
|
|
6584
6584
|
if grd_mask is not None:
|
|
6585
6585
|
imap = imap * l_grd_mask[k] + tmp[k] * (1 - l_grd_mask[k])
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: foscat
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2026.2.1
|
|
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>
|
|
@@ -91,74 +91,6 @@ git clone https://github.com/jmdelouis/FOSCAT_DEMO.git
|
|
|
91
91
|
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
-
# Spherical data example
|
|
95
|
-
|
|
96
|
-
## compute a synthetic image
|
|
97
|
-
|
|
98
|
-
```
|
|
99
|
-
python demo.py -n=32 -k -c -s=100
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
The _demo.py_ script serves as a demonstration of the capabilities of the foscat library. It utilizes the Cross Wavelet Scattering Transform to generate a Healpix map that possesses the same characteristics as a specified input map.
|
|
103
|
-
|
|
104
|
-
- `-n=32` computes map with nside=32.
|
|
105
|
-
- `-k` uses 5x5 kernel.
|
|
106
|
-
- `-c` uses Scattering Covariance.
|
|
107
|
-
- `-l` uses LBFGS minimizer.
|
|
108
|
-
- `-s=100` computes 100 steps.
|
|
109
|
-
|
|
110
|
-
```
|
|
111
|
-
python demo.py -n=8 [-c|--cov][-s|--steps=3000][-S=1234|--seed=1234][-k|--k5x5][-d|--data][-o|--out][-r|--orient] [-p|--path][-a|--adam]
|
|
112
|
-
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
- The "-n" option specifies the nside of the input map. The maximum nside value is 256 with the default map.
|
|
116
|
-
- The "--cov" option (optional) uses scat_cov instead of scat.
|
|
117
|
-
- The "--steps" option (optional) specifies the number of iterations. If not specified, the default value is 1000.
|
|
118
|
-
- The "--seed" option (optional) specifies the seed of the random generator.
|
|
119
|
-
- The "--path" option (optional) allows you to define the path where the output files will be written. The default path is "data".
|
|
120
|
-
- The "--k5x5" option (optional) uses a 5x5 kernel instead of a 3x3.
|
|
121
|
-
- The "--data" option (optional) specifies the input data file to be used. If not specified, the default file "LSS_map_nside128.npy" will be used.
|
|
122
|
-
- The "--out" option (optional) specifies the output file name. If not specified, the output file will be saved in "demo".
|
|
123
|
-
- The "--orient" option (optional) specifies the number of orientations. If not specified, the default value is 4.
|
|
124
|
-
- The "--adam" option (optional) makes the synthesis using the ADAM optimizer instead of the L_BFGS.
|
|
125
|
-
|
|
126
|
-
## plot the result
|
|
127
|
-
|
|
128
|
-
The following script generates a series of plots that showcase different aspects of the synthesis process using the _demo.py_ script.
|
|
129
|
-
|
|
130
|
-
> python test2D.py
|
|
131
|
-
|
|
132
|
-
```
|
|
133
|
-
python plotdemo.py -n=32 -c
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
# 2D field demo
|
|
137
|
-
|
|
138
|
-
> python test2Dplot.py
|
|
139
|
-
|
|
140
|
-
# compute a synthetic turbulent field
|
|
141
|
-
|
|
142
|
-
The python scripts _demo2D.py_ included in this package demonstrate how to use the foscat library to generate a 2D synthetic fields that have patterns with the same statistical properties as a specified 2D image. In this particular case, the input field is a sea surface temperature extracted from a north atlantic ocean simulation.
|
|
143
|
-
|
|
144
|
-
> python testHealpix.py
|
|
145
|
-
|
|
146
|
-
```
|
|
147
|
-
python demo2d.py -n=32 -k -c
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
> python testHplot.py
|
|
151
|
-
|
|
152
|
-
The following script generates a series of plots that showcase different aspects of the synthesis process using the _demo2D.py_ script.
|
|
153
|
-
|
|
154
|
-
```
|
|
155
|
-
python plotdemo2d.py -n=32 -c
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
For more information, see the [documentation](https://foscat-documentation.readthedocs.io/en/latest/index.html).
|
|
159
|
-
|
|
160
|
-
> mpirun -np 3 testHealpix_mpi.py
|
|
161
|
-
|
|
162
94
|
## Authors and acknowledgment
|
|
163
95
|
|
|
164
96
|
Authors: J.-M. Delouis, P. Campeti, T. Foulquier, J. Mangin, L. Mousset, T. Odaka, F. Paul, E. Allys
|
|
@@ -4,24 +4,28 @@ foscat/BkTensorflow.py,sha256=iIdLx6VTOfOEocfZBOGyizQn5geDLTfdWWAwDeQr9YA,20056
|
|
|
4
4
|
foscat/BkTorch.py,sha256=9utOTAfS99E7DPN0QfCnn5ULS1WdS4z3-Z0XJMriJY4,53202
|
|
5
5
|
foscat/CNN.py,sha256=4vky7jqTshL1aYLWsc-hQwf7gDjTVjL7I6HZiAsa6x4,5158
|
|
6
6
|
foscat/CircSpline.py,sha256=CXi49FxF8ZoeZ17Ua8c1AZXe2B5ICEC9aCXb97atB3s,4028
|
|
7
|
-
foscat/FoCUS.py,sha256=
|
|
7
|
+
foscat/FoCUS.py,sha256=HxXh9jHGtopt-jtYAz_dx4GH-88tALY6yZ30kkbDIHM,109790
|
|
8
8
|
foscat/GCNN.py,sha256=q7yWHCMJpP7-m3WvR3OQnp5taeYWaMxIY2hQ6SIb9gs,4487
|
|
9
9
|
foscat/HOrientedConvol.py,sha256=xMaS-zzoUyXisBCPsHBVpn54tuA9Qv3na-tT86Cwn7U,38744
|
|
10
10
|
foscat/HealBili.py,sha256=YRPk9PO5G8NdwKeb33xiJs3_pMPAgIv5phCs8GT6LN0,12943
|
|
11
11
|
foscat/HealSpline.py,sha256=YRotJ1NQuXYFyFiM8fp6qkATIwRJ8lqIVo4vGXpHO-w,7472
|
|
12
12
|
foscat/Plot.py,sha256=bpohWGsblTBxMrqE_X-iRvuvT-YyHDcgfWB4iYk5l10,49218
|
|
13
13
|
foscat/Softmax.py,sha256=UDZGrTroYtmGEyokGUVpwNO_cgbICi9QVuRr8Yx52_k,2917
|
|
14
|
-
foscat/
|
|
14
|
+
foscat/SphereDownGeo.py,sha256=B_ENfL4Mqn6VmpXEGGxEW8DR3R6zCNV-YVtsU00xwjY,15380
|
|
15
|
+
foscat/SphereUpGeo.py,sha256=KvvXqVRW7eX79MJsJJS6g5ll84Qyx0bLZzQaDXy4fp4,7023
|
|
16
|
+
foscat/SphericalStencil.py,sha256=kRyQXwZyoxdRW326e2ht8eGzg1-Lvl89tdHSpVTfJzg,47620
|
|
15
17
|
foscat/Spline1D.py,sha256=rKzzenduaZZ-yBDJd35it6Gyrj1spqb7hoIaUgISPzY,2983
|
|
16
18
|
foscat/Synthesis.py,sha256=ClrUkSKm2426ZX56dHoepoSQ2rJvwTXQnPPtlC2cESY,14174
|
|
17
19
|
foscat/UNET.py,sha256=2vtJKFeNS6PtUjUblT50dOsk3XXBTJ5IvbJexQTOWug,19372
|
|
18
20
|
foscat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
21
|
foscat/alm.py,sha256=XkK4rFVRoO-oJpr74iBffKt7hdS_iJkR016IlYm10gQ,33832
|
|
22
|
+
foscat/alm_loc.py,sha256=erExGZ-x_x7qJOvpccPdzaeUlqVmZAOhy-dvDgcsD64,10736
|
|
20
23
|
foscat/backend.py,sha256=l3aMwDyXP6jURMIvratFMGWCTcQpaR68KnUuuGDezqE,45418
|
|
21
24
|
foscat/backend_tens.py,sha256=9Dp136m9frkclkwifJQLLbIpl3ETI3_txdPUZcKfuMw,1618
|
|
22
25
|
foscat/heal_NN.py,sha256=krEHM9NMZ74T9HUf-qK5td0tFttBA5SbaRgzThM2GYs,16943
|
|
23
26
|
foscat/healpix_unet_torch.py,sha256=CDdrWyPJqF_gUT6rwB-TnghsbtkJ89WFw-K14m37DDQ,52221
|
|
24
27
|
foscat/healpix_vit_skip.py,sha256=26qpYoX7W1vCJujqtYUiRPUmwrDf_UJSN5kbL7DVV8I,20359
|
|
28
|
+
foscat/healpix_vit_torch-old.py,sha256=_PJecWRIWJc2FTQB_rthEeqLKYJ_UIdTN8ib_JuQ_xw,28985
|
|
25
29
|
foscat/healpix_vit_torch.py,sha256=XOqEOazob6WRptSD5dh5acWM_1_uErKXaVWPm08X-O0,22198
|
|
26
30
|
foscat/loss_backend_tens.py,sha256=dCOVN6faDtIpN3VO78HTmYP2i5fnFAf-Ddy5qVBlGrM,1783
|
|
27
31
|
foscat/loss_backend_torch.py,sha256=k3z18Dj3SaLKK6ZIKcm7GO4U_YKYVP6LtHG1aIbxkYk,1627
|
|
@@ -29,14 +33,14 @@ foscat/planar_vit.py,sha256=lQqwyz_P8G-Dav2vLqgkssDfeSe15YmjFzP5W-otjs0,6888
|
|
|
29
33
|
foscat/scat.py,sha256=emN7MsSuoJzPWQfgDETScZeKLmu8K-jjEh5Dp7szQzY,72809
|
|
30
34
|
foscat/scat1D.py,sha256=FvvxwhlzxwvIETkenpisvDteJ06DBYP5K7wsnJ2nHjM,53713
|
|
31
35
|
foscat/scat2D.py,sha256=boKj0ASqMMSy7uQLK6hPniG87m3hZGJBYBiq5v8F9IQ,532
|
|
32
|
-
foscat/scat_cov.py,sha256=
|
|
36
|
+
foscat/scat_cov.py,sha256=R_-S1RLz6_TUUPGyZO9aenSfRWIzF-Ber5W3-LbdLwU,271770
|
|
33
37
|
foscat/scat_cov1D.py,sha256=XOxsZZ5TYq8f34i2tUgIfzyaqaTDlICB3HzD2l_puro,531
|
|
34
38
|
foscat/scat_cov2D.py,sha256=pAm0fKw8wyXram0TFbtw8tGcc8QPKuPXpQk0kh10r4U,7078
|
|
35
39
|
foscat/scat_cov_map.py,sha256=9MzpwT2g9S3dmnjHEMK7PPLQ27oGQg2VFVsP_TDUU5E,2869
|
|
36
40
|
foscat/scat_cov_map2D.py,sha256=zaIIYshXCqAeZ04I158GhD-Op4aoMlLnLEy7rxckVYY,2842
|
|
37
41
|
foscat/unet_2_d_from_healpix_params.py,sha256=r8hN-s091f3yHYlvAAiBbLOvtsz9vPrdwrWPM0ULR2Q,15949
|
|
38
|
-
foscat-
|
|
39
|
-
foscat-
|
|
40
|
-
foscat-
|
|
41
|
-
foscat-
|
|
42
|
-
foscat-
|
|
42
|
+
foscat-2026.2.1.dist-info/licenses/LICENSE,sha256=i0ukIr8ZUpkSY2sZaE9XZK-6vuSU5iG6IgX_3pjatP8,1505
|
|
43
|
+
foscat-2026.2.1.dist-info/METADATA,sha256=bj4y6lKOf7qwfFrR6KdRt_8GWXh6W3q0fkHKMo6fSD8,4489
|
|
44
|
+
foscat-2026.2.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
45
|
+
foscat-2026.2.1.dist-info/top_level.txt,sha256=AGySXBBAlJgb8Tj8af6m_F-aiNg2zNTcybCUPVOKjAg,7
|
|
46
|
+
foscat-2026.2.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|