foscat 3.0.17__tar.gz → 3.0.18__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-3.0.17 → foscat-3.0.18}/PKG-INFO +1 -1
- {foscat-3.0.17 → foscat-3.0.18}/setup.py +1 -1
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat/FoCUS.py +1 -1
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat/backend.py +7 -1
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat/scat.py +10 -2
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat/scat1D.py +13 -4
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat/scat_cov.py +11 -4
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat/scat_cov1D.py +11 -2
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat.egg-info/PKG-INFO +1 -1
- {foscat-3.0.17 → foscat-3.0.18}/README.md +0 -0
- {foscat-3.0.17 → foscat-3.0.18}/setup.cfg +0 -0
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat/CircSpline.py +0 -0
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat/GCNN.py +0 -0
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat/GetGPUinfo.py +0 -0
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat/Softmax.py +0 -0
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat/Spline1D.py +0 -0
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat/Synthesis.py +0 -0
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat/__init__.py +0 -0
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat/backend_tens.py +0 -0
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat/loss_backend_tens.py +0 -0
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat/loss_backend_torch.py +0 -0
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat/scat2D.py +0 -0
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat/scat_cov2D.py +0 -0
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat/scat_cov_map.py +0 -0
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat/scat_cov_map2D.py +0 -0
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat.egg-info/SOURCES.txt +0 -0
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat.egg-info/dependency_links.txt +0 -0
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat.egg-info/requires.txt +0 -0
- {foscat-3.0.17 → foscat-3.0.18}/src/foscat.egg-info/top_level.txt +0 -0
|
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
|
|
|
3
3
|
|
|
4
4
|
setup(
|
|
5
5
|
name='foscat',
|
|
6
|
-
version='3.0.
|
|
6
|
+
version='3.0.18',
|
|
7
7
|
description='Generate synthetic Healpix or 2D data using Cross Scattering Transform' ,
|
|
8
8
|
long_description='Utilize the Cross Scattering Transform (described in https://arxiv.org/abs/2207.12527) to synthesize Healpix or 2D data that is suitable for component separation purposes, such as denoising. \n A demo package for this process can be found at https://github.com/jmdelouis/FOSCAT_DEMO. \n Complete doc can be found at https://foscat-documentation.readthedocs.io/en/latest/index.html. \n\n List of developers : J.-M. Delouis, T. Foulquier, L. Mousset, T. Odaka, F. Paul, E. Allys ' ,
|
|
9
9
|
license='MIT',
|
|
@@ -38,17 +38,20 @@ class foscat_backend:
|
|
|
38
38
|
self.BACKEND=self.TENSORFLOW
|
|
39
39
|
#tf.config.threading.set_inter_op_parallelism_threads(1)
|
|
40
40
|
#tf.config.threading.set_intra_op_parallelism_threads(1)
|
|
41
|
+
self.tf_function = tf.function
|
|
41
42
|
|
|
42
43
|
if self.BACKEND=='torch':
|
|
43
44
|
import torch
|
|
44
45
|
self.BACKEND=self.TORCH
|
|
45
46
|
self.backend=torch
|
|
47
|
+
self.tf_function = self.tf_loc_function
|
|
46
48
|
|
|
47
49
|
if self.BACKEND=='numpy':
|
|
48
50
|
self.BACKEND=self.NUMPY
|
|
49
51
|
self.backend=np
|
|
50
52
|
import scipy as scipy
|
|
51
53
|
self.scipy=scipy
|
|
54
|
+
self.tf_function = self.tf_loc_function
|
|
52
55
|
|
|
53
56
|
self.float64=self.backend.float64
|
|
54
57
|
self.float32=self.backend.float32
|
|
@@ -114,7 +117,10 @@ class foscat_backend:
|
|
|
114
117
|
except RuntimeError as e:
|
|
115
118
|
# Memory growth must be set before GPUs have been initialized
|
|
116
119
|
print(e)
|
|
117
|
-
|
|
120
|
+
|
|
121
|
+
def tf_loc_function(self,func):
|
|
122
|
+
return func
|
|
123
|
+
|
|
118
124
|
def calc_iso_orient(self,norient):
|
|
119
125
|
tmp=np.zeros([norient*norient,norient])
|
|
120
126
|
for i in range(norient):
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import foscat.FoCUS as FOC
|
|
2
2
|
import numpy as np
|
|
3
|
-
import tensorflow as tf
|
|
4
3
|
import pickle
|
|
5
4
|
import foscat.backend as bk
|
|
6
5
|
import healpy as hp
|
|
7
6
|
|
|
7
|
+
# Vérifier si TensorFlow est importé et défini
|
|
8
|
+
tf_defined = 'tensorflow' in sys.modules
|
|
9
|
+
|
|
10
|
+
if tf_defined:
|
|
11
|
+
tf_function = tf.function # Facultatif : si vous voulez utiliser TensorFlow dans ce script
|
|
12
|
+
else:
|
|
13
|
+
def tf_function(func):
|
|
14
|
+
return func
|
|
15
|
+
|
|
8
16
|
def read(filename):
|
|
9
17
|
thescat=scat(1,1,1,1,1,[0],[0])
|
|
10
18
|
return thescat.read(filename)
|
|
@@ -1392,7 +1400,7 @@ class funct(FOC.FoCUS):
|
|
|
1392
1400
|
def one(self):
|
|
1393
1401
|
return scat(1.0,1.0,1.0,1.0,1.0,[0],[0],backend=self.backend)
|
|
1394
1402
|
|
|
1395
|
-
@
|
|
1403
|
+
@tf_function
|
|
1396
1404
|
def eval_comp_fast(self, image1, image2=None,mask=None,Auto=True,s0_off=1E-6):
|
|
1397
1405
|
|
|
1398
1406
|
res=self.eval(image1, image2=image2,mask=mask,Auto=Auto,s0_off=s0_off)
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import foscat.FoCUS as FOC
|
|
2
2
|
import numpy as np
|
|
3
|
-
import tensorflow as tf
|
|
4
3
|
import pickle
|
|
5
4
|
import foscat.backend as bk
|
|
6
|
-
|
|
5
|
+
import sys
|
|
6
|
+
|
|
7
|
+
# Vérifier si TensorFlow est importé et défini
|
|
8
|
+
tf_defined = 'tensorflow' in sys.modules
|
|
9
|
+
|
|
10
|
+
if tf_defined:
|
|
11
|
+
tf_function = tf.function # Facultatif : si vous voulez utiliser TensorFlow dans ce script
|
|
12
|
+
else:
|
|
13
|
+
def tf_function(func):
|
|
14
|
+
return func
|
|
15
|
+
|
|
7
16
|
def read(filename):
|
|
8
17
|
thescat=scat1D(1,1,1,1,1,[0],[0])
|
|
9
18
|
return thescat.read(filename)
|
|
@@ -1050,12 +1059,12 @@ class funct(FOC.FoCUS):
|
|
|
1050
1059
|
def one(self):
|
|
1051
1060
|
return scat1D(1.0,1.0,1.0,1.0,1.0,[0],[0],backend=self.backend)
|
|
1052
1061
|
|
|
1053
|
-
@tf.function
|
|
1054
1062
|
def eval_comp_fast(self, image1, image2=None,mask=None,Auto=True,s0_off=1E-6):
|
|
1055
1063
|
|
|
1056
|
-
res=self.
|
|
1064
|
+
res=self.eval_fast(image1, image2=image2,mask=mask,Auto=Auto,s0_off=s0_off)
|
|
1057
1065
|
return res.P00,res.S0,res.S1,res.S2,res.S2L,res.j1,res.j2
|
|
1058
1066
|
|
|
1067
|
+
@tf_function
|
|
1059
1068
|
def eval_fast(self, image1, image2=None,mask=None,Auto=True,s0_off=1E-6):
|
|
1060
1069
|
p0,s0,s1,s2,s2l,j1,j2=self.eval_comp_fast(image1, image2=image2,mask=mask,Auto=Auto,s0_off=s0_off)
|
|
1061
1070
|
return scat1D(p0,s0,s1,s2,s2l,j1,j2,backend=self.backend)
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import foscat.FoCUS as FOC
|
|
2
2
|
import numpy as np
|
|
3
3
|
import foscat.backend as bk
|
|
4
|
-
#import tensorflow as tf
|
|
5
4
|
import pickle
|
|
6
5
|
import healpy as hp
|
|
7
6
|
|
|
7
|
+
# Vérifier si TensorFlow est importé et défini
|
|
8
|
+
tf_defined = 'tensorflow' in sys.modules
|
|
9
|
+
|
|
10
|
+
if tf_defined:
|
|
11
|
+
tf_function = tf.function # Facultatif : si vous voulez utiliser TensorFlow dans ce script
|
|
12
|
+
else:
|
|
13
|
+
def tf_function(func):
|
|
14
|
+
return func
|
|
15
|
+
|
|
8
16
|
def read(filename):
|
|
9
17
|
thescat = scat_cov(1, 1, 1, 1)
|
|
10
18
|
return thescat.read(filename)
|
|
@@ -2418,9 +2426,8 @@ class funct(FOC.FoCUS):
|
|
|
2418
2426
|
x.domult(sig.C11,x.C11)*x.domult(sig.C11,x.C11),
|
|
2419
2427
|
backend=self.backend)
|
|
2420
2428
|
return(self.NORIENT)
|
|
2421
|
-
|
|
2422
|
-
@
|
|
2423
|
-
"""
|
|
2429
|
+
|
|
2430
|
+
@tf_function
|
|
2424
2431
|
def eval_comp_fast(self, image1, image2=None,mask=None,norm=None, Auto=True,cmat=None,cmat2=None):
|
|
2425
2432
|
|
|
2426
2433
|
res=self.eval(image1, image2=image2,mask=mask,Auto=Auto,cmat=cmat,cmat2=cmat2)
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import foscat.FoCUS as FOC
|
|
2
2
|
import numpy as np
|
|
3
3
|
import foscat.backend as bk
|
|
4
|
-
import tensorflow as tf
|
|
5
4
|
import pickle
|
|
6
5
|
import matplotlib.pyplot as plt
|
|
7
6
|
|
|
7
|
+
|
|
8
|
+
# Vérifier si TensorFlow est importé et défini
|
|
9
|
+
tf_defined = 'tensorflow' in sys.modules
|
|
10
|
+
|
|
11
|
+
if tf_defined:
|
|
12
|
+
tf_function = tf.function # Facultatif : si vous voulez utiliser TensorFlow dans ce script
|
|
13
|
+
else:
|
|
14
|
+
def tf_function(func):
|
|
15
|
+
return func
|
|
16
|
+
|
|
8
17
|
def read(filename):
|
|
9
18
|
thescat = scat_cov1D(1, 1, 1)
|
|
10
19
|
return thescat.read(filename)
|
|
@@ -1461,7 +1470,7 @@ class funct(FOC.FoCUS):
|
|
|
1461
1470
|
|
|
1462
1471
|
return result
|
|
1463
1472
|
|
|
1464
|
-
@
|
|
1473
|
+
@tf_function
|
|
1465
1474
|
def eval_comp_fast(self, image1, image2=None,mask=None,norm=None, Auto=True,Add_R45=False):
|
|
1466
1475
|
|
|
1467
1476
|
res=self.eval(image1, image2=image2,mask=mask,Auto=Auto,Add_R45=Add_R45)
|
|
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
|