========
Tutorial
========

This tutorial walks you through a typical seismology workflow in **iechelle**.

Step 1: Loading Data
--------------------
1. Open the **Home** tab.
2. Ensure **PSD File Type** is set correctly (e.g., `fits-image`).
3. Click **Select PSD File** and choose your dataset.
4. Click **Load PSD**. You should see the spectrum in the preview plot.

Step 2: Interactive Analysis
----------------------------
1. Navigate to the **Mode Selection** tab (see :numref:`mode_selection_tab`).
2. Adjust **Freq min** and **Freq max** to focus on the oscillation envelope.
3. Adjust **Delta Nu** ($\Delta\nu$) until the ridges in the Echelle diagram are vertical.
4. Use the **Lasso Select** tool (see :numref:`lasso_tool`) on the Echelle diagram to highlight a region of peaks.
5. Set a **Threshold** (e.g., `1.0`) and click **Find Peak** to automatically identify local maxima.

.. _mode_selection_tab:
.. figure:: _static/mode_selection_tab.png
   :align: center
   :width: 600

   Interactive Mode Selection.

.. _lasso_tool:
.. figure:: _static/lasso_tool.png
   :align: center
   :width: 150

   Lasso Select tool in the Bokeh toolbar.

Step 3: Mode Assignment
-----------------------
1. Go to **Table 1** (Candidate Peaks).
2. Select one or more rows.
3. Use the **Mode Select** dropdown to assign an angular degree $\ell$ (0, 1, 2, or 3).
4. Click **Assign Mode**. The selected peaks will change color in the diagram.

Step 4: Finalizing and Saving
-----------------------------
1. Once satisfied with a set of peaks, click **Move Tab1 -> Tab2**.
2. Review your final selection in **Table 2**.
3. Click **Save Tab 2 as** and choose your preferred format (``.pkb``, ``.csv``, or ``.txt``).

Conclusion
----------
You have now successfully identified and exported oscillation modes using `iechelle`!
