def read(self, filename): """ Read a TEMPO-style parameter file into a PulsarParameters structure Parameters ---------- filename: str The path to the pulsar ``.par`` file. """ # remove existing pulsarparameters if self._pulsarparameters is not None: del self._pulsarparameters pp = lalpulsar.ReadTEMPOParFile(str(filename)) if pp is None: raise IOError( "Problem reading in pulsar parameter file '{}'".format(filename) ) self._pulsarparameters = pp # store copy of the contents of the par file with open(filename, "r") as fp: self._parcontent = fp.read()
def read(self, filename): """ Read a TEMPO-style parameter file into a PulsarParameters structure Args: filename (str): the path to the pulsar `.par` file. """ # remove existing pulsarparameters if self._pulsarparameters is not None: del self._pulsarparameters pp = lalpulsar.ReadTEMPOParFile(filename) if pp is None: raise IOError("Problem reading in pulsar parameter file '{}'".format(filename)) self._pulsarparameters = pp