foscat 3.0.31__py3-none-any.whl → 3.0.32__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/CNN.py CHANGED
@@ -79,7 +79,7 @@ class CNN:
79
79
  def get_weights(self):
80
80
  return self.x
81
81
 
82
- def eval(self,im):
82
+ def eval(self,im,indices=None,weights=None):
83
83
 
84
84
  x=self.x
85
85
  ww=self.scat_operator.backend.bk_reshape(x[0:self.KERNELSZ*self.KERNELSZ*self.n_chan_in*self.chanlist[0]],
@@ -93,7 +93,10 @@ class CNN:
93
93
  ww=self.scat_operator.backend.bk_reshape(x[nn:nn+self.KERNELSZ*self.KERNELSZ*self.chanlist[k]*self.chanlist[k+1]],
94
94
  [self.KERNELSZ*self.KERNELSZ,self.chanlist[k],self.chanlist[k+1]])
95
95
  nn=nn+self.KERNELSZ*self.KERNELSZ*self.chanlist[k]*self.chanlist[k+1]
96
- im=self.scat_operator.healpix_layer(im,ww)
96
+ if indices is None:
97
+ im=self.scat_operator.healpix_layer(im,ww)
98
+ else:
99
+ im=self.scat_operator.healpix_layer(im,ww,indices=indices[k],weights=weights[k])
97
100
  im=self.scat_operator.backend.bk_relu(im)
98
101
  im=self.scat_operator.ud_grade_2(im,axis=0)
99
102
 
foscat/FoCUS.py CHANGED
@@ -32,7 +32,7 @@ class FoCUS:
32
32
  mpi_size=1,
33
33
  mpi_rank=0):
34
34
 
35
- self.__version__ = '3.0.31'
35
+ self.__version__ = '3.0.32'
36
36
  # P00 coeff for normalization for scat_cov
37
37
  self.TMPFILE_VERSION=TMPFILE_VERSION
38
38
  self.P1_dic = None
@@ -64,7 +64,7 @@ class FoCUS:
64
64
  except:
65
65
  if not self.silent:
66
66
  print('Impossible to create the directory %s'%(self.TEMPLATE_PATH))
67
- exit(0)
67
+ return None
68
68
 
69
69
  self.number_of_loss=0
70
70
 
@@ -82,7 +82,7 @@ class FoCUS:
82
82
  if JmaxDelta<-1:
83
83
  if not self.silent:
84
84
  print('Warning : Jmax can not be smaller than -1')
85
- exit(0)
85
+ return None
86
86
 
87
87
  self.OSTEP=JmaxDelta
88
88
  self.use_2D=use_2D
@@ -450,7 +450,7 @@ class FoCUS:
450
450
  print('Weights channels should be equal to the input image channels')
451
451
  return -1
452
452
  tmp=self.healpix_layer(im,ww,indices=indices,weights=weights)
453
-
453
+
454
454
  return self.up_grade(tmp,2*nside)
455
455
 
456
456
  # ---------------------------------------------−---------
@@ -519,7 +519,7 @@ class FoCUS:
519
519
  if len(ishape)<axis+2:
520
520
  if not self.silent:
521
521
  print('Use of 2D scat with data that has less than 2D')
522
- exit(0)
522
+ return None
523
523
 
524
524
  npix=im.shape[axis]
525
525
  npiy=im.shape[axis+1]
@@ -580,7 +580,7 @@ class FoCUS:
580
580
  if len(ishape)<axis+2:
581
581
  if not self.silent:
582
582
  print('Use of 2D scat with data that has less than 2D')
583
- exit(0)
583
+ return None
584
584
 
585
585
  if nouty is None:
586
586
  nouty=nout
@@ -1057,7 +1057,7 @@ class FoCUS:
1057
1057
  if self.rank==0:
1058
1058
  if not self.silent:
1059
1059
  print('Only 3x3 and 5x5 kernel have been developped for Healpix and you ask for %dx%d'%(KERNELSZ,KERNELSZ))
1060
- exit(0)
1060
+ return None
1061
1061
 
