export_processed_data_as_mat_files_template.py 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. from view import VIEW
  2. from view.python_core.matfile import export_processed_data_as_mat_file
  3. # this tells view all settings including the folder structure of your project
  4. # On Windows, if you copy paths from the file explorer, make sure the string below is always of the form r"......"
  5. ymlfile = r""
  6. # any manual changes to flags, add to dictionary as required
  7. flags_to_update = {
  8. # Example: flags for CTV specification
  9. }
  10. # list of animals for which MAT files are to be generated
  11. animals = [
  12. "",
  13. ""
  14. ]
  15. if __name__ == '__main__':
  16. # create a view object
  17. view_obj = VIEW()
  18. # load flags from yml file
  19. view_obj.update_flags_from_ymlfile(ymlfile)
  20. # update flags specified locally
  21. view_obj.update_flags(flags_to_update)
  22. # iterate over animals
  23. for animal in animals:
  24. # initialize view object with animal
  25. view_obj.initialize_animal(animal=animal)
  26. # export data as MAT file
  27. export_processed_data_as_mat_file(view_obj, analyze_values_to_use=(1,))
  28. # backup this script and the yml file used next to the created MAT files
  29. view_obj.backup_script_flags_configs_for_processed_data_output(files=[__file__, ymlfile], format_name="MAT")