Add Cosmoglobe DR2 model - #56
Conversation
MetinSa
left a comment
There was a problem hiding this comment.
Happy to see that the cosmoglobe model is finally being added here! Well done 😊
I left a comment regarding the difference between the DIRBE values seen here and in the paper.
You should also run the ruff linter on the project and the tests (See the readme for how to do that).
Additionally, you should update the docs/ and include the cosmoglobe model as one of the available models in zodipy.
And finally, once the PR is merged we need to publish a new version of cosmoglobe to PIP.
You should request a review from me again when the tests run green and your are happy with the PR. Feel free to ask if there is anything you need 😄
| x_0=0.0119, #AU | ||
| y_0=0.00548, #AU | ||
| z_0=-0.00215, #AU | ||
| i=2.03, #degrees | ||
| Omega=77.7, #degrees | ||
| n_0=1.13e-07, #AU^-1 | ||
| alpha=1.34, | ||
| beta=4.14, | ||
| gamma=0.942, | ||
| mu=0.189, |
There was a problem hiding this comment.
Im aware that these values slightly differ from the values presented in the K98 paper. I found these values by reading the DIRBE source code which was sent to us at some point and decided to use these more spesific values instead. But given the uncertianties in the model I dont think it matters much. But if using these "rounded" values significant change the end results we should consider adding a new DIRBE model instead with these values so for backward compatibility.
|
@angela-bonato any updates here? 👀 |
|
Thank you for the inputs @MetinSa and I'm sorry for not answering before. I'm on it now and I think in a couple of days I will be able to fix it and let you revise it. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #56 +/- ##
===========================================
- Coverage 100.00% 99.48% -0.52%
===========================================
Files 14 14
Lines 708 782 +74
===========================================
+ Hits 708 778 +70
- Misses 0 4 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I ran the tests listed in the README and fixed those. Then I changed the documentation to add in the list of available models the new one, I don't think there is something else that needs to be updated. For the DIRBE model I changed the parameters values to match those in the main branch. The difference between using them or the values listed in the original K98 paper is about 0.5% so I think we can just keep what goes with the current tests. There are coverage issues that I am not sure how to fix. My understanding is they might be caused by the fact that maybe additional tests specifically written for the new model are expected, or maybe I just got something wrong when using the DIRBE model as a basis to write the Cosmoglobe model, but in any case I need help with those. |
|
The coverage should probably not be a blocker so I will disable it when I get to work. Looks good otherwise! Have you tested and seen if it reproduces commander over the dirbe bandpasses for instance? |
|
No, I haven't. Do you mean like taking the difference between the zodi moldel as fitted by Commander and the one simulated by Zodipy in all the bands or is there something more sophisticated I could do? |
Yeah. Produce a zodi map in zodipy with the new cosmoglobe model using one of the dirbe bandpasses and compare it to the corresponding zodi map from the commander run (for instance band 6). If its "close enough" we know that the model in zodipy is doing what we want it to do. |
|
Regarding the code coverage, we should add a new coverage:
status:
project:
default:
informational: true
patch:
default:
informational: trueCould you try that and see if it stops failing the checks? |
|
How are you specifying the spacecraft coordinates when performing the zodipy sim? In commander i believe there are some optimizations where a cache is used to reuse certain zodi evaluations if the spacecraft has moved less than some fraction on the sky. Zodipy will perform the actual evaluation per specified sky coordinate. If you could post the zodipy code that would be useful |
|
Ths is a script that Duncan gave me to produce mission averaged maps and I just adapted it to my needs. |
|
I suppose you don't have the zodi timestream from commander? If you do I would have tried to bin those in the same loop to validate that the binning isn't the issue. And maybe look at them in the time domain for comparison aswell. Also, if you want this script to be a bit faster and have enough ram, you could reconstruct the full Lon lat array for the whole 285 days and do a single zodi evaluation. Alternatively do each scan like you do now but multiprocessed. Zodipy also supports an obstime per pointing (the obstime can be an array of times) so you wouldn't have to pretend that the spacecraft sits still for a full day before jumping a full degree like you do here. That would give you a more accurate zodi map when comparing with Tod's (if that's relevant). I'm not sure how the obstime/obspos is solved in commander but it probably doesn't account for the full diff anyway. |



In the latest version of the Cosmoglobe Data Release 2, the zodiacal light model uses the parametrization of Kelsall et al. (1998) with the phase function from Hong et al. (1985). For this reason, I added a new model in zodipy called "cosmoglobe" which features the parametrization and the best-fit parameters derived from the DR2 analysis. I also set the parameters of the existing zodipy "dirbe" model to those listed in Kelsall et al (1998).
I was able to successfully run the new models and produce plots and maps with them, but I have not yet updated the test functions or the documentation. This still needs to be done.