Exemplo n.º 1
0
    def write_pmd(self, filename=None):
        """Save ``Core`` instance to PMD file.

        Args:
          filename: PMD file

        """
        if filename is None:
            filename = self.filename
        ff = os.path.splitext(os.path.basename(filename))[0][:8]
        dt = self.date.strftime("%m-%d-%Y %H:%M")
        infoln = "{:<8}  a={:5.1f}   b={:5.1f}   s={:5.1f}   d={:5.1f}   v={}m3  {}"
        ln0 = infoln.format(
            ff,
            self.gref.lin.dd[0],
            self.gref.lin.dd[1],
            self.bedding.dd[0],
            self.bedding.dd[1],
            eformat(self.volume, 2),
            dt,
        )
        headln = (
            "STEP  Xc [Am2]  Yc [Am2]  Zc [Am2]  MAG[A/m]   Dg    Ig    Ds    Is   a95 "
        )
        with open(filename, "w") as pmdfile:
            print('/'.join([self.site, self.name]), file=pmdfile, end="\r\n")
            print(ln0, file=pmdfile, end="\r\n")
            print(headln, file=pmdfile, end="\r\n")
            for ln in self.datatable:
                print(ln, file=pmdfile, end="\r\n")
            pmdfile.write(chr(26))
Exemplo n.º 2
0
    def write_pmd(self, filename=None):
        """Save ``Core`` instance to PMD file.

        Args:
          filename: PMD file

        """
        if filename is None:
            filename = self.filename
        ff = os.path.splitext(os.path.basename(filename))[0][:8]
        dt = self.date.strftime("%m-%d-%Y %H:%M")
        infoln = "{:<8}  a={:5.1f}   b={:5.1f}   s={:5.1f}   d={:5.1f}   v={}m3  {}"
        ln0 = infoln.format(
            ff, self.alpha, self.beta, *self.bedding.rhr, eformat(self.volume, 2), dt
        )
        headln = (
            "STEP  Xc [Am2]  Yc [Am2]  Zc [Am2]  MAG[A/m]   Dg    Ig    Ds    Is  a95 "
        )
        with open(filename, "w") as pmdfile:
            print(self.info, file=pmdfile, end="\r\n")
            print(ln0, file=pmdfile, end="\r\n")
            print(headln, file=pmdfile, end="\r\n")
            for ln in self.datatable:
                print(ln, file=pmdfile, end="\r\n")
            pmdfile.write(chr(26))
Exemplo n.º 3
0
    def write_pmd(self, filename=None):
        """Save ``Core`` instance to PMD file.

        Args:
          filename: PMD file

        Example:
          >>> d.write_pmd(filename='K509A2-1.PMD')

        """
        if filename is None:
            filename = self.filename
        ff = os.path.splitext(os.path.basename(filename))[0][:8]
        dt = self.date.strftime("%m-%d-%Y %H:%M")
        infoln = "{:<8}  a={:5.1f}   b={:5.1f}   s={:5.1f}   d={:5.1f}   v={}m3  {}"
        ln0 = infoln.format(ff, self.alpha, self.beta, *self.bedding.rhr,
                            eformat(self.volume, 2), dt)
        headln = (
            "STEP  Xc [Am2]  Yc [Am2]  Zc [Am2]  MAG[A/m]   Dg    Ig    Ds    Is  a95 "
        )
        with open(filename, "w") as pmdfile:
            print(self.info, file=pmdfile, end="\r\n")
            print(ln0, file=pmdfile, end="\r\n")
            print(headln, file=pmdfile, end="\r\n")
            for ln in self.datatable:
                print(ln, file=pmdfile, end="\r\n")
            pmdfile.write(chr(26))
Exemplo n.º 4
0
 def show(self):
     print("site:{} name:{} file:{}\nbedding:{} volume:{}m3  {}".format(
         self.site,
         self.name,
         os.path.basename(self.filename),
         self.bedding,
         eformat(self.volume, 2),
         self.date.strftime("%m-%d-%Y %H:%M"),
     ))
     print("STEP  MAG[A/m]   Dsp   Isp   Dge   Ige   Dtc   Itc  a95 ")
     print("\n".join(self.datatable))
Exemplo n.º 5
0
 def show(self):
     ff = os.path.splitext(os.path.basename(self.filename))[0][:8]
     dt = self.date.strftime("%m-%d-%Y %H:%M")
     print(
         "{:<8}  α={:5.1f}   ß={:5.1f}   s={:5.1f}   d={:5.1f}   v=m3  {}".
         format(ff, self.alpha, self.beta, *self.bedding.rhr,
                eformat(self.volume, 2), dt))
     print(
         "STEP  Xc [Am²]  Yc [Am²]  Zc [Am²]  MAG[A/m]   Dg    Ig    Ds    Is  a95 "
     )
     print("\n".join(self.datatable))
Exemplo n.º 6
0
 def show(self):
     ff = os.path.splitext(os.path.basename(self.filename))[0][:8]
     dt = self.date.strftime("%m-%d-%Y %H:%M")
     print(
         "{:<8}  α={:5.1f}   ß={:5.1f}   s={:5.1f}   d={:5.1f}   v=m3  {}".format(
             ff,
             self.alpha,
             self.beta,
             *self.bedding.rhr,
             eformat(self.volume, 2),
             dt
         )
     )
     print(
         "STEP  Xc [Am²]  Yc [Am²]  Zc [Am²]  MAG[A/m]   Dg    Ig    Ds    Is  a95 "
     )
     print("\n".join(self.datatable))