Refactor read of counts and clarify d["om"]
This commit is contained in:
parent
b8731b9e01
commit
18ba623fd8
@ -159,22 +159,15 @@ def parse_1D(fileobj, data_type):
|
|||||||
d[param_name] = param_type(param)
|
d[param_name] = param_type(param)
|
||||||
|
|
||||||
d["om"] = np.linspace(
|
d["om"] = np.linspace(
|
||||||
float(line.split()[5])
|
d["omega_angle"] - (d["number_of_measurements"] / 2) * d["angle_step"],
|
||||||
- (int(next_line.split()[0]) / 2) * float(next_line.split()[1]),
|
d["omega_angle"] + (d["number_of_measurements"] / 2) * d["angle_step"],
|
||||||
float(line.split()[5])
|
d["number_of_measurements"],
|
||||||
+ (int(next_line.split()[0]) / 2) * float(next_line.split()[1]),
|
|
||||||
int(next_line.split()[0]),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# subsequent lines with counts
|
# subsequent lines with counts
|
||||||
counts = []
|
counts = []
|
||||||
for i in range(
|
while len(counts) < d["number_of_measurements"]:
|
||||||
int(int(next_line.split()[0]) / 10) + (int(next_line.split()[0]) % 10 > 0)
|
counts.extend(map(int, next(fileobj).split()))
|
||||||
):
|
|
||||||
fileline = next(fileobj).split()
|
|
||||||
numbers = [int(w) for w in fileline]
|
|
||||||
counts = counts + numbers
|
|
||||||
|
|
||||||
d["Counts"] = counts
|
d["Counts"] = counts
|
||||||
|
|
||||||
measurements[int(measurement_number)] = d
|
measurements[int(measurement_number)] = d
|
||||||
|
Loading…
x
Reference in New Issue
Block a user