Weeks 7 & 8: Making Spectrograms a Little Easier to Work With

Making Spectrograms a Little Easier to Work With

Another couple of weeks have gone by and it's been a mix of writing code, responding to reviews and learning more about the radiospectra codebase.

Compared to the first few weeks, I spent less time figuring out where things lived and more time thinking about how people actually use the library. That shift has been really fun because even small improvements can make a noticeable difference for users.

Cropping, but Simpler

One of the things I worked on was making it easier to crop spectrograms.

The functionality already existed through ndcube, but it wasn't something you could immediately discover if you were new to the library. So I added two convenience methods:

  • crop_time()
  • crop_freq()

They're fairly small additions, but they make common workflows much nicer.

Instead of digging into the underlying API, you can now crop directly using the quantities you already have.

Time Cropping



Frequency Cropping


Frequency + Time Cropping



Playing Around with Slicing

After finishing the cropping work, I started experimenting with slicing.

Since GenericSpectrogram inherits from ndcube, slicing "just works", but what I found really cool is that it keeps all the coordinate information intact.

That means extracting useful data becomes surprisingly simple.

Want to see how the intensity changes over time at a particular frequency? That's just a time profile.

Or maybe you want to look at the spectrum at a specific instant? That's a line profile.

It was one of those moments where I stopped thinking "this is another feature" and started thinking "this is actually really nice to use."




Reviews, Reviews... and More Reviews 😄

A good chunk of these two weeks was spent going through review comments.

At first, I used to think reviews were mostly about fixing mistakes. Now I realize they're often about finding cleaner ways to solve the same problem.

Some comments were tiny, others led to bigger discussions about API design and a few even made me rethink parts of the implementation altogether.

It's probably been one of the most valuable parts of GSoC so far.


What's Next?

I'm now starting to look at some of the bigger architectural changes in radiospectra, especially around the metadata factory and how instruments parse their data.

There's still quite a bit to explore, but I'm excited to keep building on the work from the past few weeks.


That's all for this update!

Thanks to my mentors for all the helpful feedback and discussions. Every review teaches me something new and I'm looking forward to sharing more progress in the next blog post.