Skip to content
Patrick Brockmann edited this page Sep 30, 2025 · 83 revisions

Description

PyAnalySeries Reimagined: A Legacy Tool Reborn

DOI

PyAnalySeries is a Python application built on matplotlib, with a PyQt-based graphical interface, making it easily portable across platforms including Linux, macOS, and Windows.
It is designed as a modern continuation of the AnalySeries, the original application on MacOS, aiming to reproduce its core functionalities within a more robust and portable Python environment.
Special attention has been given to ergonomics, emphasizing simplicity and clarity, while offering intuitive interactivity such as zooming, panning, and scrolling, with linked or independent axis.
The core design follows a "Define then Apply" workflow for data processing operations such as filtering, sampling, and interpolation.
Documents are read and saved in an open format spreadsheet (xlsx) with multiple worksheets for organization. It is also possible to import series or pointers directly from the clipboard, following a simple copy (Ctrl+C) and paste (Ctrl+V) operation from an external spreadsheet.
The application leverages robust, well-tested modules for interpolation, notably SciPy, and features an interactive interface for defining interpolation pointers (formerly known as Linage and Splinage), allowing for precise placement and manipulation—either directly on data points or independently.

Based on:

  • numpy
  • pandas
  • matplotlib
  • scipy
  • shapely
  • openpyxl
  • PyQt

Conception and developments: Patrick Brockmann LSCE/CEA - IPSL

This project is distributed under the CeCILL v2.1 license. CeCILL License

Evolution

The code is managed on GitHub, where you are welcome to submit feature requests or bug reports via issues. The architecture is designed to easily integrate new processing modules.
We encourage you to actively contribute to the development or the documentation.


Design and Interface

The application can be launched from a command line or via a shortcut (see installation procedure)
The window that appears is organized as follows:

It features the menus File, Edit, Create, Process, Help, and About.

You can double-click an item in the Name, X, or Y column to add or modify its value.
When you hover over the ID, a tooltip appears showing the history and the comment.

Icon Description
Serie
Serie with duplicated index points (X)
Filter
Sample
Interpolate

File

New - Open - Save

A new worksheet can be created to host imported series or items cut from another worksheet.
Worksheets can be removed from the application (right-click → Remove).
Note that this does not delete the corresponding file from the filesystem.
You can also rename a worksheet — in this case, the associated file on the filesystem will be renamed accordingly.
Finally, the display order of worksheets can be adjusted using right-click → Up or Down.

When a worksheet is modified and has not yet been saved to the filesystem, an asterisk * is displayed as a suffix to indicate unsaved changes.
You can press Ctrl+S to save the current worksheet with unsaved changes.
You can also press Ctrl+Shift+S to save all unsaved worksheets.

Exit

You can exit the application using this menu or the key 'Q' as shortcut.
A confirmation prompt will appear before closing.


Edit

Cut - Copy - Paste

These standard menus are available to manage the copying or moving of items between different worksheets.
Within a single worksheet, you can also reorganize an item by dragging it with the right mouse button held down.

Action Windows/Linux Shortcut macOS Shortcut
Copy Ctrl + C ⌘ (Cmd) + C
Paste Ctrl + V ⌘ (Cmd) + V
Cut Ctrl + X ⌘ (Cmd) + X

You can assign a name to the series or the treatment by clicking on the Name column section.

Names in columns 'X' and 'Y' can also be changed.

Note, that you can also add a comment using Display and the Info tab.

Display

Each row represents a series, a filter, a sampling, or an interpolation. Each of these objects can be displayed individually, and series can also be viewed in multiple panels using the Stacked or Together display modes.
Simply type Ctrl+D to get a Display. Press 'Q' to close the window.

The interactions available through the Display commands, and more generally in plots, include:

Interaction Area Action / Shortcut
Zoom Axis & Plot Mouse scroll (up/down)
Pan Axis & Plot Click + drag
Reset view (auto range) Axis & Plot Press A

