swagnercarena / paltas

Conduct simulation-based inference on strong gravitational lensing systems.
MIT License
13 stars 12 forks source link

Allow negative ssub/delta_los #13

Closed JelleAalbers closed 2 years ago

JelleAalbers commented 2 years ago

This allows sigma_sub and delta_los to take on negative values. If they do, the substructure generation code will treat them as zero.

I tested this by making a 200k image dataset with sigma_sub drawn from Normal(loc=0.17e-2, scale=0.12e-2) (with power spectrum pivot point at 1e10 Msun) amd delta_los drawn from Normal(loc=1, scale=0.7). Negative values were indeed generated. I didn't commit these changes to the config, since we'll probably want to adjust the parameters to have slightly fewer samples at 0 (now it's roughly ~15%).

I also added a small unrelated thing to generate.py, to have it copy the config file out to the generated dataset. Feel free to remove / change.

swagnercarena commented 2 years ago

Added a quick test, but the code looks good.