1062
1062
  self.barrier()
1063
1063
  if self.use_2D:
@@ -1342,7 +1342,7 @@ class FoCUS:
1342
1342
  if len(ishape)<axis+2:
1343
1343
  if not self.silent:
1344
1344
  print('Use of 2D scat with data that has less than 2D')
1345
- exit(0)
1345
+ return None
1346
1346
 
1347
1347
  npix=ishape[axis]
1348
1348
  npiy=ishape[axis+1]
@@ -1467,7 +1467,7 @@ class FoCUS:
1467
1467
  if len(ishape)<axis+2:
1468
1468
  if not self.silent:
1469
1469
  print('Use of 2D scat with data that has less than 2D')
1470
- exit(0)
1470
+ return None
1471
1471
 
1472
1472
  npix=ishape[axis]
1473
1473
  npiy=ishape[axis+1]
foscat/GCNN.py CHANGED
@@ -40,7 +40,7 @@ class GCNN:
40
40
 
41
41
  if len(chanlist)!=nscale+1:
42
42
  print('len of chanlist (here %d) should of nscale+1 (here %d)'%(len(chanlist),nscale+1))
43
- exit(0)
43
+ return None
44
44
 
45
45
  self.chanlist=chanlist
46
46
  self.KERNELSZ= scat_operator.KERNELSZ
@@ -79,7 +79,7 @@ class GCNN:
79
79
  def get_weights(self):
80
80
  return self.x
81
81
 
82
- def eval(self,param):
82
+ def eval(self,param,indices=None,weights=None):
83
83
 
84
84
  x=self.x
85
85
 
@@ -95,11 +95,15 @@ class GCNN:
95
95
  ww=self.scat_operator.backend.bk_reshape(x[nn:nn+self.KERNELSZ*self.KERNELSZ*self.chanlist[k]*self.chanlist[k+1]],
96
96
  [self.KERNELSZ*self.KERNELSZ,self.chanlist[k],self.chanlist[k+1]])
97
97
  nn=nn+self.KERNELSZ*self.KERNELSZ*self.chanlist[k]*self.chanlist[k+1]
98
- im=self.scat_operator.healpix_layer_transpose(im,ww)
98
+ if indices is None:
99
+ im=self.scat_operator.healpix_layer_transpose(im,ww)
100
+ else:
101
+ im=self.scat_operator.healpix_layer_transpose(im,ww,indices=indices[k],weights=weights[k])
99
102
  im=self.scat_operator.backend.bk_relu(im)
100
103
 
101
104
  ww=self.scat_operator.backend.bk_reshape(x[nn:],[self.chanlist[self.nscale],self.n_chan_out])
102
105
  im=self.scat_operator.backend.bk_matmul(im,ww)
103
106
 
104
107
  return im
105
-
108
+
109
+
foscat/GetGPUinfo.py CHANGED
@@ -33,4 +33,4 @@ event.set()
33
33
 
34
34
  x.join()
35
35
  print('everything done')
36
- exit(0)
36
+
foscat/Synthesis.py CHANGED
@@ -77,7 +77,7 @@ class Synthesis:
77
77
 
78
78
  if self.operation.BACKEND=='numpy':
79
79
  print('Synthesis does not work with numpy. Please select Torch or Tensorflow FOSCAT backend')
80
- exit(0)
80
+ return None
81
81
 
82
82
  # ---------------------------------------------−---------
83
83
  def get_gpu(self,event,delay):
foscat/backend.py CHANGED
@@ -29,7 +29,7 @@ class foscat_backend:
29
29
  print(' - tensorflow')
30
30
  print(' - torch')
31
31
  print(' - numpy (Impossible to do synthesis using numpy)')
32
- exit(0)
32
+ return None
33
33
 
34
34
  if self.BACKEND=='tensorflow':
35
35
  import tensorflow as tf
@@ -70,7 +70,7 @@ class foscat_backend:
70
70
  self.all_cbk_type=self.backend.complex128
71
71
  else:
72
72
  print('ERROR INIT FOCUS ',all_type,' should be float32 or float64')
