Add multi-frequency support to HealpixMap and SphericalHarmonics#496
Add multi-frequency support to HealpixMap and SphericalHarmonics#496
Conversation
|
I think the PR is substantially ready; the only thing left is to decide how to handle |
There was a problem hiding this comment.
It seems ok to me! I see you did not touch the I/O code, but this probably deserves some discussion. We might put an error if you try to read or write a multi-frequency object for the time being and address the issue in a separate PR, what do you think? In this way people can start using the feature while we figure out what is the best format (multiple files? one single huge FITS file for all the frequencies?)
Edit: Sorry, I just saw your comment:
I think the PR is substantially ready; the only thing left is to decide how to handle
write_fitsandread_fitsinSphericalHarmonics
| from dataclasses import dataclass, field | ||
| from pathlib import Path | ||
| from typing import Any, Literal | ||
| from typing import Any, Literal, Sequence |
There was a problem hiding this comment.
I just learned the existence of Sequence in typing!
There was a problem hiding this comment.
Same here.. Claude's suggestion..
|
Hi @ziotom78, I opted for a sort of hybrid solution. The code can save FITS files in the multifrequency case, but you need to specify which frequency you want to save. |
Oh, sure, this is the simplest and cleanest solution! |
This PR adds multi-frequency support in
maps_and_harmonics.py. In detail:HealpixMapandSphericalHarmonicsclasses to handle multiple frequencies via newfrequencies_ghzandnfreqsattributes.maps_and_harmonicsandinput_skymodules.In addition,
input_skynow accepts an external array of frequencies, returning maps or shperical harmonics packed in a single instance ofHealpixMaporSphericalHarmonics.