From the main window of the application, you can control the color of the curves and the orientation of the vertical axis.
Windows displaying plots with modified series will be redrawn, taking into account the new parameters (color, vertical axis orientation).

Single

Action Windows/Linux Shortcut macOS Shortcut
Display Single Ctrl + D ⌘ (Cmd) + D

The window appears like this:

Points can be displayed by holding down the Ctrl key while the mouse is over the plot.

In Display Single mode, in addition to the visible plot in the Plot tab, you have access to several other tabs: Data, Stats, and Info.

The Data tab shows the series values in a two-column table: X and Y. Missing values are displayed as nan in orange, and duplicate values (same X values) are highlighted in yellow.

If needed, you can copy the serie values using Ctrl+C (or Cmd+C on Mac) to the clipboard for pasting into a spreadsheet.

The Stats tab provides statistical information about the series.

From the Info tab, you can read the history and write some text as comment.

Together

Action Windows/Linux Shortcut macOS Shortcut
Display Together Ctrl + T ⌘ (Cmd) + T

You can view multiple series at the same time using 'Display Together'.
The series will then share the horizontal and vertical axis of the first selected series.

You can also get separated vertical or horizontal axis using the following menu:

With the 'Separated axis vertical' or 'Separated axis horizontal' option, each series is displayed on its own axis, allowing independent zooming (scroll wheel up or down) and panning.
To reset the view to the full range of a given serie, simply press 'a' on the desired axis.
This keyboard shortcut restores the axis range limits for all series when applied directly on the plot.
You can also control the visibility of each series by clicking on its name in the legend.

Stacked

Action Windows/Linux Shortcut macOS Shortcut
Display Stacked Ctrl + T ⌘ (Cmd) + T

In this mode, the series are displayed one above the other.
The horizontal axis can be linked or kept independent using the 'Shared horizontal axis' option.


Create

Import data

Use this menu to open a window for importing series or pointers for interpolation.

  1. Copy the columns including the column names from a spreadsheet using the clipboard with a Ctrl+C.
  2. Press Ctrl+V to paste them into the window.
  3. If you intent to import pointers, you can reorganize the columns using drag and drop if needed.
  4. To start over, simply paste new data — there's no need to delete the previous content.

Multiple formats are supported:

Type Accepted Column Formats
Pointers Distorted, Reference
Series X, Y or X, Y1, Y2, ...

When importing series, missing values are allowed for Y but not for the X index.
When importing pointers, missing values are not allowed.

During import, the X values (index) do not need to be ordered. However, plots will always display the series using an increasing index.

Random serie

This menu opens a window to generate a serie with random values. You can control the X-axis excursion, the number of points, and the Y-axis range.
This window is primarily intended for demonstration purposes, along with the associated class (resources/defineRandomWindow.py).

Insolation / Astronomical serie

This menu opens a window for generating time series based on astronomical parameters and insolation quantities.
Different types of astronomical solutions are available, each with its own range of validity. Some insolation quantities are only available for specific solution types.
The code behind these features is based on the work and original code developed by researcher Didier Paillard.


Process

Filter smoothing average

You can define a filter using a centered moving average, based on a convolution.
The moving average is calculated as:
$\text{MA}_i = \frac{1}{N} \sum_{j=0}^{N-1} x_{i+j}$

Where: $x_j$ is the original series value at position $j$,
$N$ is the window size (must be an odd number),
$\text{MA}_i$ is the filtered value at index $i$.

Because the window size is odd, the result is centered: each output value is aligned with the center of the window.
You can adjust the window size to control how much smoothing is applied and immediately view the effect.
Once you're satisfied:

  • You can save the filter and the filtered serie.
  • The filter can be reapplied to other series using the "Apply Filter smoothing average" from the Process menu.

Sampling

This window allows you to resample a dataset either using a regular step or based on the X-values of another series.
You can choose between different types of interpolation methods:

Interpolation type Description
nearest Nearest-neighbor interpolation
zero Step function interpolation to the left
linear Straight-line interpolation between points
quadratic Second-order spline interpolation
cubic Third-order spline interpolation

