Skip to content

Commit

Permalink
Fix notebook on fuzzy logic (#73)
Browse files Browse the repository at this point in the history
* fix: Outdated syntax to apply fuzzy logic

* Thanks to @alkis05 for reporting bug #72
  • Loading branch information
castelao authored Jul 31, 2023
1 parent f34bef1 commit 9b77771
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ Contributors
* @BillMills: - PR #47, re-introduce Argo density inversion as inherited QCCheck.
- PR #53, update fuzzy logic to handle edge-case NaNs rather than masks.
- Reported bug that resulted on PR #61.
* @alkis05: Reported bug #72, outdated fuzzy logic notebook.
18 changes: 9 additions & 9 deletions docs/notebooks/fuzzy_logic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,17 @@
"x_QC = np.linspace(0.0, 1.0, 200)\n",
"\n",
"# Generate fuzzy membership functions\n",
"data['spike_lo'] = fuzz.zmf(data['x_spike'], cfg['fuzzylogic']['features']['spike']['low'])\n",
"data['spike_md'] = fuzz.trapmf(data['x_spike'], cfg['fuzzylogic']['features']['spike']['medium'])\n",
"data['spike_hi'] = fuzz.smf(data['x_spike'], cfg['fuzzylogic']['features']['spike']['high'])\n",
"data['spike_lo'] = fuzz.zmf(data['x_spike'], cfg['fuzzylogic']['features']['spike']['low']['params'])\n",
"data['spike_md'] = fuzz.trapmf(data['x_spike'], cfg['fuzzylogic']['features']['spike']['medium']['params'])\n",
"data['spike_hi'] = fuzz.smf(data['x_spike'], cfg['fuzzylogic']['features']['spike']['high']['params'])\n",
"\n",
"data['clim_lo'] = fuzz.zmf(data['x_clim'], cfg['fuzzylogic']['features']['woa_normbias']['low'])\n",
"data['clim_md'] = fuzz.trapmf(data['x_clim'], cfg['fuzzylogic']['features']['woa_normbias']['medium'])\n",
"data['clim_hi'] = fuzz.smf(data['x_clim'], cfg['fuzzylogic']['features']['woa_normbias']['high'])\n",
"data['clim_lo'] = fuzz.zmf(data['x_clim'], cfg['fuzzylogic']['features']['woa_normbias']['low']['params'])\n",
"data['clim_md'] = fuzz.trapmf(data['x_clim'], cfg['fuzzylogic']['features']['woa_normbias']['medium']['params'])\n",
"data['clim_hi'] = fuzz.smf(data['x_clim'], cfg['fuzzylogic']['features']['woa_normbias']['high']['params'])\n",
"\n",
"data['grad_lo'] = fuzz.zmf(data['x_grad'], cfg['fuzzylogic']['features']['gradient']['low'])\n",
"data['grad_md'] = fuzz.trapmf(data['x_grad'], cfg['fuzzylogic']['features']['gradient']['medium'])\n",
"data['grad_hi'] = fuzz.smf(data['x_grad'], cfg['fuzzylogic']['features']['gradient']['high'])\n",
"data['grad_lo'] = fuzz.zmf(data['x_grad'], cfg['fuzzylogic']['features']['gradient']['low']['params'])\n",
"data['grad_md'] = fuzz.trapmf(data['x_grad'], cfg['fuzzylogic']['features']['gradient']['medium']['params'])\n",
"data['grad_hi'] = fuzz.smf(data['x_grad'], cfg['fuzzylogic']['features']['gradient']['high']['params'])\n",
"\n",
"QC_lo = fuzz.trimf(x_QC, [0.0, 0.225, 0.45])\n",
"QC_md = fuzz.trimf(x_QC, [0.275, 0.5, 0.725])\n",
Expand Down

0 comments on commit 9b77771

Please sign in to comment.