export_movies.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import view
  2. # this tells view all settings including the folder structure of your project
  3. ymlfile = r"/home/aj/SharedWithWindows/HS_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. }
  10. # list of animals for which movies are to generated
  11. animals = [
  12. "HS_bee_PELM_180424b",
  13. "HS_bee_PELM_180416b"
  14. ]
  15. if __name__ == '__main__':
  16. # create a view object
  17. view_obj = view.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. # iterate over measurements of the animal
  27. for measu in view_obj.get_measus_by_analyze_for_current_animal(1):
  28. # load a measurement for the animal
  29. view_obj.load_measurement_data_from_current_animal(measu)
  30. # save movie for the loaded data
  31. view_obj.export_movie_for_current_measurement()
  32. # backup this script and the yml file used next to the created GDMs
  33. view_obj.backup_script_flags_configs_for_movies(files=[__file__, ymlfile])