A General Analytical Framework for Estimating the Production Function for Crops Using Irrigation Water