I've been getting familiar with the pymatgen package and need to make phase diagrams. There's a quick tutorial on this web page that goes through how to make a ternary diagram, but I actually want to make a much simpler one of a pure substance.
I have in mind something like this. I've gone through the documentation and done a lot of google searches but haven;t been able to find what I'm looking for. Perhaps it's possible to combine the data from pymatgen with a graphing package like matplotlib?
T-P phase diagrams like those show phase stability against pressure and temperature as the independent variables. The data on the Materials Project was calculated using density functional theory (DFT) at a temperature of 0K and a pressure of 0Pa. Unfortunately it's not possible to create a T-P phase diagram from the MP data.
Related
I need to build a KPI spider chart that compares the current period, the target value, and prior periods performance. Below, I have a simple example of what I am trying to build, it is just Word Art/Images because I have not been able to build a similar visualization in Power BI. The issue that I am having, is that each of the visualizations I have tried, set scale for the entire visualizing, not by each element it contains.
I am comfortable exploring a Python solution but none of my searches have pointed me in the direction I need to go.
I have been shown examples of what my boss is looking for so I assume this is possible but none of my research or attempts have been successful, if anyone can point me towards a resource or example using either Python or Power BI, it would be greatly appreciated.
You can use Deneb and the Vega template here to create a nice spider chart in PowerBI. It will be fully interactive too unlike a Python visual.
https://deneb-viz.github.io/
https://vega.github.io/vega/examples/radar-chart/
Each spoke of the web can have its own scale too.
I'm currently working on a tkinter python school project where the sole purpose is to generate images from audio files, I'm going to pick audio properties and use them as values to generate unique abstract images from it, however I don't know which properties I can analyze to extract the values from. So I was looking for some guidance on which properties (audio frequency, amplitude... etc.) I can extract values from to use to generate the images with Python.
The question is very broad in it's current form.
(Bare in mind audio is not my area of expertise so do keep an eye out for the opinion of people working in audio/audiovisual/generative fields.)
You can go about it either way: figure out what kind of image(s) you'd like to create from audio and from there figure out which audio features to use. The other way around is also valid: pick an audio feature you'd like to explore, then think of how you'd best or most interestingly represent that visually.
There's a distintion between image and images.
For a single image, the simplest thing I can think of is drawing a grid of squares where a visual property of the square (e.g. square size, fill colour intensity, etc.) is mapped to the amplitude at that time. The single image would visualise a whole track's amplitude pattern. Even with such a simple example there are many choices you can make (how often you sample, how you layout the grid (cartesian, polar), how each amplitude sample is visualised (could different shapes, sizes, colours, etc.).
(Similar concept to CinemaRedux, simpler for audio only)
You can look into the field of data visualisation for inspiration.
Information is Beautiful is great place to start.
If you want to generate images that seems to go into the audiovisual territory (e.g. abstract animation, audio reactive motion graphics, etc.).
Your question originally had the tag Processing tag, which I removed, however you could be using Processing's Python Mode.
In ferms of audio visualisisation one good example I can think is Robert Hogin's work, see Magnetosphere and the Audio-generated landscape prototype. He is using frequency analysis (FFT) with a bit of smoothing/data massaging to amplify the elements useful for visualisation and dampen some of the noise:
(There are a few handy audio libraries such as Minim and beads, however I assume you're intresting in using raw Python, not Jython (which is what the official Processing Python mode uses). He is an answer on FFT analysis for visualisation (even though it's in Processing Java, the principles can be applied in Python)
Personally I've only used pyaudio so far for basic audio tasks. I would assume you could use it for amplitude analysis, but for other more complex tasks you might something extra.
Doing a quick search librosa pops up.
If what you want to achieve isn't clear, try prototyping first and start with the simplest audio analysis and visual elements you can think of (e.g. amplitude mapped to boxes over time). Constraints can be great for creativity and the minimal approach could translate into a cleaner, minimal visuals.
You can then look into FFT, MFCC, onset/ beat detection, etc.
Another tool that could be useful for prototyping is Sonic Visualiser.
You can open a track and use some of the built-in feature extractors.
(You can even get away with exporting XML or CSV data from Sonic Visualser which you can load/parse in Python and use to render image(s))
It uses a plugin system (similar to VST plugins in DAWs like Abbleton Live, Apple Logic, etc.) called Vamp plugins. You can then use the VampPy Python wrapper if you need the data at runtime.
(You might also want to draw inspiration from other languages used of audiovisual artworks like PureData + Gems , MaxMSP + Jitter, VVVV, etc.)
Time domain: Zero-crossing rate, Root mean square energy ,etc . Frequency Domain: Spectral bandwith,flux,rollof,flatness,MFCC etc. Also ,tempo, You can use librosa for Python , link : https://librosa.org/doc/latest/index.html for extraction from a .wav file , which implements Fast Fourier Transfrom and framing. And then you can apply some statistics such mean,standard deviation to the vector of the above characteristics across the whole audio file.
Providing an additional avenue for exploration: you have some tools to explore this qualitatively (as opposed to quantitatively using metrics derived from the audio signal as suggested in the great answers above)
As you mention the objective is to generate unique abstract images from sound - I would suggest an interesting angle may be to apply some Machine Learning techniques and derive some mood classification predictions from the source audio.
For instance you could use the Tensorflow models in essentia to predict the mood of the track and associate images you select with the mood scores generated. I would suggest going well beyond this and using the tkinter image creation tools to create your mappings to mood. Use pen and paper to develop your mapping strategy - are certain moods more angular or circular? What colour mappings will you select, and why? You have a great deal of freedom to create these mappings - so start simple as complexity builds naturally.
Using some some simple mood predictions may be more useful for you as someone who has more experience with the qualitative experience with sound rather than the quantitative experience as an audio engineer. I think this may be worth making central to the report you write and documenting your mapping decisions and design process for the report if this is a requirement of the task.
I am writing code in Python to analyze social networks with node and edge attributes. Currently, I am using the NetworkX package to generate the graphs. Is there any limit to the size (in terms of the number of nodes, edges) of the graph which can be generated using this package?
I am new to coding social network problems in Python and have recently come across another package called NetworKit for large networks, but am not sure at what size should NetworKit be a better option, could you please elaborate on difference in performance and functionality between the two packages?
Thanks for your reply in advance.
My suggestion:
Start w/ Networkx as it has a bigger community, it's well mainteined and documented... and the best of all... you can easily understand what it does as it's 100% done in Python.
It's true it's not exactly fast, but it will be fast enough for most of the calculations. If you are running calculations from your laptop it can be slow for intensive calculations (Eg: sigma/omega small worldness metrics) in big networks (> 10k nodes and >100k vertexes).
If you need to speed it up, then you can easily incorporate networKit in your code as it integrates very easily to networkx and pandas, but it has a much more limited library of algorithms.
Compare yourself:
NetworkX algorithms: https://networkx.github.io/documentation/stable/reference/algorithms/index.html
VS
NetworKit algorithms: https://networkit.github.io/dev-docs/python_api/modules.html
Is there any limit to the size (in terms of the number of nodes, edges) of the graph which can be generated using this package?
No. There is no limit. It is all dependent on your memory capacity and size.
could you please elaborate on difference in performance and functionality between the two packages?
I personally don't have any experience with NetworkKit, however here (by Timothy Lin) you can find a very good benchmarking analysis on different tools including networkx and networkkit. Check out its conclusion section:
As for recommendations on which package people should learn, I think picking up networkx is still important as it makes network science very accessible with a wide range of tools and capabilities. If analysis starts being too slow (and maybe that’s why you are here) then I will suggest taking a look at graph-tool or networkit to see if they contain the necessary algorithms for your needs.
So I have a 2D vector field {u(x,y,t), v(x,y,t)} representing velocities of an unsteady flow at different instances in time. I don't have an analytical description of the flow, just the two components u and v over time.
I am aware of matplotlib.quiver and the answer to this question which suggests to use this for plotting streamlines.
Now I want to also plot a couple of pathlines and streaklines of the vector field.
Is there any tool that is capable of doing this (preferably a Python package)? This seems to be a common task but I couldn't find anything and don't want to waste time on reinventing the wheel.
Currently, there is no functionality in matplotlib to plot streaklines. However, Tom Flannaghan's streamline plotting utility has been improved and merged into the codebase. It will be available in matplotlib version 1.2, which is to be released in the next few weeks.
At present, your best bet is to solve the streakline ODE in the Wikipedia page you linked to. If you want to use python to do this, you can use scipy.integrate.odeint. This is exactly what matplotlib.axes.streamplot does at present for streamlines.
I want to create a graph using networkx which has positive or negative degree correlation.
Like a graph for a social network or citations in academic papers etc.
Can you suggest some function for this?
If you are talking about producing a visual graph (diagram) you could look at using matplotlib to generate them. I'm not sure if there is going to be a single function that will do what you want (not enough detail) but its a comprehensive library used in many projects to achieve complex graphing related tasks.