How to load data in VIEW and calculate signals - galizia-lab/pyview GitHub Wiki
This is done using the class view.python_core.view_object.VIEW
which has an alias view.VIEW
.
Example Code:
from view import VIEW
yml_file = .....
animal = ....
# create a view object
vo = VIEW()
# update flags from a yml file
vo.update_flags_from_ymlfile(yml_filename=yml_file)
# update more flags additional to those from yml file
if isinstance(local_flags, dict):
vo.update_flags(local_flags)
# initialize which animal to use
vo.initialize_animal(animal=animal)
# access flags
print("LE_loadExp=", vo.flags["LE_loadExp"])
# iterate over measurements of this animal
for measu in vo.get_measus_for_current_animal(analyze_values_to_use=(1, 2)):
print(f"Doing animal={animal}, measu={measu}")
# load data for this measurement
vo.load_measurement_data_from_current_animal(measu=measu)
# calculate signals for this measurement
vo.calculate_signals()