foscat 3.7.0__py3-none-any.whl → 3.7.2__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/scat_cov2D.py CHANGED
@@ -1,5 +1,5 @@
1
1
  import foscat.scat_cov as scat
2
-
2
+ import numpy as np
3
3
 
4
4
  class scat_cov2D:
5
5
  def __init__(self, s0, s2, s3, s4, s1=None, s3p=None, backend=None):
@@ -48,31 +48,71 @@ class funct(scat.funct):
48
48
 
49
49
  return spectrum_1d
50
50
 
51
- def plot_results(self,in_image,out_image,vmin=None,vmax=None,cmap='coolwarm'):
51
+ def plot_results(self,in_image,out_image,vmin=None,vmax=None,cmap='coolwarm',spec_range=None):
52
52
  import matplotlib.pyplot as plt
53
53
 
54
- plt.figure(figsize=(16,3))
55
- plt.subplot(1,4,1)
56
- plt.title('Original field')
57
- plt.imshow(in_image,cmap=cmap,vmin=vmin,vmax=vmax,origin='lower')
58
- plt.xticks([])
59
- plt.yticks([])
60
- plt.subplot(1,4,2)
61
- plt.title('Modeled field')
62
- plt.imshow(out_image,cmap=cmap,vmin=vmin,vmax=vmax,origin='lower')
63
- plt.xticks([])
64
- plt.yticks([])
65
- plt.subplot(1,4,3)
66
- plt.title('Histogram')
67
- plt.hist(in_image.flatten(),bins=100,label='original',color='r',histtype='step',log=True)
68
- plt.hist(out_image.flatten(),bins=100,label='modeled',color='b',histtype='step',log=True)
69
- plt.legend(frameon=0)
70
- plt.subplot(1,4,4)
71
- plt.title('Powerspectra')
72
- plt.plot(self.spectrum(in_image),color='b',label='original')
73
- plt.plot(self.spectrum(out_image),color='r',label='modeled')
74
- plt.xscale('log')
75
- plt.yscale('log')
76
- plt.legend(frameon=0)
54
+ if len(out_image.shape)>2:
55
+ nimage=out_image.shape[0]
56
+ ndraw=np.min([3,nimage])
57
+ plt.figure(figsize=(16,12))
58
+ plt.subplot(2,ndraw+1,1)
59
+ plt.title('Original field')
60
+ plt.imshow(in_image,cmap=cmap,vmin=vmin,vmax=vmax,origin='lower')
61
+ plt.xticks([])
62
+ plt.yticks([])
63
+ for k in range(ndraw):
64
+ plt.subplot(2,ndraw+1,2+k)
65
+ plt.title('Modeled field #%d'%(k))
66
+ plt.imshow(out_image[k],cmap=cmap,vmin=vmin,vmax=vmax,origin='lower')
67
+ plt.xticks([])
68
+ plt.yticks([])
69
+ plt.subplot(2,2,3)
70
+ plt.title('Histogram')
71
+ for k in range(nimage):
72
+ if k==0:
73
+ plt.hist(out_image[k].flatten(),bins=100,label='modeled',color='b',histtype='step',log=True,alpha=0.5)
74
+ else:
75
+ plt.hist(out_image[k].flatten(),bins=100,color='b',histtype='step',log=True,alpha=0.5)
76
+ plt.hist(in_image.flatten(),bins=100,label='original',color='r',histtype='step',log=True)
77
+ plt.legend(frameon=0)
78
+ plt.subplot(2,2,4)
79
+ plt.title('Powerspectra')
80
+ for k in range(nimage):
81
+ if k==0:
82
+ plt.plot(self.spectrum(out_image[k]),color='b',label='modeled',alpha=0.5)
83
+ else:
84
+ plt.plot(self.spectrum(out_image[k]),color='b',alpha=0.5)
85
+ plt.plot(self.spectrum(in_image),color='r',label='original')
86
+ plt.xscale('log')
87
+ plt.yscale('log')
88
+ plt.legend(frameon=0)
89
+ if spec_range is not None:
90
+ plt.ylim(spec_range[0],spec_range[1])
91
+ else:
92
+ plt.figure(figsize=(16,3))
93
+ plt.subplot(1,4,1)
94
+ plt.title('Original field')
95
+ plt.imshow(in_image,cmap=cmap,vmin=vmin,vmax=vmax,origin='lower')
96
+ plt.xticks([])
97
+ plt.yticks([])
98
+ plt.subplot(1,4,2)
99
+ plt.title('Modeled field')
100
+ plt.imshow(out_image,cmap=cmap,vmin=vmin,vmax=vmax,origin='lower')
101
+ plt.xticks([])
102
+ plt.yticks([])
103
+ plt.subplot(1,4,3)
104
+ plt.title('Histogram')
105
+ plt.hist(in_image.flatten(),bins=100,label='original',color='r',histtype='step',log=True)
106
+ plt.hist(out_image.flatten(),bins=100,label='modeled',color='b',histtype='step',log=True)
107
+ plt.legend(frameon=0)
108
+ plt.subplot(1,4,4)
109
+ plt.title('Powerspectra')
110
+ plt.plot(self.spectrum(in_image),color='b',label='original')
111
+ plt.plot(self.spectrum(out_image),color='r',label='modeled')
112
+ plt.xscale('log')
113
+ plt.yscale('log')
114
+ if spec_range is not None:
115
+ plt.ylim(spec_range[0],spec_range[1])
116
+ plt.legend(frameon=0)
77
117
 
78
118
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: foscat
3
- Version: 3.7.0
3
+ Version: 3.7.2
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>
@@ -18,7 +18,7 @@ Classifier: Programming Language :: Python :: 3.11
18
18
  Classifier: Programming Language :: Python :: 3.12
