#Editing Data Series#
ODM Tools Python includes functionality to edit data values, add qualifiers to data values, derive new data series, and save edits to data series stored within an ODM database. Data editing is important for performing quality control and post processing on data series where some data values may need to be deleted, adjusted, or interpolated. Deriving data series is useful for aggregating data (e.g., daily average derived from high frequency measurements) or generating a data series that is a function of one or more other data series (e.g., discharge as a function of stage). Currently the functionality to derive new data series is not built into ODMTools Python.
##Selecting Series for Editing##
The 'Edit' tab is used to perform edits on data series. The visualizations that are created in the 'View' tab will carry over to the 'Edit' tab, and the Series Selector is used to show/hide data series in the plot. This way, multiple data series can still be viewed while edits are made. Only one data series can be edited at a time. To select a series for editing, the series of interest should be highlighted in the Series Selector. Click on the 'Edit Series' button in the ribbon to begin editing or right click on the series in the Series Selector and select 'Edit'. When a series is in editing mode, a few aspects of the plot change:
-
The symbology of the series of interest changes from the plot type and color selected in the 'Plot' tab to black squares and lines. The symbology of any additional displayed series are made more subtle.

-
The 'No Data' values that were previously hidden are now be plotted. This will often change the zoom level on the plot since large, negative numbers are typically used to indicate 'No Data' (e.g., -9999).

-
If the series selected for editing was not plotted previously, it will automatically be plotted.
#Scripting Edits with Python#
A powerful capability of ODM Tools Python is the functionality to record the steps performed to edit a data series. This is accomplished by scripting in Python. All actions taken in editing mode are recorded as lines of code in the Python script editor. The script can then be saved for later execution and review. There are several benefits to this practice. Most importantly, it fosters traceability and transparency in the editing process as information regarding the editor, date of editing, and specific functions performed are all retained. In addition to recording the editing steps, the user can add comments to the script to annotate the rationale for edits. The scripting functionality also makes edits reproducible, which adds flexibility to the post-processing workflow. The editing of a data series can be performed in multiple sessions with the script incrementally saved and re-run for each new session. A script could be generated by one user and then reviewed and revised by another user before implementation.
When editing is active, all editing steps are automatically recorded. Every time points are selected and tasks are performed, the steps are added as lines of code to the script editor. The user can also add comments, which should be done by adding # to the front of each line. Viewing the Script Editor window is helpful during this process. Options for scripting are:
- Record without starting a new script. This records all of the edits, but does not associate them with a database or a series. This is typically only done with testing.
- Start a new script. This records all edits to a new scripts and adds the file header to associate the edits with a database and a data series.
- Open an existing script: This brings up a dialog to open a previously saved script, which can then be edited, exectued, and appended with any new edits performed.
Note that the credentials of the database connection will be displayed here. The user can edit the script to delete usernames and passwords. The screenshot below shows the program duing an editing session with code and annotations being recorded in the script editor.
