Skip to content
Snippets Groups Projects
Commit 4e728f61 authored by David Schäfer's avatar David Schäfer
Browse files

changed default nan plotting, as this might lead to really messy plots

parent 7905c763
No related branches found
No related tags found
No related merge requests found
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import click
import numpy as np
import pandas as pd
from saqc.core import runner
from saqc.flagger import CategoricalFlagger
FLAGGERS = {
"number": CategoricalFlagger([-1, 0, 1]),
"string": CategoricalFlagger(["NIL", "OK", "BAD"])
}
@click.command()
@click.option("-c", "--config", type=click.Path(exists=True), required=True, help="path to the configuration file")
@click.option("-d", "--data", type=click.Path(exists=True), required=True, help="path to the data file")
@click.option("--flagger", default="string", type=click.Choice(FLAGGERS.keys()), help="the flagging scheme to use")
@click.option("--fail/--no-fail", default=True, help="whether to stop the program run on errors")
@click.option("--nodata", default=np.nan, help="the nodata value")
@click.option("--plot/--noplot", default=False, help="whether to plot the results")
def main(config, data, flagger, fail, nodata, plot):
data = pd.read_csv(
data,
index_col=0,
parse_dates=True,
)
data, flagger = runner(
config_file=config,
flagger=FLAGGERS[flagger],
data=data,
nodata=nodata,
error_policy="raise" if fail else "warn"
)
# TODO: write file
flags = flagger.getFlags()
if __name__ == "__main__":
main()
......@@ -16,7 +16,7 @@ def plotAllHook(data, flagger):
_plot(data, flagger, True, __plotvars)
def plotHook(data, old, new, varname, do_plot, flag_test, plot_nans=True):
def plotHook(data, old, new, varname, do_plot, flag_test, plot_nans=False):
# old/new: flagger
if do_plot:
__plotvars.append(varname)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment