How to check a particulate sensor?

Someone asked an interesting question on Facebook. Given the readings from a particulate matter sensor (PM10 and PM2.5), is there a way to “sanity check” the measurements? The question arose because the sensor sometimes provided negative values for the PM2.5 measurements. Was this miscalibration, a bad sensor or an error in the transmission system that left…

Streamline trajectories

I recently found myself in the situation where I wanted to get the trajectories of streamlines starting from a specific point. Lots of visualization software offer the possibility to plot streamlines. Two of these are Paraview and Tecplot. Paraview is open-source and generally good, although on dense meshes, streamlines tend to stop randomly. Tecplot is…

Accuracy of Centroid from Image

What is the accuracy of centroid extracted from an image? I recently had a argument with a colleague of mine. Here a  simple test. First generate images with a sphere $n$ pixels in diameter, moving across an image. Then measure the centroid using OpenCV in Python. To keep things simple, I will move the spheres in…

How to process and store data?

I mainly record my experiments using images. As time progresses I often  want a  new or better measurements, leading me to re-analysing the data. Hence, I often wonder what is the best way to store the data, as analysing thousands of images takes some time. The requirements I found are Speed: It shouldn’t take me…

Runge–Kutta method

I was trying to iterate a system of differential equations and decided to implement it directly in Python to refresh my memory. This is one way to find the approximation of solutions of ordinary differential equations, give some initial value. Higher-order methods (such as RK4) are generally used due to their superior convergence and stability…

Scientific Axis Label with Matplotlib in Python

To set the axis of a plot with matplotlib in Python to scientific formation, an easy way is to use ticklabel_format, the documentation is here. It is used like this import matplotlib.pyplot as plt #ploting something here plt.ticklabel_format(axis=’x’, style=’sci’, scilimits=(-2,2)) plt.show() where axis can be ‘x‘, ‘y‘ or ‘both‘ style can be ‘sci‘ for scientific…