19
19
  Requires-Python: >=3.9
20
20
  Description-Content-Type: text/markdown
21
- License-File: LICENCE
21
+ License-File: LICENSE
22
22
  Requires-Dist: imageio
23
23
  Requires-Dist: imagecodecs
24
24
  Requires-Dist: matplotlib
@@ -1,26 +1,26 @@
1
1
  foscat/CNN.py,sha256=j0F2a4Xf3LijhyD_WVZ6Eg_IjGuXw3ddH6Iudj1xVaw,4874
2
2
  foscat/CircSpline.py,sha256=CXi49FxF8ZoeZ17Ua8c1AZXe2B5ICEC9aCXb97atB3s,4028
3
- foscat/FoCUS.py,sha256=Bkq-DZLKnu_KDF9EGJhzGKtuWciHTv0vAU0tKNd_-ao,102595
3
+ foscat/FoCUS.py,sha256=DaK1YwUVwMwJikG676kp_OGWRxfytVlxU6f0bbjxCvs,102659
4
4
  foscat/GCNN.py,sha256=5RV-FKuvqbD-k99TwiM4CttM2LMZE21WD0IK0j5Mkko,7599
5
5
  foscat/Softmax.py,sha256=aBLQauoG0q2SJYPotV6U-cxAhsJcspWHNRWdnA_nAiQ,2854
6
6
  foscat/Spline1D.py,sha256=rKzzenduaZZ-yBDJd35it6Gyrj1spqb7hoIaUgISPzY,2983
7
7
  foscat/Synthesis.py,sha256=3oL-WIwOzjO6jYn-7J3TfAQSiPaQTqGtrmxcGBh1Gvs,13787
8
8
  foscat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  foscat/alm.py,sha256=PaAaq82CH3JzH520eQpqTCivxE4VeJmmc6I_9HXIhcA,32480
10
- foscat/backend.py,sha256=ednCoHUenHClbShG6cBWnlqjYHtN4jAzMf8tzZ_7X_w,43429
10
+ foscat/backend.py,sha256=P_NmxrK8jMRgYMA8Qinpw-7QJcXcB4qt64Ya3cAD1Dg,45317
11
11
  foscat/backend_tens.py,sha256=9Dp136m9frkclkwifJQLLbIpl3ETI3_txdPUZcKfuMw,1618
12
12
  foscat/loss_backend_tens.py,sha256=dCOVN6faDtIpN3VO78HTmYP2i5fnFAf-Ddy5qVBlGrM,1783
13
13
  foscat/loss_backend_torch.py,sha256=k3z18Dj3SaLKK6ZIKcm7GO4U_YKYVP6LtHG1aIbxkYk,1627
14
14
  foscat/scat.py,sha256=qGYiBIysPt65MdmF07WWA4piVlTfA9-lFDTaicnqC2w,72822
15
15
  foscat/scat1D.py,sha256=W5Uu6wdQ4ZsFKXpof0f1OBl-1wjJmW7ruvddRWxe7uM,53726
16
16
  foscat/scat2D.py,sha256=boKj0ASqMMSy7uQLK6hPniG87m3hZGJBYBiq5v8F9IQ,532
17
- foscat/scat_cov.py,sha256=vyeOpnhfSZyOexEmWlYdr4w_udWLw01HlzbHhWUWHNk,157259
17
+ foscat/scat_cov.py,sha256=3q2rBhcgXGIhW30kSUb5LkfC_1wk_OypphlIPBTzEsE,241234
18
18
  foscat/scat_cov1D.py,sha256=XOxsZZ5TYq8f34i2tUgIfzyaqaTDlICB3HzD2l_puro,531
19
- foscat/scat_cov2D.py,sha256=gABI0nztBU9HUdHJ0fLLITOZ9895wB1hKm_Fjp9D3ns,2830
19
+ foscat/scat_cov2D.py,sha256=HVYBNtpZgRlz6OOm0LwG_w8Q4Kld4Qc1n6XYeGoxIug,4802
20
20
  foscat/scat_cov_map.py,sha256=Swt39-nYEaQkBzyX4EOAQBvUuYQpERzJ-uVxSWS2b-Y,2911
21
21
  foscat/scat_cov_map2D.py,sha256=FqF45FBcoiQbvuVsrLWUIPRUc95GsKsrnH6fKzB3GlE,2841
22
- foscat-3.7.0.dist-info/LICENCE,sha256=i0ukIr8ZUpkSY2sZaE9XZK-6vuSU5iG6IgX_3pjatP8,1505
23
- foscat-3.7.0.dist-info/METADATA,sha256=OkQy2zp4wDIKh_Zma9jABKGJIqkAala9zwV7f7fVVoE,7216
24
- foscat-3.7.0.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
25
- foscat-3.7.0.dist-info/top_level.txt,sha256=AGySXBBAlJgb8Tj8af6m_F-aiNg2zNTcybCUPVOKjAg,7
26
- foscat-3.7.0.dist-info/RECORD,,
22
+ foscat-3.7.2.dist-info/LICENSE,sha256=i0ukIr8ZUpkSY2sZaE9XZK-6vuSU5iG6IgX_3pjatP8,1505
23
+ foscat-3.7.2.dist-info/METADATA,sha256=xVWiNu2F2NbJVh96gwtH7Hv4Q_UZd1WQvRxwcAYBlSk,7216
24
+ foscat-3.7.2.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
25
+ foscat-3.7.2.dist-info/top_level.txt,sha256=AGySXBBAlJgb8Tj8af6m_F-aiNg2zNTcybCUPVOKjAg,7
26
+ foscat-3.7.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.2)
2
+ Generator: setuptools (76.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5