File tree 4 files changed +16
-5
lines changed
4 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 1
- 0.25.1
1
+ 0.25.2
Original file line number Diff line number Diff line change 10
10
import astropy .units as u
11
11
import tempfile
12
12
import warnings
13
- from time import perf_counter
14
13
15
14
16
15
__all__ = [
@@ -559,7 +558,7 @@ def read_simulated_spectrum(corsika_headers_path):
559
558
if 'n_reuse' in runs .columns :
560
559
# if reuse is not the same for all runs, multply n_showers
561
560
# and set reuse to 1
562
- unique = runs ['reuse ' ].unique ()
561
+ unique = runs ['n_reuse ' ].unique ()
563
562
if len (unique ) > 1 :
564
563
summary ['n_showers' ] = (n_showers * runs ['n_reuse' ]).sum ()
565
564
summary ['n_reuse' ] = 1
Original file line number Diff line number Diff line change 1
- import tables .filters
2
1
import pandas as pd
3
2
import tempfile
4
3
import numpy as np
5
4
import h5py
6
5
import pytest
7
- from pandas . util . testing import assert_frame_equal
6
+
8
7
9
8
10
9
def test_to_h5py ():
@@ -335,3 +334,16 @@ def test_compression():
335
334
assert all (df .dtypes == df2 .dtypes )
336
335
assert all (df ['x' ] == df2 ['x' ])
337
336
assert all (df ['N' ] == df2 ['N' ])
337
+
338
+
339
+ def test_read_simulated_spectrum ():
340
+ from fact .io import read_simulated_spectrum
341
+ import astropy .units as u
342
+
343
+ s = read_simulated_spectrum ('tests/resources/proton_header_test.hdf5' )
344
+
345
+ assert s ['n_showers' ] == 20000
346
+ assert s ['n_reuse' ] == 20
347
+ assert s ['energy_min' ] == 100 * u .GeV
348
+ assert s ['energy_max' ] == 200 * u .TeV
349
+ assert s ['energy_spectrum_slope' ] == - 2.0
You can’t perform that action at this time.
0 commit comments