Skip to content

Commit dc46b9b

Browse files
authored
Merge pull request #418 from GallegoSav/pr_dataio
Adding the input file name as an option in the tra file reader function
2 parents f22aa8a + e2308e7 commit dc46b9b

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

cosipy/data_io/UnBinnedData.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,16 @@
2828
class UnBinnedData(DataIO):
2929
"""Handles unbinned data."""
3030

31-
def read_tra(self, output_name=None, run_test=False, use_ori=False,
31+
def read_tra(self, input_name=None, output_name=None, run_test=False, use_ori=False,
3232
event_min=None, event_max=None):
3333

3434
"""Reads MEGAlib .tra (or .tra.gz) file and creates cosi datset.
3535
3636
Parameters
3737
----------
38+
input_name : str, optional
39+
Path of input file (default is None, in which case the
40+
input file name is taken from the yaml file).
3841
output_name : str, optional
3942
Prefix of output file (default is None, in which case no
4043
output is written).
@@ -87,9 +90,11 @@ def read_tra(self, output_name=None, run_test=False, use_ori=False,
8790
This method sets the instance attribute, cosi_dataset,
8891
but it does not explicitly return this.
8992
"""
90-
93+
if input_name != None:
94+
self.data_file = input_name
95+
9196
start_time = time.time()
92-
97+
9398
# Initialise empty lists:
9499

95100
# Total photon energy

0 commit comments

Comments
 (0)