Skip to content
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

Radio excess from ACG, MCG and PBH #297

Open
wants to merge 127 commits into
base: master
Choose a base branch
from

Conversation

Junsong-Cang
Copy link

Added excess radio background from: 1. Atomically cooled galaxies (ACG), 2. Molecularly cooled galaxies (MCG or minihalo), 3. Accreting PBH. Feature for Hawking radiation also included.

Junsong-Cang and others added 22 commits September 25, 2022 10:27
…e, Tools.py reads parameters from a ini file, *ini are inut files
…dded to TsBox to store T_Radio and previous snapshots
…gnore all previous commits fot inputs.py (and possibly outputs.py)
…test version of output.py seems to be very different from the version I used, so I added caching tools for Radio Temp box and SFRD_box here manually
Copy link
Member

@steven-murray steven-murray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @JSC42, this is a very cool set of features! I am far from understanding the code/physics, but I do have a few suggestions (other than the few comments I left). The two big things that I think need to be done in this PR are:

  1. The new stuff should all be made optional via one or more FlagOptions which are by default set to False.
  2. You should add one or more integration tests to the suite with these options turned on.

Something else to think about, maybe for @BradGreig / @qyx268: since there are so many parameters for this feature, would it be reasonable to admit another separate parameter struct? Eg. PBHParams? It would be annoying to implement this currently, because so many of the functions take in the four parameter structs, and this would have to be added everywhere. But this could also force us to be a bit more systematic in how we manage this, and open up the possibility of adding extensions more easily in the future.

Another thought: would it be possible to make the main part of this new calculation a new C function entirely, that takes in an IonizedBox and/or TsBox and computes the TradBox (optionally)? That would keep things a little more modular.

Comment on lines 42 to 49
for (i = 0; i < user_params->HII_DIM; i++)
{
for (j = 0; j < user_params->HII_DIM; j++)
{
for (k = 0; k < user_params->HII_DIM; k++)
{
*((float *)v + HII_R_FFT_INDEX(i, j, k)) = perturb_field->velocity[HII_R_INDEX(i, j, k)];
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I like this style here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FlagOptions are added for all the new features (USE_Radio_ACG, USE_Radio_MCG, USE_Radio_PBH, USE_Hawking_Radiation), defaults are set to False

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I was using VS codes so the styling of BrightnessTemp.c is set by VS auto-indentation, anyway I will revert the code indentation style back to the original version

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reverted BrightnessTemperatureBox.c to the original indentation style

// Debuging options, print out gas temp and SFRD box, I am gonna keep these
#define print_SFRD_box 1
#define Reset_Radio_Temp_HMG 0
#define debug_mode 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might not need this since we have LOG_DEBUG etc.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might actually be more convenient to keep the print_SFRD_box feature, this is used to print out huge arrays to a file. Using other original debug features (e.g LOG_DEBUG) will also turn on a bunch of other debug infos that are irrelevant for the new features

// Re-write of find_HII_bubbles.c for being accessible within the MCMC
// Note for JSC: Anything that begins with Radio or Hawking are my modules
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe calling the module "JSC" isn't the best idea for the long-term. Could we call it something more meaningful?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the JSC signatures in previous PR has now been removed

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and the JSC.h has also been renamed as RadioExcess.h

@codecov
Copy link

codecov bot commented Sep 30, 2022

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (41de3c4) 86.53% compared to head (0b9dfaa) 86.45%.
Report is 174 commits behind head on master.

❗ Current head 0b9dfaa differs from pull request most recent head c2b72eb. Consider uploading reports for the commit c2b72eb to get more accurate results

Files Patch % Lines
src/py21cmfast/outputs.py 50.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #297      +/-   ##
==========================================
- Coverage   86.53%   86.45%   -0.09%     
==========================================
  Files          12       12              
  Lines        2807     2812       +5     
==========================================
+ Hits         2429     2431       +2     
- Misses        378      381       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@qyx268
Copy link
Contributor

qyx268 commented Sep 30, 2022

@steven-murray yeah I agree. I'm also reviewing another work (although I'm not sure when if ever we will merge it into the master), which has introduced 11 new astro parameters and another 11 new flags... The developers were in fact including all astro parameters in UserParams, which py21cmmc cannot cope with. I agree a long term solution will be allowing new classes to be added for new and distinct features such as radio source / dark matter...

For short term, they have to be put in astro_params if they are not affecting InitialConditions...

…ninitialised memory so an additional line is added to Ion.c
…inter can have mem issue that I cannot solve
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants