Comments (3)
Hi @benedettaveronesi, thanks for the bug report!
I don't think this should be too hard to fix.
I'll have a look this week.
from plonk.
For future reference, a more minimal bug report code snippet would be
import plonk
dump = plonk.Dump('dump_00000.h5')
ndust = plonk.header['ndustsmall']
options = list()
options.append({'render': 'density'})
for idx in range(ndust):
options.append({'render': dump.density * dump.particles.arrays['dustfrac'][:, idx]})
multiplot = plonk.visualization.MultiPlot(
dump, options, shape=(3, 2), cbar_mode='each', cbar_location='top', cbar_pad=0.2
)
from plonk.
Hi @benedettaveronesi, sorry for taking so long to respond. I've been busy with a new release of Plonk (0.2.0). This release is a major overhaul of the internals of Plonk, and of the API.
I've actually removed MultiPlot from this release.
Having said that, I don't think it's too hard to do what you require:
snap = plonk.load_snap('path_to_your_file')
ndust = len(snap.properties['grain size'])
# Say ndust is 6
ncols = 3
nrows = 2
fig, axes = plt.subplots(nrows=nrows, ncols=ncols, sharex=True, sharey=True)
for idx in range(ndust):
plonk.visualize.plot(
scalar_data=snap['rho'] * snap['dustfrac'][:, idx],
x_coordinate=snap['x'],
y_coordinate=snap['y'],
extent=(-100, 100, -100, 100),
particle_mass=snap['m'],
smoothing_length=snap['h'],
axis=axes.ravel()[idx],
)
Please, let me know if you have any further issues.
from plonk.
Related Issues (20)
- Automate building the Conda and pip packages with Travis CI
- Add convenience function to generate movies HOT 6
- Add Snap method to set units to physical quantities
- Read more Phantom header quantities
- Add function to modify snaps and write a new one
- Should the 'id' array be 'particle_type'? HOT 1
- Sink particles are not rotated with `snap.rotate`
- plonk.visualize.plot passes colorbar_kwargs to imshow HOT 2
- Plot dust density for one-fluid dump HOT 2
- Incorrect temperature with phantom models with ieos=2 HOT 7
- Animation is broken HOT 1
- Creating arbitrary cross sections through SPH data HOT 4
- plonk.visualize has no attribute 'render' HOT 4
- Only the first profile in list is plotted HOT 4
- Error in Column density plots when using logarithmic colour bar. HOT 2
- Change from splash.py to sph-interp
- Add support for more Phantom equations of state
- TypeError: expected dtype object, got 'numpy.dtype[float64]' when animating HOT 7
- Shifting to the centre of the disc HOT 3
- Tracking individual particles HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plonk.