fig.savefig(intersiteImages / "viewTime.png") # calculate spectra from resistics.project.spectra import calculateSpectra calculateSpectra(proj, sites=["site1_mt"]) calculateSpectra(proj, sites=["site2_te"], chans=["Ex", "Ey"], polreverse={"Ey": True}) proj.refresh() # calculate statistics for MT site from resistics.project.statistics import calculateStatistics calculateStatistics(proj, sites=["site1_mt"]) # intersite from resistics.project.transfunc import ( processProject, processSite, viewImpedance, ) from resistics.common.plot import plotOptionsTransferFunction, getPaperFonts plotOptions = plotOptionsTransferFunction(figsize=(24, 12), plotfonts=getPaperFonts()) plotOptions["res_ylim"] = [1, 1000000] processSite( proj, "site2_te",
from datapaths import projectPath, imagePath from resistics.project.io import loadProject from resistics.project.spectra import calculateSpectra from resistics.project.transfunc import processProject, viewImpedance from resistics.project.statistics import calculateStatistics from resistics.project.mask import newMaskData, calculateMask if __name__ == "__main__": projData = loadProject(projectPath, "multiconfig.ini") # calculate spectrum using standard options calculateSpectra(projData) projData.refresh() calculateStatistics(projData) # process project with standard options processProject(projData) figs = viewImpedance(projData, oneplot=False, show=False, save=False) figs[0].savefig(imagePath / "multproc_standard_process") # calculate mask for 128 maskData = newMaskData(projData, 128) maskData.setStats(["coherence"]) maskData.addConstraint("coherence", { "cohExHy": [0.7, 1.0], "cohEyHx": [0.7, 1.0] }) maskData.maskName = "coh70_100" calculateMask(projData, maskData, sites=["site1"]) # calculate mask for 4096 maskData = newMaskData(projData, 4096)
proj.refresh() processProject(proj, sites=["M6", "Remote"]) figs = viewImpedance( proj, sites=["M6", "Remote"], sampleFreqs=[128], oneplot=False, plotoptions=plotOptions, save=False, show=False, ) figs[0].savefig(remoteImages / "singleSiteM6_128_man8_5.png") figs[1].savefig(remoteImages / "singleSiteRemote_128_man8_5.png") # calculate the statistic we are interested in calculateStatistics(proj, sites=["M6", "Remote"], sampleFreqs=[128]) calculateRemoteStatistics(proj, "Remote", sites=["M6"], sampleFreqs=[128]) # generate single site masks maskData = newMaskData(proj, 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(proj, maskData, sites=["M6", "Remote"]) maskData.printInfo() # process remote on its own to compare to the first processing we did
from datapaths import projectPath, imagePath from resistics.project.io import loadProject # need the project path for loading projData = loadProject(projectPath) # get default statistic names from resistics.statistics.utils import getStatNames stats, remotestats = getStatNames() # calculate statistics from resistics.project.statistics 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.statistics import getStatisticData # coherence statistic data statData = getStatisticData(projData, "site1", "meas_2012-02-10_11-30-00", "coherence", declevel=0)
from datapaths import remotePath from resistics.project.io import loadProject from resistics.project.spectra import calculateSpectra from resistics.project.transfunc import processProject, viewImpedance from resistics.project.statistics import ( calculateStatistics, calculateRemoteStatistics, viewStatistic, ) from resistics.project.mask import newMaskData, calculateMask projData = loadProject(remotePath, "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( projData,
from datapaths import projectPath, imagePath from resistics.project.io import loadProject proj = loadProject(projectPath, "customconfig.ini") proj.printInfo() from resistics.project.spectra import calculateSpectra from resistics.project.statistics import calculateStatistics from resistics.project.transfunc import processProject, viewImpedance from resistics.common.plot import plotOptionsTransferFunction, getPaperFonts calculateSpectra(proj) proj.refresh() calculateStatistics(proj) processProject(proj) plotOptions = plotOptionsTransferFunction(figsize=(24, 12), plotfonts=getPaperFonts()) plotOptions["res_ylim"] = [1, 1000000] figs = viewImpedance(proj, oneplot=False, plotoptions=plotOptions, show=False, save=False) figs[0].savefig(imagePath / "impedance_config.png") # now try again with some statistics for the dead band from resistics.project.mask import newMaskData, calculateMask maskData = newMaskData(proj, 500) maskData.setStats(["coherence"]) maskData.addConstraintLevel("coherence", {
remotesite="Remote", postpend="rr") figs = viewImpedance( proj, sites=["M6"], postpend="rr", oneplot=False, plotoptions=plotOptions, show=False, save=False, ) figs[0].savefig(remoteImages / "remoteReferenceM6.png") # let's calculate some single site statistics calculateStatistics(proj, sites=["M6", "Remote"], stats=["coherence", "transferFunction"]) # calculate masks maskData = newMaskData(proj, 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(proj, maskData, sites=["M6", "Remote"])
from datapaths import projectPath from resistics.project.io import loadProject proj = loadProject(projectPath) proj.printInfo() # calculate statistics from resistics.project.spectra import calculateSpectra from resistics.project.statistics import calculateStatistics, calculateRemoteStatistics from resistics.statistics.utils import getStatNames calculateSpectra(proj) proj.refresh() stats, remotestats = getStatNames() calculateStatistics(proj, stats=stats) calculateRemoteStatistics(proj, "Remote_M1", sites=["M1"], remotestats=remotestats)