Could someone please suggest me what would be the best way to remove such huge number of outlier data from the image. The regular clipping between data range in numpy array would simply reduce the data shape and the reconstruction to image is not possible going on that approach. I tried clipping the data range to one standard deviation range, but all the data including outlier got clustered in the edge.
Also, it's desirable to have the mean and standard deviation preserved with original data array after removing the outlier but not absolutely necessary.
PS: Things to keep in mind:
- Remove the outlier in range greater around -5 in the given histogram profile, also preserving the bimodal distribution and array shape(for image reconstruction).
- Clipping value in range brings the data at edge distorting the original result, which is unwanted.
- I tried to create masked array in numpy, but that cannot be saved as original file in rasterio.
Thank you for your inputs!