Prepare photons and exposure, given a source
This module defines the function load_source_data
.
Depends on module Exposure for SC data
from wtlike.sources import PointSource
from wtlike.config import Timer
config=Config();
if config.valid:
test_weeks = (11,60)
source =PointSource('Geminga', config=config)
with Timer() as t1:
config.pool_size=processes=4
sd1 = load_source_data(config, source, week_range=test_weeks, key=None )
print(t1)
with Timer() as t2:
config.pool_size=1
sd2 = load_source_data(config, source, week_range=test_weeks, key=None )
print(t2)
print(f'Timing ratio using {processes} proceses: {t2.elapsed/t1.elapsed:.2f}')
assert( len(sd1[0])==len(sd2[0]) ), 'Fail multiprocessing test'