Skip to content

GSoC 2024 Ghaith Kdimati

Nabil Freij edited this page Apr 4, 2024 · 1 revision

Improve sunkit-image

1. SELF-INTRODUCTION

Personal Information

  • Full name: Ghaith Kdimati
  • University: Cairo University
  • Time Zone: (GMT+2)
  • Email: ghaithkdimati@gmail.com
  • Github username: Ghaithq
  • Element.io username: Ghaithk

Short Bio

I'm currently a third-year Computer Engineering student at Cairo University with a keen interest in Astronomy. I came across SunPy and found it to be an exciting opportunity to contribute to a project that aligns with my passions. SunPy's participation in GSoC further piqued my interest, and I'm enthusiastic about the prospect of leveraging my Python skills to contribute meaningfully to the SunPy community.

2. ME AND GSoC

Have I previously participated successfully in GSoC? When? With which project?

No, I haven’t.

Are you also applying to other projects?

“Improve sunkit-image” is the only project I’m applying to.

Are you eligible to receive payments from Google?

Yes.

How much time do you plan to invest in the project before, during, and after the Summer of Code?

I plan on investing as much time as needed. However, I do have exams in the first 2 weeks of June, Other than that I will be fully dedicated to the project offering as much time as needed.

3. ME THE PROGRAMMER

I am currently studying Computer Engineering, and my programming experience spans various levels of development. From high-level projects to delving into low-level development, I've gained a diverse skill set. One notable project I've worked on is the implementation of a Style Transfer algorithm in Python , details of which are provided in the accompanying doc and code. Additionally, you can find other projects on my GitHub profile that showcase my range of skills. While my experience with open-source software is not extensive, I have made small contributions to several organizations, including SunPy, Julia(GNN library called “GraphNeuralNetworks.jl”). Working on these projects has provided me with valuable exposure to collaborative environments within open-source communities. Git has been a central tool in my workflow for managing version control, and I have utilized it extensively across all my projects. Recently, I've gained more experience working within open-source organization environments, further honing my skills in version control and collaboration. As a result, I feel confident in my ability to navigate and contribute effectively in such settings. I have been actively involved in the SunPy community since January, where I have made several contributions. Here is a summary:

4. ME AND THE PROJECT

4.1 What do I want to achieve? What excites me about this project? Why did I choose it?

I've chosen this project because it perfectly aligns with my interests in Image Processing and Astronomy. I'm enthusiastic about expanding my expertise in Python and exploring the intersection of image processing with astronomy. This project offers an excellent opportunity for me to gain practical experience and skills in these areas. My main goal is to address the issues outlined in the project description on GitHub. I'm dedicated to thoroughly testing all functionalities of the sunkit-image library and identifying and working on any additional issues that may arise. Alongside addressing known issues, I'm keen on resolving further issues that I’ve found interesting while getting started with the library. Although sunkit-image is currently a relatively small library with limited functionalities, I see significant potential for growth. Given the rapid integration of computer vision and machine learning methods into scientific research, there's an opportunity to expand the library's capabilities. If I complete the project ahead of schedule or perhaps after GSoC period, I intend to collaborate with mentors to explore avenues for extending the library's features and implementing new functionalities that can enhance its utility in machine learning pipelines. Throughout this journey, I'm committed to seeking guidance from mentors and collaborating with the community to ensure that any additions or modifications to the library align with its goals and objectives. I'm excited about the opportunity to contribute to the advancement of scientific research through the development of innovative tools and resources.

4.2 Why am I suited to work on this project?

As previously mentioned, my experience in both Python and image processing equips me with a solid understanding of the challenges that may arise during development. This familiarity enables me to anticipate and address potential issues efficiently. My ongoing engagement with the community has deepened my connection to this organization, and I am fully committed to contributing meaningfully to its success. I am dedicated to delivering the project to the highest standards, and I am prepared to invest the necessary time and effort to achieve this goal. If required, I am willing to work beyond the assigned time to ensure that the project is completed to the best of my ability. My goal is to produce a final product that meets or exceeds expectations, contributing positively to the organization and its community.

4.3 What have other people done on this idea?

