Skip to content

Commit

Permalink
QLD metrics for Gordana
Browse files Browse the repository at this point in the history
  • Loading branch information
Chipdelmal committed Jun 25, 2021
1 parent ba7f8de commit 15d989a
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 40 deletions.
1 change: 1 addition & 0 deletions AUS/QLD/QLD_preTraces.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
else:
rel = [0, 0]
wop = False
print(STYLE['yRange'])
###########################################################################
# Load preprocessed files lists
###########################################################################
Expand Down
83 changes: 55 additions & 28 deletions AUS/QLD/QLD_pstExplore.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,71 @@
import sys
from os import path
from datetime import datetime

from matplotlib.pyplot import vlines
import QLD_aux as aux
import QLD_gene as drv
import QLD_land as lnd
import QLD_functions as fun
# import STP_auxDebug as dbg
import numpy as np
import MoNeT_MGDrivE as monet
from joblib import Parallel, delayed
import compress_pickle as pkl


if monet.isNotebook():
(USR, AOI, LND, EXP) = ('dsk', 'HLT', '02', 's1')
JOB = aux.JOB_DSK
else:
(USR, AOI, LND, EXP) = (
sys.argv[1], sys.argv[2],
sys.argv[3], sys.argv[4]
)
JOB = aux.JOB_SRV
EXPS = aux.getExps(LND)
exp = EXP
###########################################################################
# Setting up paths
###########################################################################
(drive, land) = (
drv.driveSelector(aux.DRV, AOI, popSize=aux.POP_SIZE),
lnd.landSelector(USR, LND)
base = '/home/chipdelmal/Documents/WorkSims/QLD/Experiments/'
year = 3.5
start = int(year*365) # 1175
print('*'*50)
print(" Average signal extrema after {}y".format(year))
print('*'*50)
###########################################################################
# Analyzing seasonality
###########################################################################
pths = (
"s4/PREPROCESS/E_000-HLT_00_sum.bz",
"s4/PREPROCESS/E_000-HLT_01_sum.bz"
)
(gene, fldr) = (drive.get('gDict'), drive.get('folder'))
(PT_ROT, PT_IMG, PT_DTA, PT_PRE, PT_OUT, PT_MTR) = aux.selectPath(
USR, exp, LND
basePopMean = [pkl.load(path.join(base, i))['population'] for i in pths]
totalPop = [i[:,2] for i in basePopMean]
(mx, mn) = ([np.max(i) for i in totalPop], [np.min(i) for i in totalPop])
print('+ Max untreated: {:.0f}, {:.0f}'.format(*mx))
print('+ Min untreated: {:.0f}, {:.0f}'.format(*mn))
print('-'*50)
###########################################################################
# IIT Suppression
###########################################################################
pths = (
"s1/PREPROCESS/E_007-HLT_00_sum.bz",
"s1/PREPROCESS/E_007-HLT_01_sum.bz",
)
PT_IMG = path.join(PT_IMG, 'preTraces')
monet.makeFolder(PT_IMG)
basePopMean = [pkl.load(path.join(base, i))['population'] for i in pths]
totalPop = [i[:,2][start:] for i in basePopMean]
(mx, mn) = ([np.max(i) for i in totalPop], [np.min(i) for i in totalPop])
print('+ Max IIT: {:.0f}, {:.0f}'.format(*mx))
print('+ Min IIT: {:.0f}, {:.0f}'.format(*mn))
print('-'*50)
###########################################################################
# Setting up paths
# SRE Suppression
###########################################################################
pthB = "/home/chipdelmal/Documents/WorkSims/s4/POSTPROCESS'E_000-HLT_00.png"
pthA = "/home/chipdelmal/Documents/WorkSims/s1/POSTPROCESS/E_000-HLT_00.png"
pths = (
"s3/PREPROCESS/E_007-HLT_00_sum.bz",
"s3/PREPROCESS/E_007-HLT_01_sum.bz",
)
basePopMean = [pkl.load(path.join(base, i))['population'] for i in pths]
totalPop = [i[:,2][start:] for i in basePopMean]
(mx, mn) = ([np.max(i) for i in totalPop], [np.min(i) for i in totalPop])
print('+ Max SRE: {:.0f}, {:.0f}'.format(*mx))
print('+ Min SRE: {:.0f}, {:.0f}'.format(*mn))
print('-'*50)
###########################################################################
# IIT+SRE Suppression
###########################################################################
pths = (
"s2/PREPROCESS/E_007-HLT_00_sum.bz",
"s2/PREPROCESS/E_007-HLT_01_sum.bz",
)
basePopMean = [pkl.load(path.join(base, i))['population'] for i in pths]
totalPop = [i[:,2][start:] for i in basePopMean]
(mx, mn) = ([np.max(i) for i in totalPop], [np.min(i) for i in totalPop])
print('+ Max IIT+SRE: {:.0f}, {:.0f}'.format(*mx))
print('+ Min IIT+SRE: {:.0f}, {:.0f}'.format(*mn))
print('-'*50)
12 changes: 1 addition & 11 deletions STP/RBC/STP_aux.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,6 @@ def selectDepVars(MOI, AOI):
cmap = monet.cmapW
return (scalers, HD_DEP, IND_RAN, cmap)


# #############################################################################
# Probed experiments
# #############################################################################
EXPS_TO_PLOT = (
'E_01_00_000000_00000000000000000000000_00000000000000000000000_000800_000730_000930_000874_000482',
'E_03_00_001000_00000000000000000000030_00000000000000000010000_001600_000730_000930_000655_000723',
'E_03_00_001000_00000000000000000000030_00000000000000000000000_001200_000730_000930_000437_000482'
)

# #############################################################################
# Experiments
# #############################################################################
Expand Down Expand Up @@ -166,7 +156,7 @@ def getExperimentsIDSets(PATH_EXP, skip=-1, ext='.bz'):
# #############################################################################
# Paths and Style
# #############################################################################
def selectPath(USR, EXP, LND):
def selectPath(USR, EXP, LND, DRV=None):
if USR == 'srv':
PATH_ROOT = '/RAID5/marshallShare/STP_Grid/{}/{}/'.format(LND, EXP)
elif USR == 'dsk':
Expand Down
3 changes: 2 additions & 1 deletion STP/RBC/STP_preProcess.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
else:
(USR, AOI, LND) = (sys.argv[1], sys.argv[2], sys.argv[3])
JOB = aux.JOB_SRV
DRV = aux.DRV
###############################################################################
# Processing loop
###############################################################################
Expand All @@ -29,7 +30,7 @@
# Setting up paths
###########################################################################
(drive, land) = (
drv.driveSelector(aux.DRV, AOI, popSize=aux.POP_SIZE),
drv.driveSelector(DRV, AOI, popSize=aux.POP_SIZE),
lnd.landSelector(exp, LND)
)
(gene, fldr) = (drive.get('gDict'), drive.get('folder'))
Expand Down

0 comments on commit 15d989a

Please sign in to comment.