__author__ = 'fred'

from pythonUtils.data import Data
from scipy.integrate import trapz

pfile = "files/press.data"
vfile = "files/volume.data"
pvfile = "files/pv.data"

vmin = 195.
hub = 140.


def main():
    pdata = Data(pfile, ("t", "p")).p
    vdata = Data(vfile, ("t", "v")).v

    # Gemessenen Winkel in Volumen umrechnen [cm³]
    vdata *= -1
    vdata -= min(vdata)
    vdata *= hub/max(vdata)
    vdata += vmin

    with open(pvfile, "w+") as out:
        for p, v in zip(pdata, vdata):
            out.write("%f\t%f\n" % (p, v))

    energy = trapz(pdata * 1e3, vdata*1e-6)

    print(energy)


if __name__ == '__main__':
    main()
84ad303c0fcad22ad0da9200150aef83259a4e74
<mask token>


def main():
    pdata = Data(pfile, ('t', 'p')).p
    vdata = Data(vfile, ('t', 'v')).v
    vdata *= -1
    vdata -= min(vdata)
    vdata *= hub / max(vdata)
    vdata += vmin
    with open(pvfile, 'w+') as out:
        for p, v in zip(pdata, vdata):
            out.write('%f\t%f\n' % (p, v))
    energy = trapz(pdata * 1000.0, vdata * 1e-06)
    print(energy)


<mask token>

<mask token>


def main():
    pdata = Data(pfile, ('t', 'p')).p
    vdata = Data(vfile, ('t', 'v')).v
    vdata *= -1
    vdata -= min(vdata)
    vdata *= hub / max(vdata)
    vdata += vmin
    with open(pvfile, 'w+') as out:
        for p, v in zip(pdata, vdata):
            out.write('%f\t%f\n' % (p, v))
    energy = trapz(pdata * 1000.0, vdata * 1e-06)
    print(energy)


if __name__ == '__main__':
    main()

__author__ = 'fred'
<mask token>
pfile = 'files/press.data'
vfile = 'files/volume.data'
pvfile = 'files/pv.data'
vmin = 195.0
hub = 140.0


def main():
    pdata = Data(pfile, ('t', 'p')).p
    vdata = Data(vfile, ('t', 'v')).v
    vdata *= -1
    vdata -= min(vdata)
    vdata *= hub / max(vdata)
    vdata += vmin
    with open(pvfile, 'w+') as out:
        for p, v in zip(pdata, vdata):
            out.write('%f\t%f\n' % (p, v))
    energy = trapz(pdata * 1000.0, vdata * 1e-06)
    print(energy)


if __name__ == '__main__':
    main()

__author__ = 'fred'
from pythonUtils.data import Data
from scipy.integrate import trapz
pfile = 'files/press.data'
vfile = 'files/volume.data'
pvfile = 'files/pv.data'
vmin = 195.0
hub = 140.0


def main():
    pdata = Data(pfile, ('t', 'p')).p
    vdata = Data(vfile, ('t', 'v')).v
    vdata *= -1
    vdata -= min(vdata)
    vdata *= hub / max(vdata)
    vdata += vmin
    with open(pvfile, 'w+') as out:
        for p, v in zip(pdata, vdata):
            out.write('%f\t%f\n' % (p, v))
    energy = trapz(pdata * 1000.0, vdata * 1e-06)
    print(energy)


if __name__ == '__main__':
    main()

__author__ = 'fred'

from pythonUtils.data import Data
from scipy.integrate import trapz

pfile = "files/press.data"
vfile = "files/volume.data"
pvfile = "files/pv.data"

vmin = 195.
hub = 140.


def main():
    pdata = Data(pfile, ("t", "p")).p
    vdata = Data(vfile, ("t", "v")).v

    # Gemessenen Winkel in Volumen umrechnen [cm³]
    vdata *= -1
    vdata -= min(vdata)
    vdata *= hub/max(vdata)
    vdata += vmin

    with open(pvfile, "w+") as out:
        for p, v in zip(pdata, vdata):
            out.write("%f\t%f\n" % (p, v))

    energy = trapz(pdata * 1e3, vdata*1e-6)

    print(energy)


if __name__ == '__main__':
    main()