I will try to list in detail previous attempts in resolving the issues in concern: *Declass ASDA #42: Two pull requests have been made, one by me and another closed pull request from last year.

  • Clean up sunkit_image.trace API #134: Work was done last year, including making some modules private
  • ASDA has no gallery example #45: No previous work on this task
  • Refactor the coalignment module #83: Partial work done by making some modules private
  • Add a coalignment example to the gallery #103: No previous work on this task
  • Add persistence transform example to the gallery #76: No previous work, only a closed pull request
  • Failing test test_multiscale_gaussian #96: No previous work on this task
  • Figure out what from SunPy core can be moved here #5: No previous work on this task

4.4 How do I plan to implement the project?

While I have a clear understanding of what needs to be changed, the exact details of how these changes will be implemented are still to be determined. I plan to thoroughly examine each task and delve into the specifics to ensure a comprehensive approach.

4.4.1 Declass ASDA #42

I’ve implemented most of this task and edited all files and tests to correspond to the change. However, I intend to implement a method to create a new higher level function that does all the steps as suggested by nabobalis.

4.4.2 Clean up sunkit_image.trace API #134

Most of this task was handled before. However, I’ll still take a more thorough look to clean up the file. A note that immediately comes to my mind is the bad naming, they’re somewhat not indicative of what they hold(very short). Furthermore, some functions seem to be unrevised, for example ‘_loop_add’ requires a parameter that is not used which is ‘zloop’. A revision of the module would suffice.

4.4.3 ASDA has no gallery example #45

After declassing ASDA, it's evident that a significant portion of the examples containing ASDA will require revision and restructuring. Additionally, the existing gallery example lacks coverage of most of the methods provided in ASDA. Therefore, it's clear that substantial additional work will be necessary to update and enhance the gallery example to reflect the full range of functionalities offered by ASDA. A good demo is provided by the code implemented by the authors of the paper in the repository displayed by them.

4.4.4 Refactor the coalignment module #83

