sunkit-spex icon indicating copy to clipboard operation
sunkit-spex copied to clipboard

Add albedo correction

Open samaloney opened this issue 2 years ago • 9 comments

Describe the feature

A few people have been asking if we have implemented the albedo correction similar to OSPEX

Proposed solution

No response

samaloney avatar Nov 09 '23 14:11 samaloney

I think that would be an excellent addition. I believe OSPEX implements it as a “pseudo-model” but it shouldn’t be too hard to add if we look up the proper equations.

settwi avatar Nov 09 '23 16:11 settwi

This has been on my to-do list for a while, I've just never been able to get around to it properly.

I think OSPEX does it via altering the response matrix before the fit and I think the main files to look at are drm_albedo.pro and drm_correct_albedo.pro (found here with some description).

Instructions on how the user interacts with this in OSPEX and some history is here.

KriSun95 avatar Nov 10 '23 00:11 KriSun95

Yea those sav files are nightmare fuel do we have any idea how they were generated? @KriSun95 I think you are correct about the current implementation/approach here's the relevant paper but not clear if that the best way or have a model chain physical-model->albedo-model->SRM

samaloney avatar Nov 10 '23 10:11 samaloney

@samaloney, I think your idea of physical-model->albedo-model->SRM makes more sense to me. I don't like the idea of editing the response any more than we really need to while having the correction as a model will help keep things transparent and make it easier to apply to different data too, I'd imagine.

KriSun95 avatar Dec 07 '23 16:12 KriSun95

For RHESSI the albedo correction is included as part of the DRM, the logic being that it's not the observed spectrum I_O you want to fit but the emitted I_E where I_0=I_E + I_A. At the GX_SIMULATOR meeting and found out Edward/Gelu have implemented the Albedo correction as an addition to the model spectrum so we should be able to use the same approach https://github.com/Gelu-Nita/GX_SIMULATOR/blob/d772a411705ceed9db2a5b6eadfa14cd5dda190f/userslib/xray/xray_tt_albedo.pro

samaloney avatar Feb 28 '24 20:02 samaloney

Green function matrices are now available in JSON format (also as IDL SAVE files) https://github.com/edkontar/albedo

edkontar avatar Sep 10 '24 17:09 edkontar

@edkontar thanks, Eduard! this will be very useful for albedo corrections going forward.

would you like to help implement the corrections in Python?

settwi avatar Sep 11 '24 00:09 settwi

would you like to help implement the corrections in Python?

Yes, I would be happy to help

edkontar avatar Sep 11 '24 08:09 edkontar

I have a draft PR open which uses the sav files from SSW in #161

What we eventually need is the ability to generate the "green's matrices"

samaloney avatar Sep 12 '24 11:09 samaloney