Skip to content

Commit

Permalink
Merge branch 'master' into trig_events
Browse files Browse the repository at this point in the history
  • Loading branch information
vuillaut authored Jul 20, 2023
2 parents 126f7b7 + cf1db5d commit 31aa52c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuousintegration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
python-version: [3.7, 3.8, 3.9, "3.10"]

steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions ctaplot/ana/ana.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ def energy_resolution_per_energy(true_energy, reco_energy,
confidence_level=confidence_level,
bias_correction=bias_correction))

return irf.energy_bins, np.array(res_e)
return bins, np.array(res_e)


@u.quantity_input(true_energy=u.TeV, reco_energy=u.TeV, bins=u.TeV)
Expand Down Expand Up @@ -904,7 +904,7 @@ def effective_area_per_energy(true_energy, reco_energy, simu_area, bins=None):
count_S, bin_S = np.histogram(true_energy, bins=bins)

np.seterr(divide='ignore', invalid='ignore')
return irf.energy_bins, np.nan_to_num(simu_area * count_R / count_S)
return bins, np.nan_to_num(simu_area * count_R / count_S)


@u.quantity_input(true_x=u.m, reco_x=u.m, true_y=u.m, reco_y=u.m)
Expand Down
7 changes: 5 additions & 2 deletions ctaplot/gammaboard/gammaboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,17 @@ def find_data_files(experiment, experiments_directory):
return tuple(file_set)


def load_data_from_h5(experiment, experiments_directory, join_type='exact', metadata_conflicts='silent'):
def load_data_from_h5(experiment, experiments_directory, join_type='inner', metadata_conflicts='silent'):
"""
Load an hdf5 file containing results from an experiment
Args
experiment (str): the name of the experiment
experiments_directory (str): the path to the folder containing the experiment folders
join_type (str): 'inner' | 'exact' (default) | 'outer'
join_type (str): 'inner' (default) | 'exact' | 'outer'
'inner': takes the intersection of all data tables
'exact': all data tables must have exactly the same columns
'outer': takes union of columns and fill missing values
metadata_conflicts (str): 'silent' (default) | 'warn' | 'error'
Returns
Expand Down
5 changes: 4 additions & 1 deletion ctaplot/plots/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,10 @@ def plot_resolution_difference(bins, reference_resolution, new_resolution, ax=No

ax = plt.gca() if ax is None else ax
delta_res = new_resolution - reference_resolution
delta_res[:, 1:] = 0 # the condidence intervals have no meaning here
# delta_res[:, 1:] = 0 # the condidence intervals have no meaning here
# the condidence intervals have no meaning here
delta_res[:, 1] = delta_res[:, 0]
delta_res[:, 2] = delta_res[:, 0]
with quantity_support():
plot_resolution(bins, delta_res, ax=ax, **kwargs)
ax.set_ylabel(r"$\Delta$ res")
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def get_property(prop, project):
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
'sphinx.ext.imgmath',
'sphinx.ext.githubpages',
'sphinx.ext.napoleon',
Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ dependencies:
- scipy
- ipympl
- tqdm
- h5py

0 comments on commit 31aa52c

Please sign in to comment.