CalledProcessError: Command '['convert', 'voxelPlot.ppm', 'voxelPlot.png']' returned non-zero exit status 1

Hi guys,
I am new here ! I need some help ! the problem in creating voxelPlot.h5 stucks on me. I don’t know why the “voxelPlot.ppm” and “voxelPlot.png” could not be created when running.
and the plotting part is below:(sorry ,maybe the problem is easy ,but I still need your help !!! )
#-----------------------------------------------------------------#

Instantiate a Plot

plot1 = openmc.Plot()
plot1.filename = ‘materials-xz’
plot1.basis = ‘xz’
plot1.origin = [0, 0, 0]
plot1.width = [7.2135, 360]
plot1.pixels = [1000, 1000]
plot1.color_by = ‘material’

plot2 = openmc.Plot()
plot2.filename = ‘materials-xy’
plot2.basis = ‘xy’
plot2.origin = [0, 0, 0]
plot2.width = [7.2135, 7.2135]
plot2.pixels = [1000, 1000]
plot2.color_by = ‘material’

plot3 = openmc.Plot()
plot3.filename = ‘materials-yz’
plot3.basis = ‘yz’
plot3.origin = [0, 0, 0]
plot3.width = [7.2135, 360]
plot3.pixels = [1000, 1000]
plot3.color_by = ‘material’

plot4 = openmc.Plot()
plot4.type = ‘voxel’
plot4.filename = ‘voxelPlot’
plot4.origin = [0, 0, 0]
plot4.width = [7.2135,7.2135,360]
plot4.pixels = [500,500,500]
plot4.overlap_color = ‘blue’
plot4.color_by = ‘material’

Show plot

plots = openmc.Plots(plots=[plot1, plot2, plot3, plot4])
plots.export_to_xml()
openmc.plot_inline(plots=(plot1, plot2, plot3, plot4))
#----------------------------------------------------------------------------#

the above is the plotting code and the ERRO IS :
#---------------------------------------------------------------------#
CalledProcessError Traceback (most recent call last)
/tmp/ipykernel_6375/1322277747.py in
39 plots = openmc.Plots(plots=[plot1, plot2, plot3, plot4])
40 plots.export_to_xml()
—> 41 openmc.plot_inline(plots=(plot1, plot2, plot3, plot4))

~/anaconda3/envs/openmc-env/lib/python3.9/site-packages/openmc/executor.py in plot_inline(plots, openmc_exec, cwd, convert_exec)
103 ppm_file = ‘plot_{}.ppm’.format(p.id)
104 png_file = ppm_file.replace(’.ppm’, ‘.png’)
→ 105 subprocess.check_call([convert_exec, ppm_file, png_file])
106 images.append(Image(png_file))
107 display(*images)

~/anaconda3/envs/openmc-env/lib/python3.9/subprocess.py in check_call(*popenargs, **kwargs)
371 if cmd is None:
372 cmd = popenargs[0]
→ 373 raise CalledProcessError(retcode, cmd)
374 return 0
375

CalledProcessError: Command ‘[‘convert’, ‘voxelPlot.ppm’, ‘voxelPlot.png’]’ returned non-zero exit status 1.
#--------------------------------------------------------------------------------------------------------------#

thank you
lz152

I make it !!! “keep learning,keep stepping”
thank you !!!
lz152

Just to follow up on this – the plot_inline function doesn’t work with voxel plots right now, so you’d have to process those separately. Glad you were able to get things working!

1 Like

Thank you ! Paul,
Glad to receive your reply ! I have made it !
By using “openmc.plot_geometry((plot0, plot1, plot2, plot3))” replaces the “plot_inline” , and success !

lz152