Beispiel #1
0
    def load_hdf5(cls, fname):
        with h5py.File(fname, 'r') as fobj:
            metadata = Metadata._from_hdf5_file(fobj)

            try:
                subints = SubIntegrations._from_hdf5_file(fobj)
            except:
                subints = None

            curves_group = fobj['response_curves']

            dm_curve = ResponseCurve(curves_group['dm_curve_trials'].value,
                                     curves_group['dm_curve_snr'].value)

            period_curve = ResponseCurve(
                curves_group['period_curve_trials'].value,
                curves_group['period_curve_snr'].value)

            width_curve = ResponseCurve(
                curves_group['width_curve_trials'].value,
                curves_group['width_curve_snr'].value)

        return cls(dm_curve,
                   period_curve,
                   width_curve,
                   subints=subints,
                   metadata=metadata)