|
Post by Johnson on Aug 4, 2021 7:33:19 GMT
Hello,
With different seed number we can plot individual trajectories. Is there an option for plotting the average value based on several choosen seed numbers?
Thank you.
Bests, Johnson
|
|
|
Post by Adam on Aug 4, 2021 20:29:52 GMT
Hello Johnson, there is no such option. However, you can modify an auxiliary script plot_averages_into_images.py that can be used to generate plots. The script is located in the MCell4 bundle here: Blender-2.93-CellBlender/2.93/scripts/addons/cellblender/extensions/mcell/utils/plot_averages_into_images.py So you can copy it to your location and modify it. The mean is computed on line 214 here: df['means'] = data.iloc[:, 1:].mean(axis=1) The '1:' data.iloc[:, 1:] says to select all columns (column 0 is time). So you can select whichever columns you like (shown e.g. here: stackoverflow.com/questions/43464015/panda-loc-or-iloc-to-select-the-columns-from-a-dataset). The columns won't be be sorted by the seed value, to do this you can modify the function get_mcell_observables_counts: def get_mcell_observables_counts(dir): counts = {} seed_dirs = sorted(os.listdir(dir)) # sort directories by name ...
Hope this helps, Adam
|
|
|
Post by Johnson on Aug 8, 2021 7:45:58 GMT
Hello Adam,
Thank you Adam. I added the sort-function to the code. But the mean value did not appear in the plot. Do I only need to add the sort-function in the code? Or I should modify the code by myself?
Thank you.
Johnson
|
|
|
Post by Johnson on Aug 9, 2021 17:28:17 GMT
Hello Adam,
one more question. How can I run plot_averageinto images.py in cellblender?
Thank you in advance.
Johnson
|
|
|
Post by Adam on Aug 9, 2021 20:19:09 GMT
Hi Johnson,
the script can be run only from the commandline (terminal), e.g. like this:
cd <directory where you saved the .blend file> python3 plot_averages_into_images.py -m4 <.blend file name>_files/mcell/output_data/react_data/
The current directory will then contain .png files for your observables. The modifications require some knowledge of Python.
Best regards, Adam
|
|
|
Post by Johson on Aug 9, 2021 21:18:24 GMT
Hello Adam,
Thank you for your prompt reply!
Best regards, Johnson
|
|