Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some minor edits #1

Merged
merged 1 commit into from
Jan 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 32 additions & 32 deletions harmonica/filters/fft_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@
class FFT_Filter:

"""
Transform 2D potential field data use FFT based filter
Transform 2D potential field data using a FFT based filter

Workflow: Pad Data --> FFT --> Define and Apply Filter --> Inverse FFT --> Unpad Data


Parameters
----------
da: 2d-xarray
This is the input 2D grid. Note, the input grid should be cartesian grid (northing, easting).
Geography grid (latitude,longitude) is invalid in here.
This is the input 2D grid. Note, the input grid should be a cartesian grid (northing, easting).
Geography grid (latitude,longitude) will not work here.

pad_width: None or list of arrays
List containing the pad width [northing_pad_width, easting_pad_width] called by xrft.padding.pad. Default value is None,
no padding apply to data.
no padding applied to data.

mode: str, default: "constant"
str for control xrft.padding.pad function, One of the following string values (taken from numpy docs).
Expand Down Expand Up @@ -142,12 +142,12 @@ def apply_filter(self,filter):
def derivative_e(self,order,savefilter=False,**kwargs):

"""
Calculate n order horizental derivative along easting
Calculate n order horizontal derivative along easting

Parameters
-------
order : int
The order of horizental derivative.
The order of the horizontal derivative.

savefilter : False or True
If savefilter is False, direct apply filter to data, output in space domain.
Expand All @@ -173,12 +173,12 @@ def derivative_e(self,order,savefilter=False,**kwargs):

def derivative_n(self,order,savefilter=False,**kwargs):
"""
Calculate n order horizental derivative along northing
Calculate n order horizontal derivative along northing

Parameters
-------
order : int
The order of horizental derivative.
The order of horizontal derivative.

savefilter : False or True
If savefilter is False, direct apply filter to data, output in space domain.
Expand Down Expand Up @@ -217,7 +217,7 @@ def derivative_v(self,order,savefilter=False,**kwargs):
Returns
-------
da_out : 2d-xarray
Xarray data in space domain after apply filter. Need savefilter = False.
Xarray data in space domain after appling filter. Need savefilter = False.

filter : 2d-array
filter itself. Need savefilter = True.
Expand All @@ -232,15 +232,15 @@ def derivative_v(self,order,savefilter=False,**kwargs):
else:
return filter

def guassian_lp(self,wavelength,savefilter=False,**kwargs):
def gaussian_lp(self,wavelength,savefilter=False,**kwargs):

"""
Filter data by Guassian Low-pass filter
Filter data by Gaussian Low-pass filter

Parameters
-------
wavelength : float
The cut off wavelength for low-pass filter. It has same unit with input xarray data.
The cut off wavelength for low-pass filter. It has the same units as input xarray data.

savefilter : False or True
If savefilter is False, direct apply filter to data, output in space domain.
Expand All @@ -249,7 +249,7 @@ def guassian_lp(self,wavelength,savefilter=False,**kwargs):
Returns
-------
da_out : 2d-xarray
Xarray data in space domain after apply filter. Need savefilter = False.
Xarray data in space domain after appling filter. Need savefilter = False.

filter : 2d-array
filter itself. Need savefilter = True.
Expand All @@ -264,15 +264,15 @@ def guassian_lp(self,wavelength,savefilter=False,**kwargs):
else:
return filter

def guassian_hp(self,wavelength,savefilter=False,**kwargs):
def gaussian_hp(self,wavelength,savefilter=False,**kwargs):