The coalignment module is currently experiencing several issues, including a recent bug report (issue #186) highlighting its inability to handle data other than SDO data. Addressing these issues requires a more comprehensive approach, including refactoring the module and conducting in-depth analysis of the references upon which it was implemented. Another issue is relevant to this issue which requests a new alignment function which might be worth resolving. Furthermore, the module is somewhat over modularized, in the sense that most private methods are only used once, whilst other methods are redundant, for example ‘match_template_to_layer’ which doesn’t offer anything new and it’s only used in a private method. Another function that is questionable is ‘_calculate_shift’ which only calls ‘_find_best_match_location’ and is used only once. Other methods should also be revised(‘_clip_edges’). The over modularization somewhat reduces the performance of the module. Similar to the suggestion in asda, I think it would be a good idea to make a higher level function that does the overall functionality to offer better usability.

4.4.5 Add a coalignment example to the gallery #103

At present, the gallery lacks comprehensive examples for the coalignment module. Following the refactoring of the coalignment module, my priority will be to create a concise example that effectively illustrates how to utilize its functionalities. This example will serve as a valuable resource for users, providing clear guidance on how to leverage the capabilities of the module in practice. The current gallery misses documentation of the following existing methods : calculate_solar_rotate_shift, mapsequence_coalign_by_rotation, apply_shifts, match_template_to_layer.

4.4.6 Add persistence transform example to the gallery

There’s been previous attemptsto add a persistence transform example to the gallery. However, this draft needs to be extended; it's not informative to the user and could use further work on it. The previous attempts have been implemented using this paper as a reference. I plan on picking up this pull request and seeing what might be missing.

4.4.7 Failing test test_multiscale_gaussian #96

I'm encountering difficulties replicating this issue locally. Thus before doing anything I will make sure that the test still fails on the CI. After ensuring that the error happens online I will conduct a thorough debugging process, it's essential to recreate the exact environment on the CI. This will provide a clearer understanding of the problem and facilitate easier debugging. It's worth noting that this issue resembles another problem I've encountered locally, where a test fails on my local environment but passes on the CI. By replicating the CI environment locally, I can investigate both issues concurrently and identify any underlying similarities or differences.

4.4.8 Figure out what from SunPy core can be moved here #5

When considering the relocation of SunPy methods into sunkit-image, some files and methods stand out, including:

  • Image directory in SunPy contains only basic image processing techniques. Currently I think that it should remain in SunPy due to the fact that it doesn’t really fit the goals of sunkit-image.
  • Some gallery examples in SunPy documentation should be moved to sunkit-image, but one could argue that they should be left in SunPy documentation since it’s more popular. Ex.:
    • Computer Vision Techniques examples: “Edge Enhancing Coronal Loops”, “Enhancing off-disk emission”, “Finding and masking bright pixels”, “Masking out the solar disk”. However, further discussions should be held to figure out if anything else should be moved.

4.4.9 Extra Issues

There are multiple issues that are reported on GitHub that I would like to pick up after finishing the core project. Including the following:

  • Add limb darkening correction #68: Multiple uncompleted attempts have been directed to try to resolve this issue. I intend to have a look at them and complete the issue. A large portion of this issue has already been implemented before in this pull request. I plan on picking up the pull request and completing it.
  • Soft morphological filtering of solar images #10: This issue is very interesting. The proposed algorithm filters out cosmic rays using morphological operations. Filter optimization is achieved using a genetic algorithm approach. However, there’s already an example that demonstrates how to remove cosmic ray hits. Which can be added to the example gallery instead of implementing the feature. If the implementation of the feature is still needed I will work on it.
  • STARA Sunspot detection #37 : The method proposed in the linked issue is somewhat similar to issue #10 since it also relies on morphological operations. However, newer papers propose different methods for example a more rigorous approach is proposed in this paper which relies on edge detection techniques. Even newer methods rely on CNNs. Measured accuracies are only stated for the CNN method which achieved 99.71% accuracy. Before deciding which algorithm to implement I will make sure to get approval from the mentors. However, most probably I will stick to the algorithm suggested in the issue. @cadair already implemented the algorithm, I think it’s a good step to build on it. I intend on implementing the aforementioned algorithms with their examples and tests once I finish the core project even if the implementation extends beyond the available time for GSoC. However, As shown most of these issues only need finalizing which shouldn’t take a lot of time.

4.5 If it involves any API changes, how does it affect the user?

Multiple parts of the project do affect the API, hopefully making it better. Tasks that might change the API are the following:

  • Declass ASDA #42
  • Clean up sunkit_image.trace API #134
  • Refactor the coalignment module #83
  • Figure out what from SunPy core can be moved here #5 I will ensure that any change will only enhance the user’s experience.

5. SCHEDULE

A couple of notes concerning the schedule:

  • I've organized the development process into two phases: one dedicated to development tasks and the other to documentation, to ensure that any feedback or additions will be finalized by the time of writing the examples.
  • I've set aside some extra time towards the end to address any feedback from mentors.
  • I will make sure to document progress biweekly by providing blogs.
  • My exams finish on the 13th of June which is when I will officially start contributing.
  • If I managed to finish before the estimated deadline, I plan on resolving further issues.
  • I’ve dedicated the last 2 weeks to finalize and review all past issues.
  • I will be fully dedicated to the project throughout the schedule.
  • If I manage to get ahead of time of the schedule I will further resolve issues.

May 1 - 26

  • Community Bonding Period
  • Light contributions.
  • Further understanding of the project.

WEEK 1

  • Meeting mentors. Discussing the project implementation in detail and erasing any confusion that I might have.

WEEK 2

  • Break due to exams

WEEK 3

  • Reviewing feedback
  • Finalizing issue #42.
  • Woking on issue #134 concerning cleaning up sunkit_image.trace API

WEEK 4

  • Reviewing feedback
  • Working on issue #83 (Refactor the coalignment module)

WEEK 5

  • Reviewing feedback
  • Woking on issue #5 concerning figuring out what from SunPy core can be moved to sunkit-image
  • Working on issue #68 by completing the pull request 6

WEEK 6

  • Reviewing feedback
  • Resolving failing test test_multiscale_gaussian (issue #96)
  • Adding a gallery example for ASDA (issue #45)

WEEK 7

  • Reviewing feedback
  • Adding a coalignment example to the gallery(issue #103)
  • Extra issues
  • Midterm evaluation

WEEK 8

  • Reviewing feedback
  • Adding persistence transform example to the gallery
  • Extra issues

WEEKS 9-10

  • Reviewing feedback
  • Revising past work
  • Performance profiling
  • Extra issues.

WEEKS 11-12

An iterative process of

  • Reviewing feedback
  • Finalizing all past issues
  • Final evaluation
Clone this wiki locally