export_movies.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. # "<flag name>" : flag value
  7. # "CTV_scalebar": True
  8. # .....
  9. "CTV_scalebar": True,
  10. "mv_xgap": 30,
  11. "mv_ygap": 30,
  12. "mv_individualScale": 2,
  13. "mv_indiScale3factor": 0.25,
  14. "LE_labelColumns": ("Measu", "Label")
  15. }
  16. animals = [
  17. "MR_190510a_or47a",
  18. "MR_190510b_or47a"
  19. ]
  20. if __name__ == '__main__':
  21. # create a view object
  22. view_obj = view.VIEW()
  23. # load flags from yml file
  24. view_obj.update_flags_from_ymlfile(ymlfile)
  25. # update flags specified locally
  26. view_obj.update_flags(flags_to_update)
  27. # iterate over animals
  28. for animal in animals:
  29. # initialize view object with animal
  30. view_obj.initialize_animal(animal=animal)
  31. # iterate over measurements of the animal
  32. for measu in view_obj.get_measus_by_analyze_for_current_animal(1):
  33. # load a measurement for the animal
  34. view_obj.load_measurement_data_from_current_animal(measu)
  35. # save movie for the loaded data
  36. view_obj.export_movie_for_current_measurement()
  37. # backup this script and the yml file used next to the created GDMs
  38. view_obj.backup_script_flags_configs_for_movies(files=[__file__, ymlfile])