Iota Python API
1.0.0
1.0.0
  • Introduction
  • Getting started with Iota Python Library and Iota IPython Terminal
    • Starting a Session
    • Creating a New Project
    • Loading a Project
    • Creating a New Scenario
    • Loading a Scenario
    • Importing a Dataset
    • Running Coarse-graining
  • Writing Scripts
    • Generic Scripts
    • Run(scenario) Scripts
  • Running Scripts
    • Running Generic Scripts
    • Running run(scenario) Scripts
  • Iota Python Reference Library
    • Datasets
    • Graphs
    • Scene renderer
    • Meshing
    • Variable types
    • Session
    • Project
    • Scenario
    • Graph
    • Dataset
    • Mesh
    • Script
    • File
    • Auxiliar
    • Enums
  • Examples
    • Creating a New Project
    • Creating a New Scenario
    • Creating Multiple Scenarios
    • Loading a Project and a Scenario
    • Importing a Dataset into a Scenario
    • Importing Multiple Datasets into different Scenarios
    • Creating a Cut-Plane with Results in a Dataset
    • Creating a New Result in a Dataset
    • Calculating a KPI and Exporting into a Graph
    • Getting the Profile of Result along a Line
    • Creating Multiple Result Line Variations and Plotting them in a Single Graph
    • Integrating a Result over a Mesh
    • Getting the Evolution of the Statistics of a Result
    • Creating Multiple Screenshots of a Dataset
    • Creating Multiple Videos of a Dataset
    • Cloninig Settings and Running Coarse-graining for Multiple Scenarios
    • Automating EDEM Simulations runs and Iota Analyses
Powered by GitBook
On this page

Was this helpful?

  1. Examples

Creating Multiple Videos of a Dataset

PreviousCreating Multiple Screenshots of a DatasetNextCloninig Settings and Running Coarse-graining for Multiple Scenarios

Last updated 5 years ago

Was this helpful?

This is an example of a run(scenario) script that creates multiple videos of the animation of results of the coarse-graining (cg) dataset of a scenario. The settings for the animation of the results is specified by a list of Particle Analytics Camera files (.pac) (see the following link on how export the .pac files: )

''' This scripts loads the cg_dataset of a scenario and creates multiples videos of the results in the dataset
 based on the scene settings specified in a list of Particle Analytics Camera file (.pac). 
 Each video generates an MP4 file and is saved into the scenario'''

import iota

def run(scenario):

    ###Setting the list of pac files for the scene settings
    path_videos_config = 'C:/Users/stephen/pac_scene_setting/'  #Path to the folder that contains the .pac files
    ListOfVideos = ['Density_Min_0_Max_2100', 
        'Solid Fraction_Min_0_Max_0p75', 
            'Velocity_Mag_Min_0_Max_7p8']                           #List of the names of the .pac files with the config of the videos 

    cg_dataset = scenario.get_cg_dataset()                      #Load the cg dataset of the scenario
    cg_data = cg_dataset.data()                                 #Load the dataset data

    for video in ListOfVideos:                                          #For each videos in the list of Videos
        config_video = path_videos_config + video + '.pac'                 #Build the path to the .pac file of the video 
        output_file =  scenario.directory + '/videos/' + video + '.mp4'    #Build the path for the output video file 

        iota.render.generate_video(dataset=cg_data, config=config_video, destination=output_file, frame_rate=5)   #Generate the video
        scenario.add_video(name=video, file=output_file)     #Save the video in the scenario
link