73
- exit(0)
73
+ return None
74
74
  #===========================================================================
75
75
  # INIT
76
76
  if mpi_rank==0:
foscat/scat.py CHANGED
@@ -1044,15 +1044,15 @@ class funct(FOC.FoCUS):
1044
1044
  if list(image1.shape)!=list(image2.shape):
1045
1045
  print('The two input image should have the same size to eval Scattering')
1046
1046
 
1047
- exit(0)
1047
+ return None
1048
1048
  if mask is not None:
1049
1049
  if list(image1.shape)!=list(mask.shape)[1:]:
1050
1050
  print('The mask should have the same size than the input image to eval Scattering')
1051
1051
  print('Image shape ',image1.shape,'Mask shape ',mask.shape)
1052
- exit(0)
1052
+ return None
1053
1053
  if self.use_2D and len(image1.shape)<2:
1054
1054
  print('To work with 2D scattering transform, two dimension is needed, input map has only on dimension')
1055
- exit(0)
1055
+ return None
1056
1056
 
1057
1057
 
1058
1058
  ### AUTO OR CROSS
foscat/scat1D.py CHANGED
@@ -862,11 +862,11 @@ class funct(FOC.FoCUS):
862
862
  if len(image1.shape)==1:
863
863
  if image1.shape[0]!=mask.shape[1]:
864
864
  print('The mask should have the same size than the input timeline to eval Scattering')
865
- exit(0)
865
+ return None
866
866
  else:
867
867
  if image1.shape[1]!=mask.shape[1]:
868
868
  print('The mask should have the same size than the input timeline to eval Scattering')
869
- exit(0)
869
+ return None
870
870
 
871
871
  ### AUTO OR CROSS
872
872
  cross = False
foscat/scat_cov.py CHANGED
@@ -1647,7 +1647,7 @@ class funct(FOC.FoCUS):
1647
1647
  for k in range(4):
1648
1648
  hp.mollview(np.fmod(phase+np.pi,2*np.pi),cmap='jet',nest=True,hold=False,sub=(2,2,1+k))
1649
1649
  plt.show()
