@@ -129,6 +129,7 @@ def convert_visibility_to_hdf(vis, f):
129129 f .attrs ['phasecentre_frame' ] = vis .phasecentre .frame .name
130130 f .attrs ['polarisation_frame' ] = vis .polarisation_frame .type
131131 f .attrs ['source' ] = vis .source
132+ f .attrs ['meta' ] = str (vis .meta )
132133 f ['data' ] = vis .data
133134 f = convert_configuration_to_hdf (vis .configuration , f )
134135 return f
@@ -147,8 +148,9 @@ def convert_hdf_to_visibility(f):
147148 polarisation_frame = PolarisationFrame (f .attrs ['polarisation_frame' ])
148149 data = numpy .array (f ['data' ])
149150 source = str (f .attrs ['source' ])
151+ meta = ast .literal_eval (f .attrs ['meta' ])
150152 vis = Visibility (data = data , polarisation_frame = polarisation_frame ,
151- phasecentre = phasecentre , source = source )
153+ phasecentre = phasecentre , source = source , meta = meta )
152154 vis .configuration = convert_configuration_from_hdf (f )
153155 return vis
154156
@@ -170,6 +172,7 @@ def convert_blockvisibility_to_hdf(vis: BlockVisibility, f):
170172 f .attrs ['polarisation_frame' ] = vis .polarisation_frame .type
171173 f .attrs ['frequency' ] = vis .frequency
172174 f .attrs ['source' ] = vis .source
175+ f .attrs ['meta' ] = str (vis .meta )
173176 f .attrs ['channel_bandwidth' ] = vis .channel_bandwidth
174177 f ['data' ] = vis .data
175178 f = convert_configuration_to_hdf (vis .configuration , f )
@@ -191,9 +194,11 @@ def convert_hdf_to_blockvisibility(f):
191194 channel_bandwidth = f .attrs ['channel_bandwidth' ]
192195 data = numpy .array (f ['data' ])
193196 source = f .attrs ['source' ]
197+ meta = ast .literal_eval (f .attrs ['meta' ])
194198 vis = BlockVisibility (data = data , polarisation_frame = polarisation_frame ,
195199 phasecentre = phasecentre , frequency = frequency ,
196- channel_bandwidth = channel_bandwidth , source = source )
200+ channel_bandwidth = channel_bandwidth , source = source ,
201+ meta = meta )
197202 vis .configuration = convert_configuration_from_hdf (f )
198203 return vis
199204
0 commit comments