Updated load_1D.py
Created by: JakHolzer
Try, except deleted. Added one if/elif loop to tell apart zebra mode (bi, nb) and different angles saved
Merge request reports
Activity
Created by: ivan-usov
@JakHolzer , how about to use
is_integer()
(https://docs.python.org/3/library/stdtypes.html#float.is_integer) instead? I don't think that complicated logic withDecimal
is needed.150 for position in range(num_of_points): 151 omega.append(float(data[position + 3].split()[1])) 152 counts.append(float(data[position + 3].split()[2])) 153 monitor1.append(float(data[position + 3].split()[3])) 154 monitor2.append(float(data[position + 3].split()[4])) 155 monitor3.append(float(data[position + 3].split()[5])) 156 time.append(float(data[position + 3].split()[6])) 157 det_variables["Measurements"]["omega"] = omega 158 det_variables["Measurements"]["counts"] = counts 159 det_variables["Measurements"]["Monitor1"] = monitor1 160 det_variables["Measurements"]["Monitor2"] = monitor2 161 det_variables["Measurements"]["Monitor3"] = monitor3 162 det_variables["Measurements"]["time"] = time 163 else: 164 print("Unknown file extention") 165 if all(decimal): Created by: JakHolzer
The reason is that the hkl are in ccl in float format even for hkl, they are for example -1.000 1.000 0.000, therefore they will be evaluated as floats, not integer if I'm not mistaken. The decimal checks if there are some numbers except zeros after decimal points which is only way how to separate hkl from real indices.
pá 11. 9. 2020 v 14:07 odesílatel Ivan Usov notifications@github.com napsal:
@JakHolzer https://github.com/JakHolzer , how about to use is_integer() (https://docs.python.org/3/library/stdtypes.html#float.is_integer) instead? I don't think that complicated logic with Decimal is needed.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/paulscherrerinstitute/pyzebra/pull/5#issuecomment-691054453, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM2BBRWB7B7CNYHZJWBNVRTSFIHGJANCNFSM4RFAMJOA .