Skip to content

Commit

Permalink
add method get_nwb_builder to RawToNWBBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
jihyunbak committed Nov 12, 2020
1 parent 88c1edc commit ab5a682
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions rec_to_nwb/processing/builder/raw_to_nwb_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,18 +160,7 @@ def __build_nwb_file(self, process_mda_valid_time=True, process_mda_invalid_time
os.makedirs(self.video_path, exist_ok=True)
for date in self.dates:
logger.info('Date: {}'.format(date))
nwb_builder = NWBFileBuilder(
data_path=self.data_path,
animal_name=self.animal_name,
date=date,
nwb_metadata=self.nwb_metadata,
output_file=self.output_path + self.animal_name + date + ".nwb",
process_mda=self.extract_mda,
process_dio=self.extract_dio,
process_analog=self.extract_analog,
video_path=self.video_path,
reconfig_header=self.__is_rec_config_valid()
)
nwb_builder = self.get_nwb_builder(date)
content = nwb_builder.build()
nwb_builder.write(content)
self.append_to_nwb(
Expand All @@ -182,6 +171,20 @@ def __build_nwb_file(self, process_mda_valid_time=True, process_mda_invalid_time
process_pos_invalid_time=process_pos_invalid_time
)

def get_nwb_builder(self, date):
return NWBFileBuilder(
data_path=self.data_path,
animal_name=self.animal_name,
date=date,
nwb_metadata=self.nwb_metadata,
output_file=self.output_path + self.animal_name + date + ".nwb",
process_mda=self.extract_mda,
process_dio=self.extract_dio,
process_analog=self.extract_analog,
video_path=self.video_path,
reconfig_header=self.__is_rec_config_valid()
)

def __preprocess_data(self):
"""process data with rec_to_binaries library"""

Expand Down

0 comments on commit ab5a682

Please sign in to comment.