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 calculateRemoteStatistics, viewStatistic from resistics.project.projectMask import newMaskData, calculateMask projectPath = Path("remoteProject") projData = loadProject(projectPath, "remoteConfig.ini") calculateSpectra(projData, sites=["M6", "Remote"]) projData.refresh() processProject(projData, sites=["M6", "Remote"]) viewImpedance(projData, sites=["M6", "Remote"], oneplot=False, save=True, show=False) # calculate the statistic we are interested in calculateRemoteStatistics(projData, "Remote", sites=["M6"], sampleFreqs=[128]) # generate mask maskData = newMaskData(projData, 128) maskData.setStats(["RR_coherenceEqn"]) maskData.addConstraint("RR_coherenceEqn", { "ExHyR-HyHyR": [0.8, 1.0], "EyHxR-HxHxR": [0.8, 1.0] }) # finally, lets give maskData a name, which will relate to the output file maskData.maskName = "rr_cohEqn_80_100" calculateMask(projData, maskData, sites=["M6"])
import os from resistics.project.projectIO import loadProject projectPath = os.path.join("tutorialProject") projData = loadProject(projectPath) # calculate another set of spectra for the 128 Hz data with notching at 50Hz and 16.667Hz from resistics.project.projectSpectra import calculateSpectra calculateSpectra(projData, sampleFreqs=[128], notch=[50], specdir="notch") projData.refresh() # view the spectra from resistics.utilities.utilsPlotter import plotOptionsSpec, getPaperFonts from resistics.project.projectSpectra import viewSpectra, viewSpectraSection plotOptions = plotOptionsSpec(plotfonts=getPaperFonts()) viewSpectra( projData, "site1", "meas_2012-02-10_11-30-00", specdir="notch", plotoptions=plotOptions, show=True, save=True, ) viewSpectraSection( projData, "site1", "meas_2012-02-10_11-30-00",
from resistics.utilities.utilsPlotter import plotOptionsTime, getPaperFonts plotOptions = plotOptionsTime(plotfonts=getPaperFonts()) viewTime( projData, "2018-01-03 00:00:00", "2018-01-05 00:00:00", polreverse={"Hy": True}, plotoptions=plotOptions, save=True, ) # calculate spectrum using the new configuration from resistics.project.projectSpectra import calculateSpectra calculateSpectra(projData, calibrate=False, polreverse={"Hy": True}) projData.refresh() # plot spectra stack from resistics.project.projectSpectra import viewSpectraStack from resistics.utilities.utilsPlotter import plotOptionsSpec, getPaperFonts plotOptions = plotOptionsSpec(plotfonts=getPaperFonts()) viewSpectraStack( projData, "site1", "meas", coherences=[["Ex", "Hy"], ["Ey", "Hx"]], plotoptions=plotOptions, save=True, show=False,
import os from resistics.project.projectIO import loadProject # load the project and also provide a config file projectPath = os.path.join("tutorialProject") projData = loadProject(projectPath, configFile="tutorialConfig.ini") projData.printInfo() # calculate spectrum using the new configuration from resistics.project.projectSpectra import calculateSpectra calculateSpectra(projData) projData.refresh() # process the spectra from resistics.project.projectTransferFunction import processProject, viewImpedance processProject(projData) viewImpedance(projData, sites=["site1"], oneplot=False, save=True)
from resistics.project.projectTime import viewTime from resistics.utilities.utilsPlotter import plotOptionsTime, getPaperFonts plotOptions = plotOptionsTime(plotfonts=getPaperFonts()) viewTime( projData, "2018-01-03 00:00:00", "2018-01-05 00:00:00", plotoptions=plotOptions, save=True, ) # calculate spectrum using standard options from resistics.project.projectSpectra import calculateSpectra calculateSpectra(projData, calibrate=False) projData.refresh() from resistics.project.projectSpectra import viewSpectraStack from resistics.utilities.utilsPlotter import plotOptionsSpec plotOptions = plotOptionsSpec(plotfonts=getPaperFonts()) viewSpectraStack( projData, "site1", "meas", coherences=[["Ex", "Hy"], ["Ey", "Hx"]], plotoptions=plotOptions, save=True, show=False, )