python - Interpolation of large 2d masked array -
i have numpy masked matrix. , wanted interpolation in masked regions. tried rectbivariatespline didn't recognize masked regions masked , used points interpolate. tried bisplrep after creating x,y,z 1d vectors. each of length 45900. took lot of time calculate bsplines. , gave segmentation fault while running bisplev . 2d matrix of size 270x170.
is there way make rectbivariatespline not include masked regions in interpolation? or there other method? bisplrep slow.
thanking you, indiajoe
update : when grid small scipy.interpolate.rbf 'linear' function doing reasonable job. gives error when array large.
is there other function allow me interpolate , smooth matrix?
i have concluded following. correct me if wrong.
1) rectbivariatespline requires perfect filled matrix , hence masked matrices cannot used.
very late, but...
i have problem similar yours, , getting segmentation fault bisplines, , memory error rbf (in "thin_plate" function works great me.
since data unstructured created in structured manner, use downsampling half or 1 third of density of data points, can use rbf. advise (very inefficient, still better not doing @ all) subdivide matrix in many overlapping regions, create rbf interpolators each region, when interpolate 1 point choose appropriate interpolator.
also, if have masked array, still perform interpolation in unmasked array, apply mask on result. (well no, see comments)
hope helps somebody
Comments
Post a Comment