Standard Sampling

When the 'Integration' option is disabled, the time series is resampled by directly interpolating values at the specified sampling points. This interpolation uses the selected method ('nearest', 'zero', 'linear', 'quadratic', 'cubic', etc.) and fills missing data in both directions. This approach is efficient and well suited for pointwise resampling where a direct value estimate at each sampling position is desired.

Integrated Sampling

When the 'Integration' option is enabled, resampling is performed by averaging the values of the curve over intervals defined between midpoints of consecutive sampling points. The underlying curve is modeled as a continuous function using scipy.interpolate.interp1d, and numerical integration is performed on each interval using fixed-point Gaussian quadrature (fixed_quad). This technique yields smoothed values that reflect the area under the curve, making it more suitable for low-resolution sampling or analyses focused on cumulative or average behavior. The boundaries of each integration interval are visually indicated by dashed vertical lines on the plot.

Interpolation

This menu opens a window that provides the core functionality of the application.
In this window, you can interpolate two data series by interactively placing correspondence pointers along their X-values.
These pointers appear as vertical dashed lines and can be placed using Shift + left-click.
You are free to reposition the pointers on each plot as long as they are not yet connected (key 'c').
Once at least two connections are defined, the lower curve becomes available, interpolated onto the upper one (key 'z').

You can place the pointers either between points (transitional zones) or directly on data points by pressing Ctrl + left-click.

You can switch between the different series selected when launching the window.
This allows you to explore how various quantities respond to interpolation in real time.

Methods

Two interpolation methods are available:

  • Linear interpolation, the interpolation constructs a piecewise linear transformation between two coordinate sets. The function linearly maps values from X2 back to the corresponding positions in the X1 domain, preserving a continuous relationship across the data range. For inputs outside the original range, the mapping is extended using linear extrapolation, ensuring consistent behavior beyond known data points.

  • PCHIP (Piecewise Cubic Hermite Interpolating Polynomial), which preserves the shape and monotonicity of the data.
    PCHIP offers smoother transitions and avoids overshooting, making it more suitable when working with non-uniform or oscillating data. Outside the range, linear extrapolation is applied using the slope of the nearest segment to ensure stable results.

Interactions

You can remove the last pointer (key 'u') and re-add it, which makes it easy to observe its effect.
You can also remove all pointers (key 'X'). When the interpolated curve is displayed (key 'z'), the interpolated X-axis appears at the top of the plot.

The available interactions are listed in the table below (also accessible from the Help menu):

Action Description
Hold shift key while left click on a curve Create or move a pointer
Hold down ctrl key on a plot Display points of the curve
Hold down ctrl key on a plot while left click on a curve Create or move a pointer snapped to a data point
Press c key Connect pointers
Hold down x key while left click on a connection Delete the connection; pointers remain
Press u key Undo last connection
Press X key Delete all pointers and connections
Press z key Display/Hide interpolated curve with distorded vertical range
Press Z key Display/Hide interpolated curve with reference vertical range

From the interpolation window (or Display INTERPOLATION window), you have access to two tabs: 'Pointers' and 'Pointers plot'.
The first tab displays the pointer coordinates (x, y) in a table spreadsheet format.

The second tab displays a plot of the pointers (x vs y) in blue, and the gradient (dy/dx) in orange.

Apply Filter, Sampling, Interpolation

Once you have defined a FILTER, a SAMPLING, or an INTERPOLATION, you can reuse it to apply the same process to other series.
To do this, select the series and the process to apply.
The transformed series will appear below the original ones.


Help

This menu displays the following help information:


About

This menu displays the different people involved in this project:


Export figures

You can export the figures as PDF or PNG by right clicking on a plot, which will display the option "Save plot as PNG or PDF". You can then easily edit the PDF using software like Inkscape (https://inkscape.org/), which allows you, for example, to modify the plot labels (size, font, etc.).