diff --git a/2026/sunpy/sunpy-radiospectra-monier-ayman2.md b/2026/sunpy/sunpy-radiospectra-monier-ayman2.md new file mode 100644 index 0000000..06efd9b --- /dev/null +++ b/2026/sunpy/sunpy-radiospectra-monier-ayman2.md @@ -0,0 +1,201 @@ +## **Basic Information** + +**Name:** Monier Ayman Monier +**University:** Suez Canal University, Faculty of Computers and Informatics (2024 \- Present) +**Time Zone:** GMT+2 +**Overview:** I am a second-year Computer Science student passionate about exploring technology and building impactful solutions. I excel at problem-solving, enjoy tackling challenging technical problems, and approach learning with curiosity and a hands-on mindset. + +**Contact Info:** +[**monierayman2007@gmail.com**](mailto:monierayman2007@gmail.com) +[**https://github.com/Monier-Ayman**](https://github.com/Monier-Ayman) +[**https://www.linkedin.com/in/monier-ayman/**](https://www.linkedin.com/in/monier-ayman/) +**@monier\_ayman:matrix.org** +**@monier\_ayman (Discord)** + +## **Me and GSoC** + +* I plan to dedicate approximately **12 hours per week** before the start of GSoC to familiarize myself with the codebase and documentation. +* During the coding phase of GSoC, I am prepared to invest a minimum of **24 to 30 hours per week** into the project. Furthermore, I am open to continuing my involvement with the SunPy project beyond the GSoC period. I plan to remain involved with the SunPy community after GSoC if additional work arises. + +## **Why Me?** + +* Over the past weeks, I have spent a great deal of time inspecting the codebase of Sunpy and trying to resolve issues. + +* I took a deep dive into the Sunpy documentation and I became familiar with many Sunpy’s modules. + +* I joined the matrix [room](https://app.element.io/#/room/#sunpy:openastronomy.org) and became familiar with the project's community and mentors. And I was asking questions about the project and the codebase. + +## **My Experience** + +* **Contributions to Sunpy:** + * [Split contributors into New and Other sections \#8501](https://github.com/sunpy/sunpy/pull/8501) \[Waiting for review\] + +* **Contributions to sunpy/radiospectra:** + * [Implement freq\_at\_index method for GenericSpectrogram \#138](https://github.com/sunpy/radiospectra/pull/138) *Closed* + * [*Fix \#56: Correct Callisto client and observatory fallback \#145*](https://github.com/sunpy/radiospectra/pull/145) *Closed* + * [Improve overview.rst with narrative and Quick Start example \#165](https://github.com/sunpy/radiospectra/pull/165) + \[Waiting for review\] + +* **Personal Projects:** + +- **Library Management System [https://github.com/Monier-Ayman/Library-Management-System](https://github.com/Monier-Ayman/Library-Management-System)** + - A C++ Library Management System project implemented using **Object-Oriented Programming (OOP)** and key data structures including **Map, Stack, Linked List, and Vector**. This project simulates a small library where users can borrow and return books, and administrators can manage books and users. + +- **Mini Search Engine [https://github.com/Monier-Ayman/Mini-Search-Engine](https://github.com/Monier-Ayman/Mini-Search-Engine)** + - A C++ search engine using OOP, data structures, and SQLite for indexing and searching word frequencies across documents. + +* I’m also a competitive programmer and I’m active on [codeforces](https://codeforces.com/profile/-Monier). + +# --- + +# **Improving radiospectra’s Functionality and Interoperability** + +## **Introduction** + +**Problem Definition:** The **`radiospectra`** library provides tools to work with solar radio spectrograms, but its current implementation has several limitations: + +* Lack of **coordinate-aware operations** making it difficult to map time and frequency to array indices. +* Missing utilities from old Spectrogram (e.g., `join_many`, `rescale`, background subtraction). +* Visualization tools are incomplete, struggling with **gappy or irregular data**. +* Limited interoperability with SunPy, Astropy, and `xarray` data structures, which makes integration with modern workflows challenging. + + +These limitations make solar radio data analysis cumbersome and less reproducible. +**Solution:** Modernizing **`radiospectra`** involves redesigning its core data structures, adding utilities, improving visualization, and ensuring interoperability with scientific Python ecosystems. The solution will address the key limitations identified in the problem definition. + +**Coordinate-aware Spectra object:** + +* Redesign the **Spectra object** to map **physical coordinates** **(time, frequency)** to **array indices**. +* Implement utility methods such as **`freq_at_index(idx)`**, **`index_at_freq(freq)`**, **`time_at_index(idx)`**, and **`index_at_time(time)`**. +* **Enable axis-aware operations:** slicing, scaling, statistics, and rebinning. +* Ensure integration with **SunPy**, **Astropy**, **xarray**, or **NDCube** for modern workflow compatibility. + +**Background subtraction methods:** + +* Provide built-in commonly used **background subtraction methods**. +* Support **user-supplied custom functions** for flexible workflows. + +**Enhanced visualization:** + +* Handle **gaps**, **masked values**, and **irregular sampling** in spectral data. +* Provide **sensible defaults** while allowing **user customization**. + +**Documentation and examples:** + +* Add comprehensive **docstrings** for all new functionality. +* Create an **example gallery** demonstrating slicing, analysis, background subtraction, and plotting workflows. + +**Testing and CI:** + +* Implement **unit tests** for all new methods to ensure correctness. +* Use **continuous integration (CI)** to maintain code quality and prevent regressions. + +## **Project Deliverables** + +This project aims to improve the functionality and interoperability of the **radiospectra** library by redesigning core data structures and enhancing analysis and visualization capabilities for solar radio spectrograms. + +**This project will focus on the following tasks:** + +* Implement a **coordinate-aware Spectra object** that maps physical coordinates (time and frequency) to array indices. +* Add conversion utilities such as `freq_at_index(idx)`, `index_at_freq(freq)`, `time_at_index(idx)`, and `index_at_time(time)`. +* Support **axis-aware operations** on spectrogram data, including slicing, scaling, and statistical reductions. +* Integrate **background subtraction methods**, while allowing users to provide custom implementations. +* Improve **visualization tools** to better handle gappy or irregular spectrogram data. +* Refactor parts of the radiospectra codebase to improve maintainability and organization. +* Provide **documentation, example workflows, and an example gallery** demonstrating the new functionality. +* Add **unit tests and ensure compatibility with the existing CI system** to maintain code quality. + +In addition to the above tasks, other crucial aspects must be integrated into the implementation process: + +* Clean, reliable, and maintainable code. +* Blog posts containing a log of everything that has been done and what's next. + +## **Implementation** + +**Design the Class Diagram** + +The following diagram describes the whole **sunpy.radiospectra** classes in a high-level fashion: + +**![][image1]** + +**Refactoring** + +I plan to improve the **`GenericSpectrogram`** class and the radiospectra package to make the code easier to use, maintain, and extend. The main steps are: + +* **Organize time and frequency methods** so it’s easier to convert between coordinates (time, frequency) and array indices. +* **Standardize names and data structures** for consistent access to time and frequency information. +* **Move helper functions** (like index <-> time and index <-> frequency conversions) into **`utils.py`** to avoid duplicate code. +* **Improve visualization methods** to handle gappy or irregular data with clear defaults. +* **Add background subtraction tools** with built-in methods and support for custom user functions. + +This refactoring will make the radiospectra code cleaner, easier to maintain, interoperable with the SunPy ecosystem, and ready for the new features of the project. + +**Testing** +Writing tests is a crucial part of the software development lifecycle. All new functionality in the **radiospectra** library—including the coordinate-aware Spectra object, conversion utilities (**`freq_at_index(idx)`**, **`index_at_freq(freq)`**, **`time_at_index(idx)`**, **`index_at_time(time)`**), axis-aware operations, background subtraction methods, and improved visualization for gappy or irregular data—will have dedicated test cases. These tests, written in **`test_spectrum.py`**, will verify correct behavior for valid inputs, edge cases, and out-of-bounds values. **Continuous integration (CI)** will be used to ensure that all tests pass and that new changes do not break existing functionality. + +**Documentation Strings** + +Documentation is essential for maintainability and usability. Docstrings will be added to all new classes, functions, and utilities, including the Spectra object, conversion methods, background subtraction utilities, and enhanced plotting routines. Usage examples and step-by-step guides will illustrate typical workflows with spectrogram data, including coordinate-based slicing, analysis, background subtraction, and visualization of gappy data. All documentation will follow existing **radiospectra** and **SunPy** coding standards for clarity, consistency, and readability. An **example gallery** (e.g., notebooks or scripts) will showcase the full capabilities of the new functionality. + +## **Timeline** + +**Community Bonding Period (May 1 \- 24):** + +**Week 1-2 (May 1 \- 15):** + +* Get to know mentors and interact with the SunPy community. +* Deep dive into radiospectra documentation and codebase. +* Familiarize with SunPy, Astropy, xarray, and NDCube for interoperability. +* Clarify ambiguous parts of the proposal and plan workflows. +* Start a blog to track progress and learning. + + +**Week 3 (May 16 \- 24):** + +* **Plan and design the coordinate-aware Spectra object.** +* **Plan and design supporting conversion utilities:** `freq_at_index(idx)`, `index_at_freq(freq)`, `time_at_index(idx)`, `index_at_time(time)`**.** +* Begin refactoring frequency- and time-related methods to simplify code. +* Start creating **`utils.py`** for helper functions (coordinate conversions and reusable logic). + +**Week 4 (May 25 \- 31):** + +* Implement the **initial version of the Spectra object** with basic coordinate-aware functionality. +* Implement conversion utilities and integrate with the Spectra object. +* Begin initial **background subtraction framework** with at least one built-in method. +* Write **initial unit tests** for new methods. +* Add documentation strings and usage examples. +* Submit initial pull requests and seek mentor feedback. + +**Final Exams (June 1 \- June 30):** + +* Focus on college exams while remaining active in the SunPy community. +* Address small code improvements or review comments when possible. + +**Week 5 (July 1 \- July 8):** + +* Continue refactoring GenericSpectrogram and related methods for maintainability and interoperability. +* Complete remaining utilities in **`utils.py`** and ensure they are tested. +* Enhance **visualization methods** to handle gappy, masked, or irregular data. +* Submit pull requests for refactoring and utils. + +**Midterm Evaluation (July 6 \- 10\)** + +**Week 6 (July 11 \- July 17):** + +* Implement **axis-aware operations** (slicing, scaling, statistics, rebinning) for Spectra. +* Complete **background subtraction methods** including support for custom user functions. +* Write comprehensive **unit tests** covering all new functionality and edge cases. +* Update **documentation, examples, and usage guides**. +* Submit pull requests for tests and documentation. + +**Week 7 (July 18 \- July 25):** + +* Complete remaining improvements based on mentor feedback. +* Finalize the **example gallery** demonstrating slicing, analysis, background subtraction, and visualization workflows. +* Ensure all functionality passes CI and final testing. +* Prepare final pull requests, finalize documentation, and complete project reports. +* **Review the project for any additional improvements and seek final mentor feedback before the final evaluation.** + +**Final Evaluation** + +[image1]: \ No newline at end of file