#This function does a 2-dimensional interpolation.

defGet_Full_GMF(groundMotionField,lons,lats):

# Goal : This function does a 2-dimensional interpolation.

#INPUTS: groundMotionField,lons,lats

#lons : Column of longitudes of the locations we want to interpolate over.(type: pandas.DataFrame(series) OR numpy-1darray of len a)

#lats : Column of latitudes of the locations we want to interpolate over.(type: pandas.DataFrame(series) OR numpy-1darray of len a)

#groundMotionField: Numpy nd-array of the file with headers of X,Y,value_1,value_2....value_n ; This file must contain longitude values as the first column, latitude values as the second column and ground motion values as the 3rd. (type : m*n numpy-ndarray with shape of (a, n))

#INPUTS: groundMotionField,lons,lats

#lons : Column of longitudes of the locations we want to interpolate over.(type: pandas.DataFrame(series) OR numpy-1darray of len a)

#lats : Column of latitudes of the locations we want to interpolate over.(type: pandas.DataFrame(series) OR numpy-1darray of len a)

#groundMotionField: Numpy nd-array of the file with headers of X,Y,value_1,value_2....value_n ; This file must contain longitude values as the first column, latitude values as the second column and ground motion values as the 3rd. (type : m*n numpy-ndarray with shape of (a, n))

# Please note that if there are more than 3 columns, This function will do interpolation multiple times and each time using (X,Y,value) (value changes in range of value_1 to value_n each time up to last column).

#OUTPUTS: groundMotionField,lons,lats

#Complete_shakemap : a numpy-ndarray

#OUTPUTS: groundMotionField,lons,lats

# fullGroundMotionField : a numpy-ndarray containing logitudes,latitudes along with the interpolated values.

defGet_Full_GMF(groundMotionField,lons,lats):

importpandasaspd

importnumpyasnp

fromscipy.interpolateimportgriddata

importpandasaspd

importnumpyasnp

fromscipy.interpolateimportgriddata

# points_given : the input points for interpolation