I am facing a problem that in my data set I dont have uniform NaN locations i.e. location of NaN is changing with time so as the Number of Good Points. So I thought to use interpolation to make uniform NaN location at all time steps. such that Number of Good Points will be same at all time steps.
Let us see if I correctly understand what you are trying to achieve. At each point (x,y), you have a time series rain[L=1:LEND]. If rain is missing at some timesteps, you want rain to be missing at all timesteps. Is that what you want? If so,
For each gridpoint (x,y): If the number of "good" timesteps is equal to lend, rain is defined for all timesteps and we can use it as is. If, on the other hand, the number of good grindpoints is less than lmax, there are some timesteps when rain is missing and we regard all rain values as missing for that gridpoint (x,y).
Cheers,
Ryo