Skip to content

Commit

Permalink
Version 3.3.2
Browse files Browse the repository at this point in the history
replaced np.NAN with np.nan
  • Loading branch information
DanPorter committed Nov 21, 2024
1 parent e43784d commit ef046ee
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Dans_Diffraction/multiple_scattering.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
mslist = run_calcms(xtl, [0,0,3], [0,1,0], [1,0], [2.83, 2.85], plot=True)
Created from python package "calcms"
Version 1.1
29/07/2024
Version 1.2
21/11/2024
-------------------------------------------
Copyright 2014 Diamond Light Source Ltd.123
Expand All @@ -36,7 +36,7 @@
import itertools


__version__ = '1.1'
__version__ = '1.2'


def run_calcms(xtl, hkl, azir=[0, 0, 1], pv=[1, 0], energy_range=[7.8, 8.2], numsteps=60,
Expand Down Expand Up @@ -64,7 +64,7 @@ def run_calcms(xtl, hkl, azir=[0, 0, 1], pv=[1, 0], energy_range=[7.8, 8.2], num
# DMS Calculation
# ===============================================================================

mslist = [[np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN]]
mslist = [[np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan]]

# ================= Generate Reflist from Cif ===================================
sf, reflist, lattice, structure = loadcif(xtl, energy_range[-1])
Expand All @@ -81,7 +81,7 @@ def run_calcms(xtl, hkl, azir=[0, 0, 1], pv=[1, 0], energy_range=[7.8, 8.2], num
return None
elif pv1 + pv2 + sfonly + full + pv1xsf1 == 0:
print('Geometry Only')
mslist = [[np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN, np.NAN]]
mslist = [[np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan]]

for enval in np.linspace(energy_range[0], energy_range[1], numsteps):
print(str(loopnum) + ' of ' + str(numsteps))
Expand Down Expand Up @@ -291,7 +291,7 @@ def th(self):
# if wl/2.0/d <= 1:
theta = 180 / np.pi * np.arcsin(wl / 2.0 / d)
# else:
# theta = np.NAN;
# theta = np.nan;
return theta


Expand All @@ -317,15 +317,15 @@ def v(self):
class Vfind(object):
def __init__(self, vlist, v):
# result1=list(np.where(vlist-v==0)[0])
# self.refindex=[x if result1.count(x) >= 3 else np.NAN for x in result1]
# self.refindex=[x if result1.count(x) >= 3 else np.nan for x in result1]
v = np.array(v)
refindex2 = []
for i1 in range(v.shape[0]):
result1 = list(np.where(vlist - v[i1, :] == 0)[0])
try:
refindex = [x for x in result1 if result1.count(x) >= 3][0]
except:
refindex = np.NAN
refindex = np.nan
refindex2.append(refindex)
self.refindex = refindex2

Expand Down

0 comments on commit ef046ee

Please sign in to comment.