Пример #1
0
    postpend="rr_cohEqn_80_100_night",
)

viewImpedance(
    projData,
    sites=["M6"],
    sampleFreqs=[128],
    postpend="rr_cohEqn_80_100_night",
    oneplot=False,
    save=True,
    show=False,
)

# one more example with multiple masks
# let's use standard coherence as well for both M6 and Remote individually
calculateStatistics(projData, sites=["M6", "Remote"], sampleFreqs=[128])
# generate mask
maskData = newMaskData(projData, 128)
maskData.setStats(["coherence"])
maskData.addConstraint(
    "coherence", {"cohExHy": [0.8, 1.0], "cohEyHx": [0.8, 1.0]}
)
# finally, lets give maskData a name, which will relate to the output file
maskData.maskName = "coh_80_100"
calculateMask(projData, maskData, sites=["M6", "Remote"])
maskData.printInfo()

processProject(
    projData,
    sites=["M6"],
    sampleFreqs=[128],
Пример #2
0
from pathlib import Path
from resistics.project.projectIO import loadProject
from resistics.project.projectSpectra import calculateSpectra
from resistics.project.projectTransferFunction import processProject, viewImpedance
from resistics.project.projectStatistics import (
    calculateStatistics,
    calculateRemoteStatistics,
    viewStatistic,
)
from resistics.project.projectMask import newMaskData, calculateMask

projectPath = Path("remoteProject")
projData = loadProject(projectPath, "remoteConfig.ini")

calculateStatistics(projData,
                    sites=["M6"],
                    sampleFreqs=[512, 4096, 16384, 65536])
# generate mask
for fs in [512, 4096, 16384, 65536]:
    maskData = newMaskData(projData, fs)
    maskData.setStats(["coherence"])
    maskData.addConstraint("coherence", {
        "cohExHy": [0.8, 1.0],
        "cohEyHx": [0.8, 1.0]
    })
    # finally, lets give maskData a name, which will relate to the output file
    maskData.maskName = "coh_80_100"
    calculateMask(projData, maskData, sites=["M6"])
    maskData.printInfo()

processProject(
Пример #3
0
# perform standard remote reference runs - remember to call the output something else
processProject(projData,
               sites=["M6"],
               sampleFreqs=[128],
               remotesite="Remote",
               postpend="rr")
viewImpedance(projData,
              sites=["M6"],
              postpend="rr",
              oneplot=False,
              show=False,
              save=True)

# let's calculate some single site statistics
calculateStatistics(projData, sites=["M6", "Remote"], stats=["coherence"])

# calculate masks
maskData = newMaskData(projData, 128)
maskData.setStats(["coherence"])
maskData.addConstraint("coherence", {
    "cohExHy": [0.8, 1.0],
    "cohEyHx": [0.8, 1.0]
})
maskData.maskName = "coh80_100"
maskData.printInfo()
maskData.printConstraints()
# calculate
calculateMask(projData, maskData, sites=["M6", "Remote"])

# single site processing again
Пример #4
0
import os
from resistics.project.projectIO import loadProject

#  load the project and also provide a config file
projectPath = os.path.join("asciiProject")
projData = loadProject(projectPath, configFile="asciiconfig.ini")
projData.printInfo()

# calculate statistics
from resistics.project.projectStatistics import calculateStatistics

calculateStatistics(projData)

# create a mask based on coherence
from resistics.project.projectMask import newMaskData, calculateMask

maskData = newMaskData(projData, 0.5)
maskData.setStats(["coherence"])
maskData.addConstraint("coherence", {"cohExHy": [0.3, 1.0], "cohEyHx": [0.3, 1.0]})
maskData.maskName = "coh30_100"
calculateMask(projData, maskData, sites=["site1"])
fig = maskData.view(0)
fig.savefig(os.path.join(projectPath, "images", "maskcoh"))

# calculate impedance tensor
from resistics.project.projectTransferFunction import processProject

processProject(
    projData, outchans=["Ex", "Ey"], masks={"site1": maskData.maskName}, postpend=maskData.maskName
)
projData.refresh()
Пример #5
0
import os
from resistics.project.projectIO import loadProject

# need the project path for loading
projectPath = os.path.join("tutorialProject")
projData = loadProject(projectPath)

# get default statistic names
from resistics.utilities.utilsStats import getStatNames

stats, remotestats = getStatNames()

# calculate statistics
from resistics.project.projectStatistics import calculateStatistics

calculateStatistics(projData, stats=stats)

# calculate statistics for a different spectra directory
# load the project with the tutorial configuration file
projData = loadProject(projectPath, configFile="tutorialConfig.ini")
projData.printInfo()
calculateStatistics(projData, stats=stats)

# to get statistic data, we need the site, the measurement and the statistic we want
from resistics.project.projectStatistics import getStatisticData

# coherence statistic data
statData = getStatisticData(
    projData, "site1", "meas_2012-02-10_11-30-00", "coherence", declevel=0
)
# view statistic value over time