BrownDwarf / gollum

A microservice for programmatic access to precomputed synthetic spectral model grids in astronomy
https://gollum-astro.readthedocs.io/
MIT License
20 stars 5 forks source link

Resolution and save grid? #102

Open cosmicbabs opened 6 months ago

cosmicbabs commented 6 months ago

Hi! This is not an issue but a question:

I'm working with very low-res spectra. I was checking the code, and I saw that I could request the PHOENIXGrid with an X resolution using the instrumental_resolution parameter:

grid = PHOENIXGrid(teff_range=(3500, 3600), logg_range=(4.5, 5.0), Z_range=(-0.5, 0.0), wl_lo=wl_lo, wl_hi=wl_hi, instrumental_resolution=100)

This, of course, takes longer to be completed. Can I save the grid so I can call it in another notebook? How do I do that?

Thanks!

Sujay-Shankar commented 6 months ago

This is a great question and definitely something that we're considering as a feature, the serialization of PHOENIXGrid objects. While this behavior isn't in gollum natively yet, off the top of my head I can suggest pickling the PHOENIXGrid object using the pickle library or the %store magic in Jupyter notebooks (which also pickles). I cannot guarantee that this works, but at the current time this is the only way I can think of to do what you suggest. Hopefully in the near future we can push out a PHOENIXGrid that supports the user's ability to save grid variants to disk.