Skip to content
Snippets Groups Projects
Commit b4c2543f authored by Philipp Arras's avatar Philipp Arras
Browse files

Observation: actually slice during loading

parent 5346f981
Branches
Tags
1 merge request!26Observation slicing
Pipeline #109022 passed
......@@ -334,13 +334,23 @@ class Observation(BaseObservation):
antpos.append(val)
pol = Polarization.from_list(dct["polarization"])
direction = Direction.from_list(dct["direction"])
slc = slice(None) if lo_hi_index is None else slice(*lo_hi_index)
if lo_hi_index is None:
vis = dct["vis"]
weight = dct["weight"]
freq = dct["freq"]
else:
slc = slice(*lo_hi_index)
# Convert view into its own array
vis = dct["vis"][..., slc].copy()
weight = dct["weight"][..., slc].copy()
freq = dct["freq"][slc].copy()
del dct
return Observation(
AntennaPositions.from_list(antpos),
dct["vis"][..., slc],
dct["weight"][..., slc],
vis,
weight,
pol,
dct["freq"][slc],
freq,
direction,
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment