I'm working on a problem that involves production rate data from oil wells. These rates are recorded per month i.e. after a month of production the produced volume is calculated and reported as rate (=volume per month). During the production history of a well, it may be shut-in many times for various reasons. This will generate some errors in recorded rates. For example let's say the production engineer records production rates for a well at the beginning of every month. He records one point on January 1st and the next point on February 1st. But from February 5th to February 25th the well is shut-in. On March 1st the production engineer records another data point and report it as the production rate for February without considering the fact that this well has been only active for about 10 days during February. Assuming that I have no information about how many days per month a well is active, I am looking for a quantitative way to eliminate these erroneous data points (simply replace them with zeros). I came up with a simple idea to use numerical derivative and find sharp changes in flow rate and eliminate them. Here is the result for one well (for better quality: right click-> open in new tab):

This well was shut-in from mid-1988 to mid 1995 and the operator flowed it back on the very last days of March. The next point recorded on April first shows a very low flow rate which was also identified using two points forward numerical derivative. However, I am not sure if this is the best way to do it. Is there a specific area in math or computer science that take care of problems like this?