Skip to content
Snippets Groups Projects
Commit f2c7c1ff authored by Thomas Jürges's avatar Thomas Jürges
Browse files

Task SSB-42: Perhaps this implementation of load/store works

parent 456b20d1
No related branches found
No related tags found
1 merge request!44Merge back holography to master
...@@ -200,22 +200,45 @@ class HolographyDataset(): ...@@ -200,22 +200,45 @@ class HolographyDataset():
f = h5py.File(path, "r") f = h5py.File(path, "r")
result = HolographyDataset() result = HolographyDataset()
result.version = f.attr["Version"] result.version = f.attr["Version"]
result.mode= f.attr["mode"] result.mode= f.attr["mode"]
result.rcu_list = f.attr["RCU list"] result.rcu_list = f.attr["RCU list"]
result.sas_ids = f.attr["SAS id"] result.sas_ids = f.attr["SAS id"]
result.target_station_name = f.attr["Target station name"] result.target_station_name = f.attr["Target station name"]
result.target_station_position = f.attr["Target station position"] result.target_station_position = f.attr["Target station position"]
result.source_name = f.attr["Source name"] result.source_name = f.attr["Source name"]
result.source_position = f.attr["Source position"] result.source_position = f.attr["Source position"]
(result.start_time, result.end_time) = f.attr["Observation time"] (result.start_time, result.end_time) = f.attr["Observation time"]
result.rotation_matrix = f.attr["Rotation matrix"] result.rotation_matrix = f.attr["Rotation matrix"]
result.antenna_field_position = f.attr["Antenna field position"] result.antenna_field_position = f.attr["Antenna field position"]
result.reference_stations = f["Reference station"] result.reference_stations = f["Reference station"]
result.frequencies = f["frequency"] result.frequencies = f["frequency"]
result.ra_dec = f["RA DEC"] result.ra_dec = f["RA DEC"]
data = f["data"] data = f["data"]
for reference_station in result.reference_stations:
for frequency in result.frequencies:
for beamlet in self.beamlets:
result.data[reference_station][frequency][beamlet]["XX"] = data[reference_station][frequency][beamlet]["XX"]
result.data[reference_station][frequency][beamlet]["XY"] = data[reference_station][frequency][beamlet]["XY"]
result.data[reference_station][frequency][beamlet]["YX"] = data[reference_station][frequency][beamlet]["YX"]
result.data[reference_station][frequency][beamlet]["YY"] = data[reference_station][frequency][beamlet]["YY"]
result.data[reference_station][frequency][beamlet]["t"] = data[reference_station][frequency][beamlet]["t"]
result.data[reference_station][frequency][beamlet]["l"] = data[reference_station][frequency][beamlet]["l"]
result.data[reference_station][frequency][beamlet]["m"] = data[reference_station][frequency][beamlet]["m"]
result.data[reference_station][frequency][beamlet]["flag"] = data[reference_station][frequency][beamlet]["flag"]
result.data = data result.data = data
f.close() f.close()
...@@ -278,8 +301,16 @@ class HolographyDataset(): ...@@ -278,8 +301,16 @@ class HolographyDataset():
('m', numpy.float64), ('m', numpy.float64),
('flag', numpy.bool)]) ('flag', numpy.bool)])
dataset = f.create_dataset("data", (len(self.reference_stations), len(self.frequencies), len(self.beamlets)), dtype = h5py.special_dtype(vlen = sample_type)) dataset = f.create_dataset("data", (len(self.reference_stations), len(self.frequencies), len(self.beamlets)), dtype = h5py.special_dtype(vlen = sample_type))
for freq in self.frequencies: for reference_station in self.reference_stations:
for station in self.reference_stations: for frequency in self.frequencies:
for beamlet in self.beamlets: for beamlet in self.beamlets:
dataset[reference_station][frequency][beamlet]["XX"] = self.data[reference_station][frequency][beamlet]["XX"]
dataset[reference_station][frequency][beamlet]["XY"] = self.data[reference_station][frequency][beamlet]["XY"]
dataset[reference_station][frequency][beamlet]["YX"] = self.data[reference_station][frequency][beamlet]["YX"]
dataset[reference_station][frequency][beamlet]["YY"] = self.data[reference_station][frequency][beamlet]["YY"]
dataset[reference_station][frequency][beamlet]["t"] = self.data[reference_station][frequency][beamlet]["t"]
dataset[reference_station][frequency][beamlet]["l"] = self.data[reference_station][frequency][beamlet]["l"]
dataset[reference_station][frequency][beamlet]["m"] = self.data[reference_station][frequency][beamlet]["m"]
dataset[reference_station][frequency][beamlet]["flag"] = self.data[reference_station][frequency][beamlet]["flag"]
f.close() f.close()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment