foscat 3.2.0__py3-none-any.whl → 3.3.0__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/CircSpline.py +61 -40
- foscat/FoCUS.py +3 -3
- foscat/Softmax.py +1 -1
- foscat/Spline1D.py +88 -42
- foscat/Synthesis.py +23 -9
- foscat/alm.py +134 -0
- foscat/backend.py +44 -25
- foscat/backend_tens.py +2 -1
- foscat/loss_backend_torch.py +0 -1
- foscat/scat.py +15 -6
- foscat/scat1D.py +15 -6
- foscat/scat_cov.py +993 -931
- foscat/scat_cov1D.py +2 -2
- foscat/scat_cov2D.py +2 -2
- foscat/scat_cov_map.py +16 -16
- foscat/scat_cov_map2D.py +16 -16
- {foscat-3.2.0.dist-info → foscat-3.3.0.dist-info}/METADATA +39 -30
- foscat-3.3.0.dist-info/RECORD +26 -0
- {foscat-3.2.0.dist-info → foscat-3.3.0.dist-info}/WHEEL +1 -1
- foscat/scat_cov1D.old.py +0 -1547
- foscat-3.2.0.dist-info/RECORD +0 -26
- {foscat-3.2.0.dist-info → foscat-3.3.0.dist-info}/LICENCE +0 -0
- {foscat-3.2.0.dist-info → foscat-3.3.0.dist-info}/top_level.txt +0 -0
foscat/scat_cov1D.py
CHANGED
|
@@ -2,9 +2,9 @@ import foscat.scat_cov as scat
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
class scat_cov1D:
|
|
5
|
-
def __init__(self, s0,
|
|
5
|
+
def __init__(self, s0, s2, s3, s4, s1=None, s3p=None, backend=None):
|
|
6
6
|
|
|
7
|
-
the_scat = scat(s0,
|
|
7
|
+
the_scat = scat(s0, s2, s3, s4, s1=s1, s3p=s3p, backend=self.backend)
|
|
8
8
|
the_scat.set_bk_type("SCAT_COV1D")
|
|
9
9
|
return the_scat
|
|
10
10
|
|
foscat/scat_cov2D.py
CHANGED
|
@@ -2,9 +2,9 @@ import foscat.scat_cov as scat
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
class scat_cov2D:
|
|
5
|
-
def __init__(self, s0,
|
|
5
|
+
def __init__(self, s0, s2, s3, s4, s1=None, s3p=None, backend=None):
|
|
6
6
|
|
|
7
|
-
the_scat = scat(s0,
|
|
7
|
+
the_scat = scat(s0, s2, s3, s4, s1=s1, s3p=s3p, backend=self.backend)
|
|
8
8
|
the_scat.set_bk_type("SCAT_COV2D")
|
|
9
9
|
return the_scat
|
|
10
10
|
|
foscat/scat_cov_map.py
CHANGED
|
@@ -4,14 +4,14 @@ import foscat.scat_cov as scat
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
class scat_cov_map(scat.funct):
|
|
7
|
-
def __init__(self,
|
|
7
|
+
def __init__(self, S2, S0, S3, S4, S1=None, S3P=None, backend=None):
|
|
8
8
|
|
|
9
|
-
self.
|
|
9
|
+
self.S2 = S2
|
|
10
10
|
self.S0 = S0
|
|
11
11
|
self.S1 = S1
|
|
12
|
-
self.
|
|
13
|
-
self.
|
|
14
|
-
self.
|
|
12
|
+
self.S3 = S3
|
|
13
|
+
self.S3P = S3P
|
|
14
|
+
self.S4 = S4
|
|
15
15
|
self.backend = backend
|
|
16
16
|
self.bk_type = "SCAT_COV_MAP2D"
|
|
17
17
|
|
|
@@ -30,30 +30,30 @@ class funct(scat.funct):
|
|
|
30
30
|
image1, image2=image2, mask=mask, norm=norm, Auto=Auto, calc_var=calc_var
|
|
31
31
|
)
|
|
32
32
|
return scat_cov_map(
|
|
33
|
-
r.
|
|
33
|
+
r.S2, r.S0, r.S3, r.S4, S1=r.S1, S3P=r.S3P, backend=r.backend
|
|
34
34
|
)
|
|
35
35
|
|
|
36
36
|
def scat_coeffs_apply(
|
|
37
37
|
self, scat, method, no_order_1=False, no_order_2=False, no_order_3=False
|
|
38
38
|
):
|
|
39
|
-
for j in scat.
|
|
39
|
+
for j in scat.S2:
|
|
40
40
|
if not no_order_1:
|
|
41
|
-
scat.
|
|
41
|
+
scat.S2[j] = method(scat.S2[j])
|
|
42
42
|
if scat.S1 is not None:
|
|
43
43
|
scat.S1[j] = method(scat.S1[j])
|
|
44
44
|
|
|
45
45
|
if not no_order_2:
|
|
46
|
-
for n1 in scat.
|
|
47
|
-
scat.
|
|
46
|
+
for n1 in scat.S3[j]:
|
|
47
|
+
scat.S3[j][n1] = method(scat.S3[j][n1])
|
|
48
48
|
|
|
49
|
-
if scat.
|
|
50
|
-
for n1 in scat.
|
|
51
|
-
scat.
|
|
49
|
+
if scat.S3P is not None:
|
|
50
|
+
for n1 in scat.S3P[j]:
|
|
51
|
+
scat.S3P[j][n1] = method(scat.S3P[j][n1])
|
|
52
52
|
|
|
53
53
|
if not no_order_3:
|
|
54
|
-
for n1 in scat.
|
|
55
|
-
for n2 in scat.
|
|
56
|
-
scat.
|
|
54
|
+
for n1 in scat.S4[j]:
|
|
55
|
+
for n2 in scat.S4[j][n1]:
|
|
56
|
+
scat.S4[j][n1][n2] = method(scat.S4[j][n1][n2])
|
|
57
57
|
|
|
58
58
|
def scat_ud_grade_2(
|
|
59
59
|
self, scat, no_order_1=False, no_order_2=False, no_order_3=False
|
foscat/scat_cov_map2D.py
CHANGED
|
@@ -2,14 +2,14 @@ import foscat.scat_cov as scat
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
class scat_cov_map(scat.funct):
|
|
5
|
-
def __init__(self,
|
|
5
|
+
def __init__(self, S2, S0, S3, S4, S1=None, S3P=None, backend=None):
|
|
6
6
|
|
|
7
|
-
self.
|
|
7
|
+
self.S2 = S2
|
|
8
8
|
self.S0 = S0
|
|
9
9
|
self.S1 = S1
|
|
10
|
-
self.
|
|
11
|
-
self.
|
|
12
|
-
self.
|
|
10
|
+
self.S3 = S3
|
|
11
|
+
self.S3P = S3P
|
|
12
|
+
self.S4 = S4
|
|
13
13
|
self.backend = backend
|
|
14
14
|
self.bk_type = "SCAT_COV_MAP2D"
|
|
15
15
|
|
|
@@ -29,30 +29,30 @@ class funct(scat.funct):
|
|
|
29
29
|
image1, image2=image2, mask=mask, norm=norm, Auto=Auto, calc_var=calc_var
|
|
30
30
|
)
|
|
31
31
|
return scat_cov_map(
|
|
32
|
-
r.
|
|
32
|
+
r.S2, r.S0, r.S3, r.S4, S1=r.S1, S3P=r.S3P, backend=r.backend
|
|
33
33
|
)
|
|
34
34
|
|
|
35
35
|
def scat_coeffs_apply(
|
|
36
36
|
self, scat, method, no_order_1=False, no_order_2=False, no_order_3=False
|
|
37
37
|
):
|
|
38
|
-
for j in scat.
|
|
38
|
+
for j in scat.S2:
|
|
39
39
|
if not no_order_1:
|
|
40
|
-
scat.
|
|
40
|
+
scat.S2[j] = method(scat.S2[j])
|
|
41
41
|
if scat.S1 is not None:
|
|
42
42
|
scat.S1[j] = method(scat.S1[j])
|
|
43
43
|
|
|
44
44
|
if not no_order_2:
|
|
45
|
-
for n1 in scat.
|
|
46
|
-
scat.
|
|
45
|
+
for n1 in scat.S3[j]:
|
|
46
|
+
scat.S3[j][n1] = method(scat.S3[j][n1])
|
|
47
47
|
|
|
48
|
-
if scat.
|
|
49
|
-
for n1 in scat.
|
|
50
|
-
scat.
|
|
48
|
+
if scat.S3P is not None:
|
|
49
|
+
for n1 in scat.S3P[j]:
|
|
50
|
+
scat.S3P[j][n1] = method(scat.S3P[j][n1])
|
|
51
51
|
|
|
52
52
|
if not no_order_3:
|
|
53
|
-
for n1 in scat.
|
|
54
|
-
for n2 in scat.
|
|
55
|
-
scat.
|
|
53
|
+
for n1 in scat.S4[j]:
|
|
54
|
+
for n2 in scat.S4[j][n1]:
|
|
55
|
+
scat.S4[j][n1][n2] = method(scat.S4[j][n1][n2])
|
|
56
56
|
|
|
57
57
|
def scat_ud_grade_2(
|
|
58
58
|
self, scat, no_order_1=False, no_order_2=False, no_order_3=False
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: foscat
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.3.0
|
|
4
4
|
Summary: Generate synthetic Healpix or 2D data using Cross Scattering Transform
|
|
5
|
-
Home-page: https://github.com/jmdelouis/FOSCAT
|
|
6
|
-
Author: Jean-Marc DELOUIS
|
|
7
5
|
Author-email: Jean-Marc DELOUIS <jean.marc.delouis@ifremer.fr>
|
|
8
|
-
Maintainer: Theo Foulquier
|
|
9
6
|
Maintainer-email: Theo Foulquier <theo.foulquier@ifremer.fr>
|
|
10
7
|
License: BSD-3-Clause
|
|
11
8
|
Project-URL: Repository, https://github.com/jmdelouis/FOSCAT.git
|
|
@@ -49,23 +46,27 @@ https://github.com/IAOCEA/demo-foscat-pangeo-eosc/blob/main/Demo_Synthesis.ipynb
|
|
|
49
46
|
|
|
50
47
|
# FOSCAT_DEMO
|
|
51
48
|
|
|
52
|
-
The python scripts
|
|
49
|
+
The python scripts _demo.py_ included in this package demonstrate how to use the foscat library to generate synthetic fields that have patterns with the same statistical properties as a specified image.
|
|
53
50
|
|
|
54
51
|
# Install foscat library
|
|
55
52
|
|
|
56
|
-
Before installing, make sure you have python installed in your enviroment.
|
|
53
|
+
Before installing, make sure you have python installed in your enviroment.
|
|
57
54
|
The last version of the foscat library can be installed using PyPi:
|
|
55
|
+
|
|
58
56
|
```
|
|
59
57
|
pip install foscat
|
|
60
58
|
```
|
|
59
|
+
|
|
61
60
|
Load the FOSCAT_DEMO package from github.
|
|
61
|
+
|
|
62
62
|
```
|
|
63
63
|
git clone https://github.com/jmdelouis/FOSCAT_DEMO.git
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
+
## Recommended installing procedures for mac users
|
|
67
|
+
|
|
68
|
+
It is recomended to use python=3.9\*.
|
|
66
69
|
|
|
67
|
-
## Recommended installing procedures for mac users
|
|
68
|
-
It is recomended to use python=3.9*.
|
|
69
70
|
```
|
|
70
71
|
micromamba create -n FOSCAT
|
|
71
72
|
micromamba install -n FOSCAT ‘python==3.9*’
|
|
@@ -75,8 +76,9 @@ git clone https://github.com/jmdelouis/FOSCAT_DEMO.git
|
|
|
75
76
|
|
|
76
77
|
```
|
|
77
78
|
|
|
78
|
-
##
|
|
79
|
-
|
|
79
|
+
## Recommended installing procedures HPC users
|
|
80
|
+
|
|
81
|
+
It is recomended to install tensorflow in advance. For [DATARMOR](https://pcdm.ifremer.fr/Equipement) for using GPU ;
|
|
80
82
|
|
|
81
83
|
```
|
|
82
84
|
micromamba create -n FOSCAT
|
|
@@ -91,33 +93,38 @@ git clone https://github.com/jmdelouis/FOSCAT_DEMO.git
|
|
|
91
93
|
# Spherical data example
|
|
92
94
|
|
|
93
95
|
## compute a synthetic image
|
|
96
|
+
|
|
94
97
|
```
|
|
95
98
|
python demo.py -n=32 -k -c -s=100
|
|
96
99
|
```
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
-
|
|
101
|
-
-
|
|
102
|
-
-
|
|
100
|
+
|
|
101
|
+
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.
|
|
102
|
+
|
|
103
|
+
- `-n=32` computes map with nside=32.
|
|
104
|
+
- `-k` uses 5x5 kernel.
|
|
105
|
+
- `-c` uses Scattering Covariance.
|
|
106
|
+
- `-l` uses LBFGS minimizer.
|
|
107
|
+
- `-s=100` computes 100 steps.
|
|
108
|
+
|
|
103
109
|
```
|
|
104
110
|
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]
|
|
105
111
|
|
|
106
112
|
```
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
|
|
114
|
+
- The "-n" option specifies the nside of the input map. The maximum nside value is 256 with the default map.
|
|
115
|
+
- The "--cov" option (optional) uses scat_cov instead of scat.
|
|
116
|
+
- The "--steps" option (optional) specifies the number of iterations. If not specified, the default value is 1000.
|
|
117
|
+
- The "--seed" option (optional) specifies the seed of the random generator.
|
|
118
|
+
- The "--path" option (optional) allows you to define the path where the output files will be written. The default path is "data".
|
|
119
|
+
- The "--k5x5" option (optional) uses a 5x5 kernel instead of a 3x3.
|
|
120
|
+
- 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.
|
|
121
|
+
- The "--out" option (optional) specifies the output file name. If not specified, the output file will be saved in "demo".
|
|
122
|
+
- The "--orient" option (optional) specifies the number of orientations. If not specified, the default value is 4.
|
|
123
|
+
- The "--adam" option (optional) makes the synthesis using the ADAM optimizer instead of the L_BFGS.
|
|
117
124
|
|
|
118
125
|
## plot the result
|
|
119
126
|
|
|
120
|
-
The following script generates a series of plots that showcase different aspects of the synthesis process using the
|
|
127
|
+
The following script generates a series of plots that showcase different aspects of the synthesis process using the _demo.py_ script.
|
|
121
128
|
|
|
122
129
|
> python test2D.py
|
|
123
130
|
|
|
@@ -131,7 +138,7 @@ python plotdemo.py -n=32 -c
|
|
|
131
138
|
|
|
132
139
|
# compute a synthetic turbulent field
|
|
133
140
|
|
|
134
|
-
The python scripts
|
|
141
|
+
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.
|
|
135
142
|
|
|
136
143
|
> python testHealpix.py
|
|
137
144
|
|
|
@@ -141,17 +148,19 @@ python demo2d.py -n=32 -k -c
|
|
|
141
148
|
|
|
142
149
|
> python testHplot.py
|
|
143
150
|
|
|
144
|
-
The following script generates a series of plots that showcase different aspects of the synthesis process using the
|
|
151
|
+
The following script generates a series of plots that showcase different aspects of the synthesis process using the _demo2D.py_ script.
|
|
152
|
+
|
|
145
153
|
```
|
|
146
154
|
python plotdemo2d.py -n=32 -c
|
|
147
155
|
```
|
|
156
|
+
|
|
148
157
|
For more information, see the [documentation](https://foscat-documentation.readthedocs.io/en/latest/index.html).
|
|
149
158
|
|
|
150
159
|
> mpirun -np 3 testHealpix_mpi.py
|
|
151
160
|
|
|
152
161
|
## Authors and acknowledgment
|
|
153
162
|
|
|
154
|
-
Authors: J.-M. Delouis, T. Foulquier, J. Mangin, L. Mousset, T. Odaka, F. Paul, E. Allys
|
|
163
|
+
Authors: J.-M. Delouis, P. Campeti, T. Foulquier, J. Mangin, L. Mousset, T. Odaka, F. Paul, E. Allys
|
|
155
164
|
|
|
156
165
|
This work is part of the R & T Deepsee project supported by CNES. The authors acknowledge the heritage of the Planck-HFI consortium regarding data, software, knowledge. This work has been supported by the Programme National de Télédétection Spatiale (PNTS, http://programmes.insu.cnrs.fr/pnts/), grant n◦ PNTS-2020-08
|
|
157
166
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
foscat/CNN.py,sha256=j0F2a4Xf3LijhyD_WVZ6Eg_IjGuXw3ddH6Iudj1xVaw,4874
|
|
2
|
+
foscat/CircSpline.py,sha256=fTPOUq5fECevQTKpnwPsYSBTafKyncECUS3fKF03Xls,2423
|
|
3
|
+
foscat/FoCUS.py,sha256=hmHO3cEEaEZyzFEvOIogBlhjUobRfwDbWQTAT1F5r-c,101774
|
|
4
|
+
foscat/GCNN.py,sha256=5RV-FKuvqbD-k99TwiM4CttM2LMZE21WD0IK0j5Mkko,7599
|
|
5
|
+
foscat/Softmax.py,sha256=aBLQauoG0q2SJYPotV6U-cxAhsJcspWHNRWdnA_nAiQ,2854
|
|
6
|
+
foscat/Spline1D.py,sha256=a5Jb8I9tb8y20iM8W-z6iZsIqDFByRp6eZdChpmuI5k,3010
|
|
7
|
+
foscat/Synthesis.py,sha256=3_Lq5-gUM-WmO2h15kajMES8XjRo2BGseoxvTLW_xEc,13626
|
|
8
|
+
foscat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
+
foscat/alm.py,sha256=qjczgfyZSZKv7eNmvE-UbRtOO6HQ42Cu-TTx1TioYyM,5148
|
|
10
|
+
foscat/backend.py,sha256=SyPNkwuwIKAeUQZE4m5RSUr29jjVbL4wzNrtqYXmVno,38557
|
|
11
|
+
foscat/backend_tens.py,sha256=9Dp136m9frkclkwifJQLLbIpl3ETI3_txdPUZcKfuMw,1618
|
|
12
|
+
foscat/loss_backend_tens.py,sha256=dCOVN6faDtIpN3VO78HTmYP2i5fnFAf-Ddy5qVBlGrM,1783
|
|
13
|
+
foscat/loss_backend_torch.py,sha256=k3z18Dj3SaLKK6ZIKcm7GO4U_YKYVP6LtHG1aIbxkYk,1627
|
|
14
|
+
foscat/scat.py,sha256=qGYiBIysPt65MdmF07WWA4piVlTfA9-lFDTaicnqC2w,72822
|
|
15
|
+
foscat/scat1D.py,sha256=W5Uu6wdQ4ZsFKXpof0f1OBl-1wjJmW7ruvddRWxe7uM,53726
|
|
16
|
+
foscat/scat2D.py,sha256=boKj0ASqMMSy7uQLK6hPniG87m3hZGJBYBiq5v8F9IQ,532
|
|
17
|
+
foscat/scat_cov.py,sha256=cyq-gK23mlQSy1zblDPWJsmJwrEw7bcWx1URqCgqZ48,144287
|
|
18
|
+
foscat/scat_cov1D.py,sha256=XOxsZZ5TYq8f34i2tUgIfzyaqaTDlICB3HzD2l_puro,531
|
|
19
|
+
foscat/scat_cov2D.py,sha256=3gn6xjKvfKsyHJoPfYIu8q9LLVAbU3tsiS2l1LAJ0XM,531
|
|
20
|
+
foscat/scat_cov_map.py,sha256=0wTRo4Nc7rYfI09RI2mh2bYixoukt5lrvAXR6wa9kjA,2744
|
|
21
|
+
foscat/scat_cov_map2D.py,sha256=FqF45FBcoiQbvuVsrLWUIPRUc95GsKsrnH6fKzB3GlE,2841
|
|
22
|
+
foscat-3.3.0.dist-info/LICENCE,sha256=i0ukIr8ZUpkSY2sZaE9XZK-6vuSU5iG6IgX_3pjatP8,1505
|
|
23
|
+
foscat-3.3.0.dist-info/METADATA,sha256=chJzw6s5UFmpGc-XlgunHjQRfDWlZUomwec7CYU5diY,7191
|
|
24
|
+
foscat-3.3.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
25
|
+
foscat-3.3.0.dist-info/top_level.txt,sha256=AGySXBBAlJgb8Tj8af6m_F-aiNg2zNTcybCUPVOKjAg,7
|
|
26
|
+
foscat-3.3.0.dist-info/RECORD,,
|