Author Archives: Dilawar

About Dilawar

Graduate Student at National Center for Biological Sciences, Bangalore.

ngspice not honoring initial conditions?

This is a common gotcha! Add UIC to your .TRANS like e.g. .TRAN 1ns 100ns UIC Otherwise initial conditions will simply be ignored. See

Posted in Uncategorized | Leave a comment

Image stabilization using OpenCV

This application deals with video of neural recordings. In such recordings, feature sizes are small. On top of it, recordings are quite noisy. Animal head movements introduces sharp shakes. Out of the box video stabilizer may not work very well … Continue reading

Posted in Application, Utility | Tagged , , | Leave a comment

A csv reader based on Haskell-cassava library : performance

I implemented my own csv reader using cassava library. The reader from missingh library was taking too long (~ 17 seconds) for a file with 43200 lines. I compared the result with python-numpy and python-pandas csv reader. Below is rough … Continue reading

Posted in Haskell, Uncategorized | Tagged , , | Leave a comment

Thresholding numpy array, well sort of

Here is a test case >>> import numpy as np >>> a = np.array( [ 0.0, 1, 2, 0.2, 0.0, 0.0, 2, 3] ) I want to turn all non-zero elements of this array to 1. I can do it … Continue reading

Posted in Python, Uncategorized | Tagged , | Leave a comment

C++11 library to write std::vector to numpy `npy` file (format 2)

Here is the use scenario: You want to write/append your STL vector to a numpy binary file which you can process using python-numpy/scipy. Another scenario: Your application generates a huge amount of data. If it is not written to disk, … Continue reading

Posted in Library | Tagged | Leave a comment

Safe level of mercury in soil, water and food

Following are verbatim from book chapter ( ) . Air The World Health Organization guideline value for inorganic mercury vapor is 1 μg/m3 as an annual average.227 A tolerable concentration is 0.2 μg/m3 for long-term inhalation exposure to elemental … Continue reading

Posted in Uncategorized | Tagged | Leave a comment

Benchmark ODE solver: GSL V/s Boost Odeint library

For our neural simulator, MOOSE, we use GNU Scientific Library (GSL) for random number generation, for solving system of non-linear equations, and for solving ODE system. Recently I checked the performance of GSL ode solver V/s Boost ode solver; both … Continue reading

Posted in Biological systems, Numerical computation, Uncategorized | Tagged , , , , | Leave a comment