An interactive tool for masking spectrum (any x-y) data using Matplotlib and PyQt5. This tool allows users to visually mask and unmask points on a spectrum, providing an easy way to manipulate data for further analysis.
- Load spectrum data from FITS or CSV files.
- Select which columns to use as X and Y for visualization.
- Interactively mask points by clicking on them (left-click to mask, right-click to unmask).
- Automatically save masked data to new CSV or FITS files.
- Visualize spectrum data in a user-friendly interface with zoom and pan capabilities.
To install the Interactive Spectrum Mask Tool, use pip
:
pip install mymask
To run the application after installation, use the command:
mymask
- Click on the "Load Data" button to load your spectrum data.
- You can load either a CSV file or a FITS file.
- Once the file is loaded, use the dropdown menus to select the appropriate columns for X and Y.
- Left-click on a point in the plot to mask it.
- Right-click on a masked point to unmask it.
- The masked points will appear in red, while unmasked points will appear in blue.
- Click on the "Save Mask" button to save your mask.
- A new
.csv
file will be created with a suffix_mask
containing the mask, including amask
column indicating which points are masked.
The tool requires the following Python packages:
numpy
pandas
astropy
PyQt5
matplotlib
These dependencies will be automatically installed when you install the tool using pip
.
Here is a simple example of how to use the tool:
- Run the tool using the command:
mymask
- Click "Load Data" to load a CSV or FITS file.
- Select the columns to be used as X and Y for plotting.
- Interactively mask/unmask data points as needed.
- Click "Save Masked Data" to save your modifications.
This project is licensed under the GPL License - see the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request on the GitHub repository.
For any issues or questions, please contact lmytime@hotmail.com.
Enjoy using the Interactive Data Masking Tool to easily analyze and manipulate your data!