#NEWLINE# @ staticmethod #NEWLINE# def _extrap_2d( axis , delta , npoints , arr , new_shape , normal ) : #NEWLINE# #INDENT# ' Return extrapolated `arr`. ' #NEWLINE# ( imax , jmax ) = arr . shape #NEWLINE# new_arr = numpy . zeros ( new_shape ) #NEWLINE# if ( axis == 'i' ) : #NEWLINE# #INDENT# if ( delta > 0 ) : #NEWLINE# #INDENT# v = arr [ ( - 1 ) , : ] #NEWLINE# if ( imax > 1 ) : #NEWLINE# #INDENT# dv = ( ( v - arr [ ( - 2 ) , : ] ) * delta ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# dv = ( normal * delta ) #NEWLINE# #UNINDENT# indx = imax #NEWLINE# new_arr [ 0 : indx , : ] = arr #NEWLINE# for i in range ( npoints ) : #NEWLINE# #INDENT# new_arr [ ( indx + i ) , : ] = ( v + ( ( i + 1 ) * dv ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# v = arr [ 0 , : ] #NEWLINE# if ( imax > 1 ) : #NEWLINE# #INDENT# dv = ( ( arr [ 1 , : ] - v ) * delta ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# dv = ( normal * ( - delta ) ) #NEWLINE# #UNINDENT# indx = npoints #NEWLINE# new_arr [ indx : , : ] = arr #NEWLINE# indx -= 1 #NEWLINE# for i in range ( npoints ) : #NEWLINE# #INDENT# new_arr [ ( indx - i ) , : ] = ( v + ( ( i + 1 ) * dv ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( delta > 0 ) : #NEWLINE# #INDENT# v = arr [ : , ( - 1 ) ] #NEWLINE# if ( jmax > 1 ) : #NEWLINE# #INDENT# dv = ( ( v - arr [ : , ( - 2 ) ] ) * delta ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# dv = ( normal * delta ) #NEWLINE# #UNINDENT# indx = jmax #NEWLINE# new_arr [ : , 0 : indx ] = arr #NEWLINE# for j in range ( npoints ) : #NEWLINE# #INDENT# new_arr [ : , ( indx + j ) ] = ( v + ( ( j + 1 ) * dv ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# v = arr [ : , 0 ] #NEWLINE# if ( jmax > 1 ) : #NEWLINE# #INDENT# dv = ( ( arr [ : , 1 ] - v ) * delta ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# dv = ( normal * ( - delta ) ) #NEWLINE# #UNINDENT# indx = npoints #NEWLINE# new_arr [ : , indx : ] = arr #NEWLINE# indx -= 1 #NEWLINE# for j in range ( npoints ) : #NEWLINE# #INDENT# new_arr [ : , ( indx - j ) ] = ( v + ( ( j + 1 ) * dv ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return new_arr