-
Notifications
You must be signed in to change notification settings - Fork 4
adding new pickers
Mike Brady edited this page Mar 5, 2020
·
2 revisions
All picker functions are stored under the algorithms
subdirectory.
The general ideas are:
- One module per usergroup (i.e. The
GSFC_NK.py
file contains pickers designed and implemented by NASA Goddard contributors) - Many pickers can exist per module
- Each picker reads a single trace of SnowRadar data (i.e. 1D numpy array of floats) and returns 2 index values (for air-snow and snow-ice interface locations, respectively) which correspond to the input trace.
To add a new picker for a new group, here are some steps to follow:
mygroup.py
def my_picker(trace, arg1, arg2, ... argN, kwarg1, kwarg2, ... kwargN):
...code...
3. Update the __init__.py
file inside the algorithms
subdirectory to allow your function to be imported:
from .mygroup import my_picker
4. Update the layerpicking.py
file to allow your picker to be selected. For example:
from pySnowRadar.algorithms import GSFC_NK, NSIDC, Wavelet_TN, my_picker
...
elif choice == 'mypicker':
try:
airsnow_layer, snowice_layer = my_picker(
data, arg1, arg2, *kwargs
)
except KeyError:
raise Exception('Missing or invalid parameters supplied for My_Picker picker')