"""
Filter data by Guassian High-pass filter
Filter data by Gaussian High-pass filter

Parameters
-------
wavelength : float
The cut off wavelength for high-pass filter. It has same unit with input xarray data.
The cut off wavelength for high-pass filter. It has the same units as the input xarray data.

savefilter : False or True
If savefilter is False, direct apply filter to data, output in space domain.
Expand All @@ -281,7 +281,7 @@ def guassian_hp(self,wavelength,savefilter=False,**kwargs):
Returns
-------
da_out : 2d-xarray
Xarray data in space domain after apply filter. Need savefilter = False.
Xarray data in space domain after appling filter. Need savefilter = False.

filter : 2d-array
filter itself. Need savefilter = True.
Expand All @@ -304,7 +304,7 @@ def upward_continuation(self,height,savefilter=False,**kwargs):
Parameters
-------
height : float
Heigh for upward continuation. The value should be negtive. It has same unit with input xarray data.
Height for upward continuation. The value should be negative. It has the same units as the input xarray data.

savefilter : False or True
If savefilter is False, direct apply filter to data, output in space domain.
Expand All @@ -329,24 +329,24 @@ def upward_continuation(self,height,savefilter=False,**kwargs):
return filter


def vertical_intergral(self,order=-1,savefilter=False,**kwargs):
def vertical_integral(self,order=-1,savefilter=False,**kwargs):

"""
Vertical intergral of potential field data
Vertical integral of potential field data

Parameters
-------
order : -1
Vertical intergral. eg: transform gravity to gravity potential.

savefilter : False or True
If savefilter is False, direct apply filter to data, output in space domain.
If savefilter is False, directly apply filter to data, output is in the space domain.
If savefilter is True, don't apply filter to data, output is the filter itself.

Returns
-------
da_out : 2d-xarray
Xarray data in space domain after apply filter. Need savefilter = False.
Xarray data in space domain after applying filter. Need savefilter = False.

filter : 2d-array
filter itself. Need savefilter = True.
Expand All @@ -367,22 +367,22 @@ def rtp(self,I,D,Im=None,Dm=None,savefilter=False,**kwargs):

"""
Reduce total field magnetic anomaly data to the pole. For low inclination
area, RTP is not stable. Recommod reduce total field magnetic anomaly data
area, RTP is not stable. Recommebd reduce total field magnetic anomaly data
to the equator (rte).

Parameters
-------
I : float in degree
I : float in degrees
The inclination inducing Geomagnetic field.

D : float in degree
D : float in degrees
The declination inducing Geomagnetic field.

Im : float in degree
Im : float in degrees
The inclination of the total magnetization of the anomaly source. Default is I,
neglecting remanent magnetization and self demagnetization.

Dm : float in degree
Dm : float in degrees
The declination of the total magnetization of the anomaly source. Default is D,
neglecting remanent magnetization and self demagnetization.

Expand All @@ -402,7 +402,7 @@ def rtp(self,I,D,Im=None,Dm=None,savefilter=False,**kwargs):
Returns
-------
da_out : 2d-xarray
Xarray data in space domain after apply filter. Need savefilter = False.
Xarray data in the space domain after applying filter. Need savefilter = False.

filter : 2d-array
filter itself. Need savefilter = True.
Expand Down Expand Up @@ -451,7 +451,7 @@ def rte(self,I,D,Im=None,Dm=None,savefilter=False,**kwargs):
neglecting remanent magnetization and self demagnetization.

savefilter : False or True
If savefilter is False, direct apply filter to data, output in space domain.
If savefilter is False, directly apply filter to data, output in space domain.
If savefilter is True, don't apply filter to data, output is the filter itself.

North
Expand All @@ -466,7 +466,7 @@ def rte(self,I,D,Im=None,Dm=None,savefilter=False,**kwargs):
Returns
-------
da_out : 2d-xarray
Xarray data in space domain after apply filter. Need savefilter = False.
Xarray data in the space domain after applying filter. Need savefilter = False.

filter : 2d-array
filter itself. Need savefilter = True.
Expand Down Expand Up @@ -517,7 +517,7 @@ def pseudo_gravity(self,I,D,Im=None,Dm=None,F=50000,savefilter=False,**kwargs):
neglecting remanent magnetization and self demagnetization.

F : float or 2d-array
Ambient field in the study area. It can use the mean ambinent field value in the study
Ambient field in the study area. It can use the mean ambient field value in the study
area or the real ambient field value in all locations. Default is 50,000 nT.

savefilter : False or True
Expand All @@ -536,7 +536,7 @@ def pseudo_gravity(self,I,D,Im=None,Dm=None,F=50000,savefilter=False,**kwargs):
Returns
-------
da_out : 2d-xarray
Xarray data in space domain after apply filter. Need savefilter = False.
Xarray data in space domain after applying filter. Need savefilter = False.

filter : 2d-array
filter itself. Need savefilter = True.
Expand Down