1650
- exit(0)
1650
+ return None
1651
1651
  """
1652
1652
  iph=(4*phase/(2*np.pi)).astype('int')
1653
1653
  alpha=(4*phase/(2*np.pi)-iph)
@@ -1720,14 +1720,14 @@ class funct(FOC.FoCUS):
1720
1720
  if image2 is not None:
1721
1721
  if list(image1.shape)!=list(image2.shape):
1722
1722
  print('The two input image should have the same size to eval Scattering Covariance')
1723
- exit(0)
1723
+ return None
1724
1724
  if mask is not None:
1725
1725
  if list(image1.shape)!=list(mask.shape)[1:]:
1726
- print('The mask should have the same size ',mask.shape,'than the input image ',image1.shape,'to eval Scattering Covariance')
1727
- exit(0)
1726
+ print('The LAST COLUMN of the mask should have the same size ',mask.shape,'than the input image ',image1.shape,'to eval Scattering Covariance')
1727
+ return None
1728
1728
  if self.use_2D and len(image1.shape)<2:
1729
1729
  print('To work with 2D scattering transform, two dimension is needed, input map has only on dimension')
1730
- exit(0)
1730
+ return None
1731
1731
 
1732
1732
  ### AUTO OR CROSS
1733
1733
  cross = False
foscat/scat_cov1D.py CHANGED
@@ -1056,11 +1056,11 @@ class funct(FOC.FoCUS):
1056
1056
  if image2 is not None:
1057
1057
  if list(image1.shape)!=list(image2.shape):
1058
1058
  print('The two input image should have the same size to eval Scattering Covariance')
1059
- exit(0)
1059
+ return None
1060
1060
  if mask is not None:
1061
1061
  if list(image1.shape)!=list(mask.shape)[1:]:
1062
1062
  print('The mask should have the same size ',mask.shape,'than the input image ',image1.shape,'to eval Scattering Covariance')
1063
- exit(0)
1063
+ return None
1064
1064
 
1065
1065
  ### AUTO OR CROSS
1066
1066
  cross = False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: foscat
3
- Version: 3.0.31
3
+ Version: 3.0.32
4
4
  Summary: Generate synthetic Healpix or 2D data using Cross Scattering Transform
5
5
  Home-page: https://github.com/jmdelouis/FOSCAT
6
6
  Author: Jean-Marc DELOUIS
@@ -0,0 +1,25 @@
1
+ foscat/CNN.py,sha256=M7i9gdPQvFTPxKySrlaKsCnOXK0iwXBKcQ2FqdPK-JM,4408
2
+ foscat/CircSpline.py,sha256=610sgsWeZzRXYh7gYEqUmGQVrXoHSaFGKjH5mCdh4jU,1684
3
+ foscat/FoCUS.py,sha256=gpLSjh7hLclDvsZDWzZDGjBu4OhmxFTCuxglxaR5LLA,70710
4
+ foscat/GCNN.py,sha256=G-M1yqLtqTfT3ddu-6vXhEFPGDgbtcEKVTRajgYHzUs,4026
5
+ foscat/GetGPUinfo.py,sha256=c01MFYCk38niYCTp0vX3WP24zVDHIsex-Cu42hc9Q18,724
6
+ foscat/Softmax.py,sha256=UDc8Kbl0qWfH1bqDDwfLnkxhON7p93ueZ-Qg2oY4Ke4,2874
7
+ foscat/Spline1D.py,sha256=9oeM8SSHjpfUE5z72YxGt1RVt22vJYM1zhHbNBW8phw,1232
8
+ foscat/Synthesis.py,sha256=aqV_3Npcl2RQj-wxQ0hDMCo650lrN6YRaMd0fAoCrQ4,12615
9
+ foscat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ foscat/backend.py,sha256=qw02rs8yVQsO12SR-SshtekX3ZjXLUAX6o04SiG3Krw,31074
11
+ foscat/backend_tens.py,sha256=zEFZ71j0nMNP9_91tz21ZVBTayr75l-sfONOLkJ8DyI,1432
12
+ foscat/loss_backend_tens.py,sha256=WbGC4vy1pBg_bxUXnlCRiXX9WszN6MaUWUc_lUvZNvQ,1667
13
+ foscat/loss_backend_torch.py,sha256=Fj_W3VwGgeD79eQ4jOxOmhZ548UKDRUb3JjUo2-gSWM,1755
14
+ foscat/scat.py,sha256=tqJ1N5ih5ibHFBw5WV5JQH45OY8Q_6Qw4PG5763OkLM,60073
15
+ foscat/scat1D.py,sha256=GalTfBmPVNy3wC2ddsckwE3KmgkSJS2sZyplKBi9ugM,45855
16
+ foscat/scat2D.py,sha256=Xtisjc5KsbLQAlbn71P0Xg1UIu3r1gUKXoYG2vIMK1M,523
17
+ foscat/scat_cov.py,sha256=kTE6Dur_bOxNZL5-87SUYkSRCy8gbTYw1DCRdM5oLwA,110223
18
+ foscat/scat_cov1D.py,sha256=1bhzaW-5Pcr1aEPOYIXiwu8KOy38JE0g_Y5PvFzGQs8,60599
19
+ foscat/scat_cov2D.py,sha256=8_XvC-lOEVUWP9vT3Wx10G_ATeVeh0SdrSWuBV7Xf5k,536
20
+ foscat/scat_cov_map.py,sha256=ocU2xd41GtJhiU9S3dEv38KfPCvz0tJKY2f8lPxpm5c,2729
21
+ foscat/scat_cov_map2D.py,sha256=t4llIt7DVIyU1b_u-dJSX4lBr2FhDict8RnNnHpRvHM,2754
22
+ foscat-3.0.32.dist-info/METADATA,sha256=hT7P_aLrB3sRXdnQCdYqNxUjSp-B9SQ7fh6J3P5wuvA,1013
23
+ foscat-3.0.32.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
24
+ foscat-3.0.32.dist-info/top_level.txt,sha256=AGySXBBAlJgb8Tj8af6m_F-aiNg2zNTcybCUPVOKjAg,7
25
+ foscat-3.0.32.dist-info/RECORD,,
@@ -1,25 +0,0 @@
1
- foscat/CNN.py,sha256=BVf-uD5K-_Tb_Q9xdckLF7PZq-Wcs6qexP9J2K8KCq0,4231
2
- foscat/CircSpline.py,sha256=610sgsWeZzRXYh7gYEqUmGQVrXoHSaFGKjH5mCdh4jU,1684
3
- foscat/FoCUS.py,sha256=uIMwben7dllVoOM4udnK2uVgnuxlondh-uhZhqVfP4Y,70674
4
- foscat/GCNN.py,sha256=TEW81DGRM4WL7RzH50VKQ-_oHbl5i3iQKuhdkkgKEO8,3831
5
- foscat/GetGPUinfo.py,sha256=6sJWKO_OeiA0SoGQQdCT_h3D8rZtrv_4hpBc8H3nZls,731
6
- foscat/Softmax.py,sha256=UDc8Kbl0qWfH1bqDDwfLnkxhON7p93ueZ-Qg2oY4Ke4,2874
7
- foscat/Spline1D.py,sha256=9oeM8SSHjpfUE5z72YxGt1RVt22vJYM1zhHbNBW8phw,1232
8
- foscat/Synthesis.py,sha256=oYtHFVTqalVzBQs5okJBnP4pzXFhBMds-pytdEm4Bqs,12611
9
- foscat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- foscat/backend.py,sha256=43Q-OtWlB-S14LH5IiUTxg9j_1WvOBZea3DkuEET7aY,31066
11
- foscat/backend_tens.py,sha256=zEFZ71j0nMNP9_91tz21ZVBTayr75l-sfONOLkJ8DyI,1432
12
- foscat/loss_backend_tens.py,sha256=WbGC4vy1pBg_bxUXnlCRiXX9WszN6MaUWUc_lUvZNvQ,1667
13
- foscat/loss_backend_torch.py,sha256=Fj_W3VwGgeD79eQ4jOxOmhZ548UKDRUb3JjUo2-gSWM,1755
14
- foscat/scat.py,sha256=Ht_xyo7XKJJrUIbQIeucjhIrJo4RGrE63EyhTH8IYig,60061
15
- foscat/scat1D.py,sha256=fiGxyWSASGik9BimBKz_Z07jSPywJckLXaHDB_v5HHQ,45847
16
- foscat/scat2D.py,sha256=Xtisjc5KsbLQAlbn71P0Xg1UIu3r1gUKXoYG2vIMK1M,523
17
- foscat/scat_cov.py,sha256=uST8ij9o1sJh2AKhFffxMUr0WFQX9vz3VK4LGfiSOlE,110188
18
- foscat/scat_cov1D.py,sha256=I2GgEo7ASkb7JW443SAp25tmI2Rvuy4xggW8WMHI-L4,60591
19
- foscat/scat_cov2D.py,sha256=8_XvC-lOEVUWP9vT3Wx10G_ATeVeh0SdrSWuBV7Xf5k,536
20
- foscat/scat_cov_map.py,sha256=ocU2xd41GtJhiU9S3dEv38KfPCvz0tJKY2f8lPxpm5c,2729
21
- foscat/scat_cov_map2D.py,sha256=t4llIt7DVIyU1b_u-dJSX4lBr2FhDict8RnNnHpRvHM,2754
22
- foscat-3.0.31.dist-info/METADATA,sha256=NqS6zLTBxPev6AJWLSpriCVc6IV3ezI_SLEBrIk7tR4,1013
23
- foscat-3.0.31.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
24
- foscat-3.0.31.dist-info/top_level.txt,sha256=AGySXBBAlJgb8Tj8af6m_F-aiNg2zNTcybCUPVOKjAg,7
25
- foscat-3.0.31.dist-info/RECORD,,