export_traces.py 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import view
  2. # this tells view all settings including the folder structure of your project
  3. ymlfile = "/home/aj/SharedWithWindows/MR_Till/usage_till.yml"
  4. # any manual changes to flags, add to dictionary as required
  5. flags_to_update = {
  6. "RM_ROITrace": 3,
  7. "LE_labelColumns": ("Measu", "Label")
  8. }
  9. list_of_animals = [
  10. "MR_190510a_or47a",
  11. "MR_190510b_or47a"
  12. ]
  13. if __name__ == '__main__':
  14. # create a view object
  15. view_obj = view.VIEW()
  16. # load flags from yml file
  17. view_obj.update_flags_from_ymlfile(ymlfile)
  18. # update flags specified locally
  19. view_obj.update_flags(flags_to_update)
  20. # iterate over animals
  21. for animal in list_of_animals:
  22. # initialize view object with animal
  23. view_obj.initialize_animal(animal=animal)
  24. # iterate over measurements of the animal
  25. for measu in view_obj.get_measus_by_analyze_for_current_animal(1):
  26. # load a measurement for the animal
  27. view_obj.load_measurement_data_from_current_animal(measu)
  28. # save glodatamixes for the loaded data
  29. view_obj.export_glodatamix_for_current_measurement()
  30. view_obj.backup_script_flags_configs_for_GDMs(files=[__file__, ymlfile])