SusMat-SWAXS 2.2.0__tar.gz → 2.2.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: SusMat-SWAXS
3
- Version: 2.2.0
3
+ Version: 2.2.2
4
4
  Summary: A collection of python scripts for uploading analytical data to iRODS
5
5
  Author: Samuel Eyley
6
6
  Author-email: Samuel Eyley <susmat-swaxspypi.xepsj@simplelogin.com>
@@ -4,7 +4,7 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "SusMat-SWAXS"
7
- version = "2.2.0"
7
+ version = "2.2.2"
8
8
  description = "A collection of python scripts for uploading analytical data to iRODS"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12,<3.15"
@@ -4,7 +4,7 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "SusMat-SWAXS"
7
- version = "2.2.0"
7
+ version = "2.2.2"
8
8
  authors = [
9
9
  { name="Samuel Eyley", email="susmat-swaxspypi.xepsj@simplelogin.com" },
10
10
  ]
@@ -8,7 +8,7 @@ This package provides tools for:
8
8
  - Data visualization and analysis
9
9
  """
10
10
 
11
- __version__ = "2.2.0"
11
+ __version__ = "2.2.2"
12
12
  __author__ = "Samuel Eyley"
13
13
  __email__ = "samuel.eyley@kuleuven.be"
14
14
 
@@ -129,6 +129,9 @@ def cli():
129
129
  data_1D_corr = [data_1D[0], data_1D[1], data_1D[2]]
130
130
  if args.unit.lower() == "2th":
131
131
  data_1D_corr[1] = abscor(data_1D[0], data_1D[1], transmission_sample)
132
+ elif args.unit.lower() == "q_nm":
133
+ data_1D_corr[1] = abscor(2*np.degrees(np.arcsin(((float(file.header['WaveLength'])/1e-9)
134
+ * data_1D[0])/(4*np.pi))), data_1D[1], transmission_sample)
132
135
  else:
133
136
  data_1D_corr[1] = abscor(2*np.degrees(np.arcsin(((float(file.header['WaveLength'])/1e-10)
134
137
  * data_1D[0])/(4*np.pi))), data_1D[1], transmission_sample)
@@ -170,6 +173,9 @@ def cli():
170
173
  bkg_1D_corr = [bkg_1D[0], bkg_1D[1], bkg_1D[2]]
171
174
  if args.unit.lower() == "2th":
172
175
  bkg_1D_corr[1] = abscor(bkg_1D[0], bkg_1D[1], transmission_bkg)
176
+ elif args.unit.lower() == "q_nm":
177
+ bkg_1D_corr[1] = abscor(2*np.degrees(np.arcsin(((float(file.header['WaveLength'])/1e-9)*bkg_1D[0])/
178
+ (4*np.pi))), bkg_1D[1], transmission_bkg)
173
179
  else:
174
180
  bkg_1D_corr[1] = abscor(
175
181
  2*np.degrees(np.arcsin(((float(file.header['WaveLength'])/1e-10)*bkg_1D[0])/
@@ -202,6 +208,8 @@ def cli():
202
208
  aspect="auto")
203
209
  if args.unit.lower() == "q":
204
210
  axs['(a)'].set_xlabel(r'q /$\AA^{-1}$', fontsize=8)
211
+ elif args.unit.lower() == "q_nm":
212
+ axs['(a)'].set_xlabel(r'q /$nm^{-1}$', fontsize=8)
205
213
  else:
206
214
  axs['(a)'].set_xlabel(r'2$\theta$ /$^{\circ}$', fontsize=8)
207
215
  axs['(a)'].set_ylabel(r'$\phi/^{\circ}$', fontsize=8)
@@ -225,6 +233,8 @@ def cli():
225
233
  # axs['(b)'].set_yscale('log')
226
234
  if args.unit.lower() == "q":
227
235
  axs['(b)'].set_xlabel(r'q /$\AA^{-1}$', fontsize=8)
236
+ elif args.unit.lower() == "q_nm":
237
+ axs['(b)'].set_xlabel(r'q /$nm^{-1}$', fontsize=8)
228
238
  else:
229
239
  axs['(b)'].set_xlabel(r'2$\theta$ /$^{\circ}$', fontsize=8)
230
240
  axs['(b)'].set_ylabel('I(q) /Arb.', fontsize=8)
@@ -246,6 +256,10 @@ def cli():
246
256
  elif args.unit.lower() == "2th":
247
257
  np.savetxt(args.sample[:-4]+".xye",
248
258
  data_out, delimiter='\t', fmt='%s')
259
+ elif args.unit.lower() == "q_nm":
260
+ header_str = "q(nm^-1)\tI(Arb.)\tSigma(Arb.)"
261
+ np.savetxt(args.sample[:-4]+"_subtracted.dat",
262
+ data_out, delimiter='\t', fmt='%s', header=header_str)
249
263
 
250
264
 
251
265
  if __name__ == "__main__":
File without changes
File without changes