-
Notifications
You must be signed in to change notification settings - Fork 3
Fix bug that causes all X-ray bands to have the same value #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This should detect the bug that's causing all xray bands to contain the same value in the output.
|
The affected properties were Xraylum , Xrayphlum , Xraylum_no_agn and Xrayphlum_no_agn. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am runnig the z=0 Jets box atm. We also need to merge the chages in this other branch: https://github.com/jchelly/SOAP/compare/master...SWIFTSIM:SOAP:flamingo-v2 |
|
@jchelly @MatthieuSchaller. Runnig the script halo_properties_L1000N1800.sh, which calls compute_halo_properties.py failed for the Jets run with the following message: |
|
That has been caused by the check I put in to prevent further bugs like this one. The calculation can fail if it turns out too small a region was read in, in which case it returns None and it shouldn't try to verify the dimensions of the result. I thought I dealt with that case, but apparently not. I'll take another look at it. |
|
I think I just missed a "if val is not None" in the subhalo properties case. |
|
Thanks John. Jaime, could you test it once more? |
|
Ah wait, looks like no changes were actually made in the branch. Just an analysis of what went wrong. |
|
@jemme07 could you open a separate pull request with the changes you mentioned above? |
|
Yes, sorry, I looked at it a bit more and wasn't 100% sure where those None values were coming from so I haven't pushed a fix yet. I'll take another look at it now. |
|
I think the Nones actually come from halos which have no particles of some type. That doesn't change the fix though. |
I alread have. It is here: https://github.com/jchelly/SOAP/pull/19 |
|
It is all working now. I tested it with the HYDRO_STRONG_JETS model. The z=0 SOAP catalogue is temporarily stored here: Once I have write permissions in the FLAMINGO data directory I'll copy it over. |
I don't understand. If this is missing in the main version then we should merge here not in John's version. We should really try to keep a single maintained official version otherwise we gonna have confusion about what to run. |
|
Thanks for checking it all works. I'll accept. |
For each halo the code needs to sum the X-ray luminosities of the relevant particles. These luminosities are recorded in multiple bands so they're stored in a 2D array indexed as [particle_index, band_index]. The code was calling np.sum() on this array which returns a single, total luminosity. Numpy then broadcasts this scalar back to an array when we store the result.
This pull request adds some asserts to catch this type of bug in future and corrects the calculation to only sum over the particle axis of the 2D luminosity array.