Line-of-Sight Structure-Enhanced Ray-Tracing Halos Rendering for External Convergence and Shear - #64
Conversation
Some bugs still need to be fixed
with documentation, jupyter sample, test function.
Create a utility function that handles default parameter and then modify the other functions to use this new utility function.
1. update Jupyter notebook with the computing gamma and kappa 2. change yml file to make it run quicker for debug(will change back) 3. add halos_len.py with Class HalosLens() in it and def concentration_from_mass() in it.
1. **halos_lens.py**:
- Introduced `get_kappa_gamma_distib()` for computing the kappa and gamma_tot values from the list.
- Implemented running time tracking for performance analysis.
2. **halos.py**:
- Added running time metrics for enhanced performance tracking.
3. **Notebook Renaming**:
- Renamed `get_halos.ipynb` to `halos_rendering.ipynb`.
4. **halos_rendering.ipynb Enhancements**:
- Added `kappa_gamma_distribution` for visualizing the joint distribution of kappa-gamma_tot.
- Introduced visualizations to showcase the distributions of the modified kappa and gamma values from halos using histograms.
- Incorporated KDE functionality for generating random samples of `kappa_halos` and `gamma_halos`.
5. **Data Files**:
- Added `kgdata.npy`: Weak-lensing maps sourced from GLASS with n=128 (z=5). (better try other way to upload)
- Introduced `z5data.npy`: Weak-lensing maps from GLASS with n=2048 (z=5).
6. **halos_plus_glass.py**:
- This script fuses several functions to produce the joint distribution of kappa and gamma values leveraging both halo and GLASS data.
a. **Glass Data & Sample Generation**: Utilized `read_glass_data` to extract kappa and gamma values from the Glass data file. Implemented `skyarea_form_n` to deduce the corresponding sky area for each pixel. Employed `generate_samples_from_glass` to fit a Gaussian KDE to the joint distribution and generate a random sample.
b. **Halo Data & Sample Generation**: Applied a Gaussian KDE to derive the joint distribution and presented a hexbin plot visualization.
c. **Combining Halo and Glass Data**: Invoked `generate_halos_multiple_times` to repeatedly generate kappa and gamma values from halos. Subsequently, merged the halo and Glass data samples with the `halos_plus_glass` function.
7. **glass_convergencen_shear.ipynb**:
- A dedicated notebook to import data from GLASS and facilitate its visualization.
8. **glass_plus_halos_rendering.ipynb**:
- This notebook illustrates the process of deriving kappa and gamma values from both halo and GLASS sources. It also demonstrates the method to visualize the combined kappa and gamma values' joint distribution.
----------------------------------------------------------------------
If there are no issues with these codes and the underlying physics, I will generate weak lensing maps for add different values of z and add test function next.
1. debug: including debug about the position sample (of disk); halos mass's resolution and others. 2. improve: add/improve some methods and improve the docstring. 3. The results should be more realistic now.
1.make a duplicate of Skypy halos branch and make a read.me for credits statement 2. Optimize the project. (mulitprocess & numpy vector operator) (still some room for improve)
(optimized code)
For passing the test
1. add test function for Halos 2. rename file name halos ---> Halos 3. move the jupyter notebooks to the notebook folder 4. debug of halos_plus_glass.py () 5. give proper attribution for the code copy from Skypy (as once it is in the main branch or release version of SkyPy, that this code becomes deprecated) @sibirrer
For tqdm
1. add def run_halos_without_kde_by_multiprocessing() as it can help improve halos rendering when n_iterations is large. 2. debug
1.Add test for new method 2.delete unnecessary duplicate from Skypy 3.move pipeline test file 4.minor change on the markdown of a jupyter notebook
Test function and documentation are on the way.
still need further look of what went wrong.
1.deg2_to_cone_angle debug 2.add a test function
1.add test for cone_radius_angle_to_physical_area() 2. will update documentation and complete test functions in the furture.
1, Make the negative mass in the mass sheet correction uniformly distributed within the light cone according to the halo mass function, rather than keeping it at the same redshift as the generated halos. 2,Address the issue in the code when the number of generated halos is too small, causing N to be equal to zero.
|
@sibirrer good for code review |
|
@sibirrer the notebook is updated, good for further reviews. |
| @@ -2,8 +2,13 @@ | |||
| "cells": [ | |||
There was a problem hiding this comment.
sibirrer
left a comment
There was a problem hiding this comment.
Looks great @trivialTZ! I have one request to remove one notebook from the PR and then we can merge it
|
@nkhadka21 from my side, TZ's PR is ready to be merged (modulo the minor conflict that will be resolved). Can you look through the files and see whether there are any issues or requests? Thank you! |
|
@nkhadka21 this pull request is good for reviewing, thanks! |
nkhadka21
left a comment
There was a problem hiding this comment.
Hi @trivialTZ , thank you very much for this wonderful work! Code is very well documented. I have a very minor comment that you can address. It looks good to me and I approve this PR.
|
|
||
| path = os.path.dirname(slsim.__file__) | ||
| module_path, _ = os.path.split(path) | ||
| if skypy_config is None: |
There was a problem hiding this comment.
You have given default sky area below but It would be good to mention the default sky area here.
Line-of-Sight Structure-Enhanced Ray-Tracing Halos Rendering for External Convergence and Shear
Description:
This pull request introduces an enhancement to the ray-tracing halos rendering mechanism. It incorporates both large-scale structures using GLASS and small-scale structures via the halo mass function.
Key Features:
Skypy_halos_duplicate.Next Steps:
Testing and Documentation:
Incorporate$\kappa_{ext}$ Correction:
This will ensure a more accurate representation and calculation in our rendering mechanism.
Acknowledgements:
We kindly request a review of this feature, and are open to further feedback and suggestions.