text: #!/usr/bin/env python3
  # -*- coding: utf-8 -*-
  """
  Created on Wed Jun 17 13:21:12 2020
  
  @author: lorenz
  """
  
  jointDict = {
    'Head0_Sternum7_q_ss'              : "Neck",
    'LeftForearm5_LeftHand0_q_ss'      : "L-Wrist",
    'LeftForearm6_LeftUpperArm7_q_ss'  : "L-Elbow",
    'LeftShoulder0_Sternum8_q_ss'      : "L-Clavicle",
    'LeftShoulder2_LeftUpperArm0_q_ss' : "L-Shoulder",
    'RightForearm5_RightHand0_q_ss'    : "R-Wrist",
    'RightForearm6_RightUpperArm7_q_ss': "R-Elbow",
    'RightShoulder2_RightUpperArm0_q_ss':"R-Shoulder",
    'RightShoulder0_Sternum9_q_ss'     : "R-Clavicle",
    'Pelvis7_Sternum0_q_ss'            : "Back",
    'LeftUpperLeg0_Pelvis5_q_ss'       : "L-Hip",
    'LeftLowerLeg9_LeftUpperLeg7_q_ss' : "L-Knee",
    'LeftLowerLeg10_LeftUpperLeg7_q_ss': "L-Knee",
    'LeftFoot9_LeftLowerLeg8_q_ss'     : "L-Ankle",
    'Pelvis6_RightUpperLeg0_q_ss'      : "R-Hip",
    'RightLowerLeg9_RightUpperLeg7_q_ss':"R-Knee",
    'RightLowerLeg10_RightUpperLeg7_q_ss':"R-Knee",
    'RightFoot9_RightLowerLeg8_q_ss'   : "R-Ankle",
    }
  
  segPair2JointDict = {
  # ('R-Forearm', 'R-Hand')         : "R-Wrist",
  # ('L-Forearm', 'L-Hand')         : "L-Wrist",
  ('L-Forearm', 'L-Upperarm')     : "L-Elbow",
  ('L-Shoulder', 'Sternum')       : "L-Clavicle",
  ('L-Shoulder', 'L-Upperarm')    : "L-Shoulder",
  ('R-Forearm', 'R-Upperarm')     : "R-Elbow",
  ('R-Shoulder','R-Upperarm')     :"R-Shoulder",
  ('R-Shoulder','Sternum' )       : "R-Clavicle",
  ('Pelvis', 'Sternum')            : "Back" }
  
  invertForGraph = {
   "L-Elbow"      : False,
   "L-Knee"       : False,
   "L-Shoulder"   : True,
   "L-Clavicle"   : False,
   "L-Hip"        : False,
   "R-Hip"        : True,
   "Back"         : True,
   "R-Elbow"      : False,
   "R-Knee"       : False,
   "R-Shoulder"   : True,
   "R-Clavicle"   : False
   }
  
  # %% activity segmentation
  categLongTerm = ['NPose', 'Walk', 'S1Shelf2Ground', 'Waiting', 'S1Ground2Shelf',
                   'S2L-Hand-Up','S2L-Hand-Low', 'S2R-Hand-Up','S2R-Hand-Low', 'S3Working']
  
  dictPerson2Activ = {
      1: [# lifts pants very often
          (217,'NPose'), (500,'Walk'),
          (3491,'S1Shelf2Ground'), (3730,'Waiting'), (6600, 'S1Ground2Shelf'),
          (6900,'Walk'), (7653,'NPose'),(8106,'Walk'),
          (9398,'S2L-Hand-Up'),(10435,'S2R-Hand-Up'),(12157,'S2L-Hand-Low'),(13400,'S2R-Hand-Low'),
          (13846,'Walk'), (14546,'NPose'), (14708,'Walk'),
          (18287,'S3Working'),(18439,'NPose'),(21946,'S3Working'),
          (22204,'Walk'), (24403,'NPose'),(24660,'Walk'),
          (27760,'S1Shelf2Ground'), (27860,'Waiting'), (30702, 'S1Ground2Shelf'),
          (31092,'Walk'), (31627,'NPose'),(31925,'Walk'),
          (33415,'S2L-Hand-Up'),(34581,'S2R-Hand-Up'),(36138,'S2L-Hand-Low'),(37784,'S2R-Hand-Low'),
          (38284,'Walk'), (38668,'NPose'), (39000,'Walk'),
          (42705,'S3Working'),(42904,'NPose'),(46420,'S3Working'),
          (46622,'Walk'), (49706,'NPose'),(49970,'Walk'),
          (53016,'S1Shelf2Ground'), (55827,'Waiting'), (58990, 'S1Ground2Shelf'),
          (59300,'Walk'), (61930,'NPose'),(62226,'Walk'),
          (64375,'S2L-Hand-Up'),(65414,'S2R-Hand-Up'),(67077,'S2L-Hand-Low'),(68460,'S2R-Hand-Low'),
          (68822,'Walk'), (70024,'NPose'),(70140,'Walk'),
          (76240,'S3Working'),
          (76455,'Walk'), (79235,'NPose'),(79500,'Walk'),
          (82730,'S1Shelf2Ground'), (83020,'Waiting'), (86025, 'S1Ground2Shelf'),
          (86310,'Walk'), (86660,'NPose'),(86970,'Walk'),
          (88230,'S2L-Hand-Up'),(89300,'S2R-Hand-Up'),(90500,'S2L-Hand-Low'),(91500,'S2R-Hand-Low'),
          (91930,'Walk'), (92190,'NPose'),(92390,'Walk'),
          (99200,'S3Working'),
          (101036,'NPose')
          ],
      2: [ # lifts pants very often
          (320,'NPose'), (540,'Walk'),
          (3860,'S1Shelf2Ground'), (5270,'Waiting'), (8910, 'S1Ground2Shelf'),
          (9140,'Walk'), (10860,'NPose'),(11150,'Walk'),
          (12150,'S2L-Hand-Up'),(12700,'S2R-Hand-Up'),(13670,'S2L-Hand-Low'),(14770,'S2R-Hand-Low'),
          (15300,'Walk'),
          (22300,'S3Working'),
          (22570,'Walk'), (25280,'NPose'),(25440,'Walk'),
          (28180,'S1Shelf2Ground'), (29920,'Waiting'), (32880, 'S1Ground2Shelf'),
          (33120,'Walk'), (33780,'NPose'),(34110,'Walk'),
          (34890,'S2L-Hand-Up'),(35440,'S2R-Hand-Up'),(36540,'S2L-Hand-Low'),(37860,'S2R-Hand-Low'),
          (38200,'Walk'), (38790,'NPose'), (38930,'Walk'),
          (45150,'S3Working'),
          (45460,'Walk'), (47980,'NPose'),(48200,'Walk'),
          (51160,'S1Shelf2Ground'), (53890, 'S1Ground2Shelf'),
          (54330,'Walk'), (55730,'NPose'),(56020,'Walk'),
          (56730,'S2L-Hand-Up'),(57220,'S2R-Hand-Up'),(58160,'S2L-Hand-Low'),(59310,'S2R-Hand-Low'),
          (60670,'S2L-Hand-Up'),(61810,'S2R-Hand-Up'),(63310,'S2L-Hand-Low'),(65040,'S2R-Hand-Low'),
          (65460,'Walk'), (66800,'NPose'),(66920,'Walk'),
          (74230,'S3Working'),
          (74460,'Walk'), (77360,'NPose'),(77580,'Walk'),
          (80400,'S1Shelf2Ground'), (82800,'Waiting'), (85750, 'S1Ground2Shelf'),
          (86060,'Walk'), (87220,'NPose'),(87640,'Walk'),
          (88650,'S2L-Hand-Up'),(89500,'S2R-Hand-Up'),(90710,'S2L-Hand-Low'),(92120,'S2R-Hand-Low'),
          (93660,'NPose'),
          (94820,'S2L-Hand-Up'),(95750,'S2R-Hand-Up'),(97030,'S2L-Hand-Low'),(98370,'S2R-Hand-Low'),
          (98720,'Walk'), (99320,'NPose'),(99560,'Walk'),
          (106330,'S3Working'),(106620,'Walk'),(108053,'NPose'),
          ],
      3: [ # lifts pants very often
          (340,'NPose'), (690,'Walk'),
          (5680,'S1Shelf2Ground'), (8920, 'S1Ground2Shelf'),
          (9220,'Walk'), (11080,'NPose'),(11380,'Walk'),
          (12670,'S2L-Hand-Up'),(13760,'S2R-Hand-Up'),(14910,'S2L-Hand-Low'), (15980,'S2R-Hand-Low'),
          (16310,'Walk'), (16960,'NPose'), (17430,'Walk'),
          (24840,'S3Working'),
          (25040,'Walk'), (27540,'NPose'),(27750,'Walk'),
          (31200,'S1Shelf2Ground'), (34220,'Waiting'), (37490, 'S1Ground2Shelf'),
          (37760,'Walk'), (37980,'NPose'),(38480,'Walk'),
          (39180,'S2L-Hand-Up'),(39870,'S2R-Hand-Up'),(40740,'S2L-Hand-Low'),(42030,'S2R-Hand-Low'),
          (42270,'Walk'), (42920,'NPose'), (43160,'Walk'),
          (51160,'S3Working'),
          (51400,'Walk'), (54580,'NPose'),(54810,'Walk'),
          (57960,'S1Shelf2Ground'), (59760,'Waiting'), (63240, 'S1Ground2Shelf'),
          (63560,'Walk'), (65760,'NPose'),(66340,'Walk'),
          (67080,'S2L-Hand-Up'),(68040,'S2R-Hand-Up'),(69110,'S2L-Hand-Low'),(70350,'S2R-Hand-Low'),
          (70840,'Walk'), (72440,'NPose'),(72640,'Walk'),
          (80470,'S3Working'),
          (80690,'Walk'), (83020,'NPose'),(83380,'Walk'),
          (86680,'S1Shelf2Ground'), (89790, 'S1Ground2Shelf'),
          (90130,'Walk'), (91260,'NPose'), (92840,'Waiting'), (93200,'Walk'),
          (94080,'S2L-Hand-Up'),(95040,'S2R-Hand-Up'),(96190,'S2L-Hand-Low'),(97430,'S2R-Hand-Low'),
          (97700,'Walk'), (98520,'NPose'),(98565,'Walk'),
          (105870,'S3Working'),
          (106090,'Walk'),(106755,'NPose')
          ],
      4: [ # lifts pants often
          (130,'NPose'), (350,'Walk'),
          (3800,'S1Shelf2Ground'), (7470, 'S1Ground2Shelf'),
          (8560,'Walk'), (9320,'NPose'),(9600,'Walk'),
          (10850,'S2L-Hand-Up'),(11860,'S2R-Hand-Up'),(12890,'S2L-Hand-Low'),(14190,'S2R-Hand-Low'),
          (14460,'Walk'), (16520,'NPose'), (16730,'Walk'),
          (24390,'S3Working'),
          (24690,'Walk'), (25670,'NPose'),(25890,'Walk'),
          (29300,'S1Shelf2Ground'), (31920,'Waiting'), ( 35290, 'S1Ground2Shelf'),
          (35620,'Walk'), (36310,'NPose'),(36610,'Walk'),
          (37870,'S2L-Hand-Up'),(38810,'S2R-Hand-Up'),(39760,'S2L-Hand-Low'),(40880,'S2R-Hand-Low'),
          (41140,'Walk'), (41540,'NPose'), (41730,'Walk'),
          (49210,'S3Working'),
          (49480,'Walk'), (51710,'NPose'), (52010,'Walk'),
          (55410,'S1Shelf2Ground'), (58680, 'S1Ground2Shelf'),
          (58990,'Walk'), (60080,'NPose'),(60380,'Walk'),
          (61550,'S2L-Hand-Up'),(62550,'S2R-Hand-Up'),(63580,'S2L-Hand-Low'),(64470,'S2R-Hand-Low'),
          (64850,'Walk'), (65630,'NPose'),(65800,'Walk'),
          (73560,'S3Working'),
          (73870,'Walk'), (76720,'NPose'),(76960,'Walk'),
          (80340,'S1Shelf2Ground'), (83760, 'S1Ground2Shelf'),
          (84010,'Walk'), (85820,'NPose'),(86090,'Walk'),
          (87100,'S2L-Hand-Up'),(87890,'S2R-Hand-Up'),(88850,'S2L-Hand-Low'),(89700,'S2R-Hand-Low'),
          (90020,'Walk'), (92630,'NPose'),(92860,'Walk'),
          (100230,'S3Working'),
          (100460,'Walk'), (100566,'NPose')
          ],
      5 : [
          (30,'NPose'), (410,'Walk'),
          (4310,'S1Shelf2Ground'), (8030, 'S1Ground2Shelf'),
          (8630,'Walk'), (8880,'NPose'),(9120,'Walk'),
          (10400,'S2L-Hand-Up'),(11200,'S2R-Hand-Up'),(11950,'S2L-Hand-Low'),(12980,'S2R-Hand-Low'),
          (13390,'Walk'), (14940,'NPose'), (15150,'Walk'),
          (24640,'S3Working'),
          (24870,'Walk'), (26080,'Waiting'),(27610,'NPose'),(27810,'Waiting'),(28070,'Walk'),
          (32120,'S1Shelf2Ground'), (36820, 'S1Ground2Shelf'),
          (37120,'Walk'), (37840,'NPose'),(38040,'Walk'),
          (39090,'S2L-Hand-Up'),(40080,'S2R-Hand-Up'),(41010,'S2L-Hand-Low'),(42300,'S2R-Hand-Low'),
          (42740,'Walk'), (44420,'NPose'), (44650,'Walk'),
          (53840,'S3Working'),
          (54240,'Walk'), (57540,'NPose'),(57740,'Walk'),
          (61350,'S1Shelf2Ground'), (65870,'S1Ground2Shelf'),
          (66220,'Walk'), (68300,'NPose'),(68550,'Walk'),
          (69800,'S2L-Hand-Up'),(70760,'S2R-Hand-Up'),(71590,'S2L-Hand-Low'),(72670,'S2R-Hand-Low'),
          (73180,'Walk'), (74180,'NPose'),(74330,'Walk'),
          (83140,'S3Working'),
          (83620,'Walk'), (86620,'NPose'),(86950,'Walk'),
          (91010,'S1Shelf2Ground'), (92930,'Waiting'), (97190 ,'S1Ground2Shelf'),
          (97670,'Walk'), (98690,'NPose'),(99010,'Walk'),
          (100160,'S2L-Hand-Up'), (101180,'S2R-Hand-Up'), (102130,'S2L-Hand-Low'),(103200,'S2R-Hand-Low'),
          (103640,'Walk'), (103870,'NPose'),(104050,'Walk'),
          (113470,'S3Working'),
          (114000,'Walk'),(114128,'NPose')
          ],
      6: [
          (140,'NPose'), (430,'Walk'),
          (4640,'S1Shelf2Ground'), (6830,'Waiting'), (10890,'S1Ground2Shelf'),
          (11400,'Walk'), (12760,'NPose'),(13160,'Walk'),
          (15640,'S2L-Hand-Up'),(17160,'S2R-Hand-Up'),(19280,'S2L-Hand-Low'),(21440,'S2R-Hand-Low'),
          (21890,'Walk'), (22520,'NPose'), (22760,'Walk'),
          (30920,'S3Working'),
          (31220,'Walk'), (34390,'NPose'), (34690,'Walk'),
          (38540,'S1Shelf2Ground'), (42410, 'S1Ground2Shelf'),
          (43310,'Walk'), (44260,'NPose'),(44640,'Walk'),
          (46440,'S2L-Hand-Up'),(47600,'S2R-Hand-Up'),(48860,'S2L-Hand-Low'),(50460,'S2R-Hand-Low'),
          (50910,'Walk'), (52080,'NPose'), (52230,'Walk'),
          (61290,'S3Working'),
          (61540,'Walk'), (64460,'NPose'),(64720,'Walk'),
          (68810,'S1Shelf2Ground'), (72140,'Waiting'), (76010, 'S1Ground2Shelf'),
          (76220,'Walk'), (76660,'NPose'),(76990,'Walk'),
          (78300,'S2L-Hand-Up'),(79220,'S2R-Hand-Up'),(80560,'S2L-Hand-Low'),(81650,'S2R-Hand-Low'),
          (82040,'Walk'), (82370,'NPose'),(83420,'Walk'),
          (90790,'S3Working'),
          (91360,'Walk'), (92480,'NPose'),(92950,'Walk'),
          (95300,'S1Shelf2Ground'),( 97710, 'S1Ground2Shelf'),
          (98270,'Walk'), (98460,'NPose'),(98770,'Walk'),
          (99300,'S2L-Hand-Up'),(99810,'S2R-Hand-Up'),(100560,'S2L-Hand-Low'),(101320,'S2R-Hand-Low'),
          (101660,'Walk'), (101980,'NPose'),(102090,'Walk'),
          (108860,'S3Working'),
          (109150, 'Walk'), (109412,'NPose')
          ],
      7: [
          (40,'NPose'), (310,'Walk'),
          (3570,'S1Shelf2Ground'), (7410,'Waiting'), (10170, 'S1Ground2Shelf'),
          (10480,'Walk'), (11310,'NPose'),(11550,'Walk'),
          (13410,'S2L-Hand-Up'),(14610,'S2R-Hand-Up'),(16190,'S2L-Hand-Low'),(17520,'S2R-Hand-Low'),
          (17800,'Walk'), (18500,'NPose'), (18660,'Walk'),
          (24990,'S3Working'),
          (25320,'Walk'), (26440,'NPose'),(26760,'Walk'),
          (30050,'S1Shelf2Ground'), (32950,'Waiting'), (36020, 'S1Ground2Shelf'),
          (36470,'Walk'), (37830,'NPose'),(38190,'Walk'),
          (40350,'S2L-Hand-Up'),(41580,'S2R-Hand-Up'),(43620,'S2L-Hand-Low'),(45120,'S2R-Hand-Low'),
          (45500,'Walk'), ( 46180,'NPose'), (46330,'Walk'),
          (52620,'S3Working'),
          (53080,'Walk'), (54840,'NPose'),(55180,'Walk'),
          (58110,'S1Shelf2Ground'), (60600,'Waiting'), (63650, 'S1Ground2Shelf'),
          (64100,'Walk'), (65150,'NPose'),(65440,'Walk'),
          (67360,'S2L-Hand-Up'),(68520,'S2R-Hand-Up'),(70210,'S2L-Hand-Low'), (71440,'S2R-Hand-Low'),
          (71750,'Walk'), (75410,'NPose'),(75560,'Walk'),
          (82390,'S3Working'),
          (82660,'Walk'), (84640,'NPose'),(84850,'Walk'),
          (87910,'S1Shelf2Ground'), (90830,'Waiting'), ( 93560, 'S1Ground2Shelf'),
          (93980,'Walk'), (95520,'NPose'),(95730,'Walk'),
          (97570,'S2L-Hand-Up'),(98500,'S2R-Hand-Up'),(100100,'S2L-Hand-Low'),(101250,'S2R-Hand-Low'),
          (101600,'Walk'), (102960,'NPose'),(103130,'Walk'),
          (109260,'S3Working'),
          (109549,'NPose')
          ],
      8: [
          (120,'NPose'), (330,'Walk'),
          (3270,'S1Shelf2Ground'), (5990,'Waiting'), (8970, 'S1Ground2Shelf'),
          (9320,'Walk'), (10280,'NPose'),(10500,'Walk'),
          (12110,'S2L-Hand-Up'),(12960,'S2R-Hand-Up'),(14520,'S2L-Hand-Low'),(15860,'S2R-Hand-Low'),
          (16120,'Walk'), (17080,'NPose'), (17220,'Walk'),
          (22020,'S3Working'),
          (22240,'Walk'), (23660,'NPose'), (23870,'Walk'),
          (26340,'S1Shelf2Ground'), (28880, 'S1Ground2Shelf'),
          (29140,'Walk'), (29960,'NPose'),(30150,'Walk'),
          (31470,'S2L-Hand-Up'),(32300,'S2R-Hand-Up'),(33920,'S2L-Hand-Low'),(34970,'S2R-Hand-Low'),
          (35220,'Walk'), (37220,'NPose'), (37700,'Walk'),
          (42440,'S3Working'),
          (42580,'Walk'), (44120,'NPose'),(44370,'Walk'),
          (46880,'S1Shelf2Ground'), (50340,'Waiting'), (52930, 'S1Ground2Shelf'),
          (53250,'Walk'), (53740,'NPose'),(53900,'Walk'),
          (55270,'S2L-Hand-Up'),(56040,'S2R-Hand-Up'),(57630,'S2L-Hand-Low'),(58600,'S2R-Hand-Low'),
          (58940,'Walk'), (61730,'NPose'),(61860,'Walk'),
          (67500,'S3Working'),
          (67920,'Walk'), (69880,'NPose'),(70040,'Walk'),
          (72640,'S1Shelf2Ground'), (75400, 'S1Ground2Shelf'),
          (75720,'Walk'), (78180,'NPose'),(78370,'Walk'),
          (80090,'S2L-Hand-Up'), (80910,'S2R-Hand-Up'),(82410,'S2L-Hand-Low'),(83770,'S2R-Hand-Low'),
          (84290,'Walk'), (85370,'NPose'),(85510,'Walk'),
          (90980,'S3Working'),
          (91230,'Walk'),(92430,'NPose'),(92590,'Walk'),
          (95050,'S1Shelf2Ground'), (97510, 'S1Ground2Shelf'),
          (97730,'Walk'),(98180,'NPose'),(98390,'Walk'),
          (99660,'S2L-Hand-Up'), (100480,'S2R-Hand-Up'),(101990,'S2L-Hand-Low'),(103130,'S2R-Hand-Low'),
          (103490,'Walk'),(104110,'NPose'),(104120,'Walk'),
          (108660,'S3Working'),
          (108776,'NPose')
          ],
      9: [
          (130,'NPose'), (310,'Walk'),
          (3170,'S1Shelf2Ground'), (6130, 'S1Ground2Shelf'),
          (6390,'Walk'), (7790,'NPose'),(8020,'Walk'),
          (9680,'S2L-Hand-Up'),(11210,'S2R-Hand-Up'),(13080,'S2L-Hand-Low'),(14620,'S2R-Hand-Low'),
          (15010,'Walk'), (15830,'NPose'), (16000,'Walk'),
          (22250,'S3Working'),
          (22500,'Walk'), (24250,'NPose'),(24430,'Walk'),
          (27010,'S1Shelf2Ground'), (29710, 'S1Ground2Shelf'),
          (29950,'Walk'), (31880,'NPose'),(32140,'Walk'),
          (33930,'S2L-Hand-Up'),(35420,'S2R-Hand-Up'),(37110,'S2L-Hand-Low'),(38860,'S2R-Hand-Low'),
          (39230,'Walk'), (41630,'NPose'), (41770,'Walk'),
          (46270,'S3Working'),(47410,'Waiting'),(49390,'S3Working'),
          (49680,'Walk'), (51710,'NPose'),(51860,'Walk'),
          (55010,'S1Shelf2Ground'), (58550,'Waiting'), (61810, 'S1Ground2Shelf'),
          (62250,'Walk'), (66010,'NPose'),(66250,'Walk'),
          (67870,'S2L-Hand-Up'),(69540,'S2R-Hand-Up'),(71270,'S2L-Hand-Low'),(73310,'S2R-Hand-Low'),
          (73760,'Walk'), (77310,'NPose'),(77470,'Walk'),
          (84410,'S3Working'),
          (84720,'Walk'), (87590,'NPose'),(87780,'Walk'),
          (90980,'S1Shelf2Ground'), (95540,'Waiting'), (98730, 'S1Ground2Shelf'),
          (99050,'Walk'), (100900,'NPose'),(101160,'Walk'),
          (102990,'S2L-Hand-Up'),(104730,'S2R-Hand-Up'),(106270,'S2L-Hand-Low'),(108020,'S2R-Hand-Low'),
          (108390,'Walk'), (111870,'NPose'),(112050,'Walk'),
          (119110,'S3Working'),
          (119400,'Walk'), (119903,'NPose')
          ],
      10: [
          (100,'NPose'), (330,'Walk'),
          (3790,'S1Shelf2Ground'), (7060, 'S1Ground2Shelf'),
          (7360,'Walk'), (9380,'NPose'),(9640,'Walk'),
          (11410,'S2L-Hand-Up'),(12700,'S2R-Hand-Up'),(14610,'S2L-Hand-Low'),(16230,'S2R-Hand-Low'),
          (16680,'Walk'), (18080,'NPose'), (18240,'Walk'),
          (24360,'S3Working'),
          (24780,'Walk'), (26280,'NPose'),(26510,'Walk'),
          (29270,'S1Shelf2Ground'), (33370,'Waiting'), ( 35920, 'S1Ground2Shelf'),
          (36240,'Walk'), (38640,'Waiting'),(38950,'Walk'),
          (41090,'S2L-Hand-Up'),(42750,'S2R-Hand-Up'),(44710,'S2L-Hand-Low'),(46260,'S2R-Hand-Low'),
          (46700,'Walk'), (48380,'NPose'), (48530,'Walk'),
          (53570,'S3Working'),
          (53770,'Walk'), (56710,'NPose'),(56990,'Walk'),
          (60240,'S1Shelf2Ground'), (63290, 'S1Ground2Shelf'),
          (63570,'Walk'), (65120,'NPose'),(65340,'Walk'),
          (66720,'S2L-Hand-Up'),(67850,'S2R-Hand-Up'),(70220,'S2L-Hand-Low'),(71820,'S2R-Hand-Low'),
          (72180,'Walk'), (73660,'NPose'),(73810,'Walk'),
          (80060,'S3Working'),
          (80380,'Walk'), (84060,'NPose'),(84330,'Walk'),
          (87700,'S1Shelf2Ground'), (90520,'Waiting'), (93840, 'S1Ground2Shelf'),
          (94190,'Walk'), (94530,'NPose'),(97790,'Walk'),
          (99540,'S2L-Hand-Up'),(100720,'S2R-Hand-Up'),(102650,'S2L-Hand-Low'),(105470,'S2R-Hand-Low'),
          (105930,'Walk'), (106440,'NPose'),(106600,'Walk'),
          (113690,'S3Working'),
          (113890,'Walk'), (114053,'NPose')
          ],
  
      11: [
          (190,'NPose'), (460,'Walk'),
          (3200,'S1Shelf2Ground'), (5180,'Waiting'), (7950, 'S1Ground2Shelf'),
          (8320,'Walk'), (9560,'NPose'),(10040,'Walk'),
          (11090,'S2L-Hand-Up'),(12200,'S2R-Hand-Up'),(13480,'S2L-Hand-Low'),(14810,'S2R-Hand-Low'),
          (15140,'Walk'), (15420,'NPose'), (15560,'Walk'),
          (21210,'S3Working'),
          (21440,'Walk'), (23620,'NPose'),(23810,'Walk'),
          (26360,'S1Shelf2Ground'), (28710, 'S1Ground2Shelf'),
          (28970,'Walk'), (30990,'NPose'),(31120,'Walk'),
          (32200,'S2L-Hand-Up'),(33120,'S2R-Hand-Up'),(34130,'S2L-Hand-Low'),(35260,'S2R-Hand-Low'),
          (35550,'Walk'), (36920,'NPose'), (37120,'Walk'),
          (43280,'S3Working'),
          (43550,'Walk'), (46020,'NPose'),(46280,'Walk'),
          (49010,'S1Shelf2Ground'), (52400,'Waiting'), ( 55020 ,'S1Ground2Shelf'),
          (55320,'Walk'), (58020,'NPose'),(58340,'Walk'),
          (59420,'S2L-Hand-Up'),(60550,'S2R-Hand-Up'),(61560,'S2L-Hand-Low'),(62600,'S2R-Hand-Low'),
          (62940,'Walk'), (63930,'NPose'),(64090,'Walk'),
          (69950,'S3Working'),
          (70260,'Walk'), (72520,'NPose'),(72750,'Walk'),
          (75160,'S1Shelf2Ground')
          ],
      12: [
          (140,'NPose'), (570,'Walk'),
          (4760,'S1Shelf2Ground'), (8280, 'S1Ground2Shelf'),
          (8650,'Walk'), (11290,'NPose'),(11840,'Walk'),
          (13390,'S2L-Hand-Up'),(14630,'S2R-Hand-Up'),(15910,'S2L-Hand-Low') ,(17790,'S2R-Hand-Low'),
          (18000,'Walk')
          ],
      13: [ # first station 3 not 1
          (140,'NPose'), (300,'Walk'),
          (8540,'S3Working'),
          (8870,'Walk'), (12580,'NPose'),(12820,'Walk'),
          (15940,'S1Shelf2Ground'), (18420,'Waiting'), (22200, 'S1Ground2Shelf'),
          (22380,'Walk'), (23880,'NPose'), (24010,'Walk'),
          (25480,'S2L-Hand-Up'),(26400,'S2R-Hand-Up'),(27680,'S2L-Hand-Low'),(29360,'S2R-Hand-Low'),
          (29640,'Walk'), (31110,'NPose'), (31290,'Walk'),
          (38710,'S3Working'),
          (39040,'Walk'), (42100,'NPose'),(42610,'Walk'),
          (45990,'S1Shelf2Ground'), (47550,'Waiting'), (50880, 'S1Ground2Shelf'),
          (51190,'Walk'), (53310,'NPose'),(53520,'Walk'),
          (54940,'S2L-Hand-Up'),(55870,'S2R-Hand-Up'),(57130,'S2L-Hand-Low'),(58470,'S2R-Hand-Low'),
          (58940,'Walk'), (60440,'NPose'),(60620,'Walk'),
          (67150,'S3Working'),
          (67530,'Walk'), (68170,'NPose')
          ]
      }
  
  import numpy as np
  def getActivationArray(persons=list(range(1,14))):
      allP = []
      for iPerson in persons:
          beginning = 0
          activities  = {}
          for act in categLongTerm:
              activities[act] = np.empty((0,2), dtype=int)
          allP.append(activities)
  
          for (end,act) in dictPerson2Activ[iPerson]:
              allP[-1][act] = np.block( [ [allP[-1][act]],[np.array([beginning,end])] ] )
              beginning = end
      return allP
  
  
  