from datapaths import remotePath, remoteImages from resistics.project.io import loadProject from resistics.project.spectra import calculateSpectra from resistics.project.transfunc import processProject, viewImpedance from resistics.project.statistics import calculateRemoteStatistics, viewStatistic from resistics.project.mask import newMaskData, calculateMask from resistics.common.plot import plotOptionsTransferFunction, getPaperFonts plotOptions = plotOptionsTransferFunction(plotfonts=getPaperFonts()) proj = loadProject(remotePath, "remoteConfig.ini") calculateSpectra(proj, sites=["M6", "Remote"]) proj.refresh() # single site processing 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_dec8_5.png") figs[1].savefig(remoteImages / "singleSiteRemote_128_dec8_5.png") # calculate the statistic we are interested in calculateRemoteStatistics(proj, "Remote", sites=["M6"], sampleFreqs=[128])
plotOptions = plotOptionsTime(plotfonts=getPaperFonts()) fig = viewTime( projData, "2018-01-03 00:00:00", "2018-01-05 00:00:00", polreverse={"Hy": True}, plotoptions=plotOptions, save=False, ) fig.savefig(imagePath / "viewTime_polreverse") # calculate spectrum using the new configuration from resistics.project.spectra import calculateSpectra calculateSpectra(projData, calibrate=False, polreverse={"Hy": True}) projData.refresh() # plot spectra stack from resistics.project.spectra import viewSpectraStack from resistics.common.plot import plotOptionsSpec, getPaperFonts plotOptions = plotOptionsSpec(plotfonts=getPaperFonts()) fig = viewSpectraStack( projData, "site1", "meas", coherences=[["Ex", "Hy"], ["Ey", "Hx"]], plotoptions=plotOptions, save=False, show=False,
from resistics.project.time import viewTime fig = viewTime( proj, startDate="2019-05-27 14:15:00", endDate="2019-05-27 15:00:00", filter={"lpfilt": 4}, save=False, show=False, ) 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,
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)
from datapaths import projectPath, imagePath from resistics.project.io import loadProject projData = loadProject(projectPath) # calculate another set of spectra for the 128 Hz data with notching at 50Hz and 16.667Hz from resistics.project.spectra import calculateSpectra calculateSpectra(projData, sampleFreqs=[128], notch=[50], specdir="notch") projData.refresh() # view the spectra from resistics.common.plot import plotOptionsSpec, getPaperFonts from resistics.project.spectra import viewSpectra, viewSpectraSection plotOptions = plotOptionsSpec(plotfonts=getPaperFonts()) fig = viewSpectra( projData, "site1", "meas_2012-02-10_11-30-00", specdir="notch", plotoptions=plotOptions, show=False, save=False, ) fig.savefig(imagePath / "multspec_viewspec_notch_spec") fig = viewSpectraSection( projData, "site1", "meas_2012-02-10_11-30-00",
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", {
from resistics.common.plot import plotOptionsTime, getPaperFonts plotOptions = plotOptionsTime(plotfonts=getPaperFonts()) fig = viewTime( projData, "2018-01-03 00:00:00", "2018-01-05 00:00:00", plotoptions=plotOptions, save=False, ) fig.savefig(imagePath / "viewTime") # calculate spectrum using standard options from resistics.project.spectra import calculateSpectra calculateSpectra(projData, calibrate=False) projData.refresh() from resistics.project.spectra import viewSpectraStack from resistics.common.plot import plotOptionsSpec plotOptions = plotOptionsSpec(plotfonts=getPaperFonts()) fig = viewSpectraStack( projData, "site1", "meas", coherences=[["Ex", "Hy"], ["Ey", "Hx"]], plotoptions=plotOptions, save=False, show=False, )