Guest User

Untitled

a guest
Jan 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.39 KB | None | 0 0
  1. from pax import units, configuration, datastructure
  2. # setup hax for Midway
  3. import hax
  4. from hax import cuts
  5. #Select pax version
  6. pax_version = '6.8.0'
  7.  
  8. hax.__version__
  9. hax.init(experiment='XENON1T',
  10. raw_data_access_mode='local',
  11. raw_data_local_path='/project/lgrandi/xenon1t/raw/',
  12. minitree_paths=[#'/home/mvargasjara/minitrees/v'+pax_version,
  13. '/project2/lgrandi/xenon1t/minitrees/pax_v'+pax_version,
  14. '/project/lgrandi/xenon1t/minitrees/pax_v' + pax_version
  15. ],
  16. pax_version_policy= pax_version,
  17. make_minitrees = False
  18. )
  19.  
  20. dsets = hax.runs.tags_selection(include=['*sciencerun1'])
  21. dsets = dsets[(dsets.source__type == 'none')]
  22. run_time_s_tmp = pd.to_timedelta(pd.to_datetime(dsets.end)).dt.seconds - pd.to_timedelta(pd.to_datetime(dsets.start)).dt.seconds
  23. run_time_s_tmp[run_time_s_tmp<0] += 24*3600
  24. dsets['run_time_s'] = run_time_s_tmp
  25. # select data range
  26. dsets = dsets[(dsets.start > pd.to_datetime('12/31/2016')) & (dsets.end < pd.to_datetime('02/01/2018'))]
  27. dsets['start_date'] = dsets.start.dt.date
  28. run_names = dsets.name
  29. # get rid of problematic runs
  30. bad_runs = ['171204_1357','171204_1858','171208_0616','171204_0856','171204_1658','171205_0701']
  31. for run in bad_runs:
  32. run_names = run_names[run_names != run]
  33. dsets = dsets[dsets.name != run]
  34.  
  35.  
  36. preselect = ['cs1 > 0', 'z_3d_nn <= 0.0', 'cs1<100']
  37.  
  38. df = hax.minitrees.load(run_names, ['Corrections','Basics','Extended','Fundamentals','Proximity',
  39. 'PositionReconstruction'], preselection=preselect, force_reload=False,
  40. num_workers = 7)
  41.  
  42. ---------------------------------------------------------------------------
  43. ValueError Traceback (most recent call last)
  44. <ipython-input-7-a6c400c757de> in <module>()
  45. 3 df = hax.minitrees.load(run_names, ['Corrections','Basics','Extended','Fundamentals','Proximity',
  46. 4 'PositionReconstruction'], preselection=preselect, force_reload=False,
  47. ----> 5 num_workers = 7)
  48.  
  49. /project/lgrandi/anaconda3/envs/pax_head/lib/python3.4/site-packages/hax-2.2.3-py3.4.egg/hax/minitrees.py in load(datasets, treemakers, preselection, force_reload, delayed, num_workers, compute_options, cache_file, remake_cache, event_list)
  50. 509
  51. 510 result = dask.dataframe.from_delayed(
  52. --> 511 partial_results, meta=partial_results[0].compute())
  53. 512
  54. 513 if not delayed:
  55.  
  56. /project/lgrandi/anaconda3/envs/pax_head/lib/python3.4/site-packages/dask/base.py in compute(self, **kwargs)
  57. 77 Extra keywords to forward to the scheduler ``get`` function.
  58. 78 """
  59. ---> 79 return compute(self, **kwargs)[0]
  60. 80
  61. 81 @classmethod
  62.  
  63. /project/lgrandi/anaconda3/envs/pax_head/lib/python3.4/site-packages/dask/base.py in compute(*args, **kwargs)
  64. 177 dsk = merge(var.dask for var in variables)
  65. 178 keys = [var._keys() for var in variables]
  66. --> 179 results = get(dsk, keys, **kwargs)
  67. 180
  68. 181 results_iter = iter(results)
  69.  
  70. /project/lgrandi/anaconda3/envs/pax_head/lib/python3.4/site-packages/dask/threaded.py in get(dsk, result, cache, num_workers, **kwargs)
  71. 74 results = get_async(pool.apply_async, len(pool._pool), dsk, result,
  72. 75 cache=cache, get_id=_thread_get_id,
  73. ---> 76 **kwargs)
  74. 77
  75. 78 # Cleanup pools associated to dead threads
  76.  
  77. /project/lgrandi/anaconda3/envs/pax_head/lib/python3.4/site-packages/dask/async.py in get_async(apply_async, num_workers, dsk, result, cache, get_id, raise_on_exception, rerun_exceptions_locally, callbacks, dumps, loads, **kwargs)
  78. 491 _execute_task(task, data) # Re-execute locally
  79. 492 else:
  80. --> 493 raise(remote_exception(res, tb))
  81. 494 state['cache'][key] = res
  82. 495 finish_task(dsk, key, state, results, keyorder.get)
  83.  
  84. ValueError: No TreeMaker named PositionReconstruction known to hax!
  85.  
  86. Traceback
  87. ---------
  88. File "/project/lgrandi/anaconda3/envs/pax_head/lib/python3.4/site-packages/dask/async.py", line 268, in execute_task
  89. result = _execute_task(task, data)
  90. File "/project/lgrandi/anaconda3/envs/pax_head/lib/python3.4/site-packages/dask/async.py", line 249, in _execute_task
  91. return func(*args2)
  92. File "/project/lgrandi/anaconda3/envs/pax_head/lib/python3.4/site-packages/dask/compatibility.py", line 47, in apply
  93. return func(*args, **kwargs)
  94. File "/project/lgrandi/anaconda3/envs/pax_head/lib/python3.4/site-packages/hax-2.2.3-py3.4.egg/hax/minitrees.py", line 388, in load_single_dataset
  95. run_id, treemaker, force_reload=force_reload, event_list=event_list)
  96. File "/project/lgrandi/anaconda3/envs/pax_head/lib/python3.4/site-packages/hax-2.2.3-py3.4.egg/hax/minitrees.py", line 321, in load_single_minitree
  97. run_id, treemaker, force_reload=force_reload)
  98. File "/project/lgrandi/anaconda3/envs/pax_head/lib/python3.4/site-packages/hax-2.2.3-py3.4.egg/hax/minitrees.py", line 186, in check
  99. treemaker_name, treemaker = get_treemaker_name_and_class(treemaker)
  100. File "/project/lgrandi/anaconda3/envs/pax_head/lib/python3.4/site-packages/hax-2.2.3-py3.4.egg/hax/minitrees.py", line 607, in get_treemaker_name_and_class
  101. raise ValueError("No TreeMaker named %s known to hax!" % tm)
Add Comment
Please, Sign In to add comment