[SciPy-user] scale arrays with interpolation
Fabian Braennstroem
f.braennstroem@gmx...
Sat Sep 13 08:39:23 CDT 2008
Hi,
in fluid dynamics one often plots velocity distribution scaled by some
reference to take a look at self-similarity. E.g. for free jets one can
extract the velocity across the plot, which gives
two different arrays; an x_array and an y_array, where the x_array corresponds
to the position and the y_array to the velocity at this position. So
one would get two arrays of the same size:
x_array=[ 1,2,3,4,5,6,7,8,9,10]
y_array=[ 0,1,1,2,5,2,1,1,1,1]
For the visualization of self-similar behavior one scales the y_array with the
local maximum (in this case 5) and the x_array with the position, where the
velocity is the half of the maximum. This means one has to calculate the half
velocity (5/2=2.5) and has to interpolate the position of this value to get the
position (in this case it is somewhere between 4 and 5). This half-width
position would be used to scale the x_array. At the end one gets:
x_array_scaled= [1/half_width_position, 2/half_with_position,...,10/half_width_position]
y_array_scaled= [0/local_max,1/local_max,...,1/local_max]
Does anyone have a suggestion how to do this? The major problem is how to get
the 'half_width_position'. Would be nice, if anyone has an idea!
Greetings!
Fabian
More information about the SciPy-user
mailing list