From 01fa2ed95e076a995ed0b8bd00ffe7814f707528 Mon Sep 17 00:00:00 2001 From: kevindougherty-noaa <69815622+kevindougherty-noaa@users.noreply.github.com> Date: Fri, 28 Jan 2022 14:13:46 -0500 Subject: [PATCH] Adding LAMDA filtering toolkit (#115) * updates to plot_features.py * add LAMDA filtering tools * changed to functions * pycodestyle issues --- LAMDA/LAMDA_tools.py | 56 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 LAMDA/LAMDA_tools.py diff --git a/LAMDA/LAMDA_tools.py b/LAMDA/LAMDA_tools.py new file mode 100644 index 0000000..4208047 --- /dev/null +++ b/LAMDA/LAMDA_tools.py @@ -0,0 +1,56 @@ +import numpy as np +import pandas as pd + + +def land_fraction(self, df): + """ + Returns dataframe for only land data. + """ + df = df[df['land_fraction'] > 0] + + return df + + +def water_fraction(self, df): + """ + Returns dataframe for only water data. + """ + df = df[df['water_fraction'] > 0] + + return df + + +def cloud_fraction(self, df): + """ + Returns dataframe for only cloud data. + """ + df = df[df['cloud_fraction'] > 0] + + return df + + +def vegetation_fraction(self, df): + """ + Returns dataframe for only vegetation data. + """ + df = df[df['vegetation_fraction'] > 0] + + return df + + +def ice_fraction(self, df): + """ + Returns dataframe for only ice data. + """ + df = df[df['ice_fraction'] > 0] + + return df + + +def snow_fraction(self, df): + """ + Returns dataframe for only snow data. + """ + df = df[df['snow_fraction'] > 0] + + return df