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

Update modules #27

Merged
merged 12 commits into from
Sep 26, 2023
Merged

Update modules #27

merged 12 commits into from
Sep 26, 2023

Conversation

AndreasTersenov
Copy link
Collaborator

Added bookkeping functions to the slics.py module, updated the notebook so that it uses the functions from the modules & tested it. Addresses part of issue #6 .

Copy link
Collaborator

@lbaumo lbaumo left a comment

Choose a reason for hiding this comment

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

let's try to clean up the SLICS module a bit

from lenspack.starlet_l1norm import noise_coeff, get_l1norm_noisy
from astropy.stats import mad_std
from scipy import ndimage as ndi

def create_kappa_map(ra, dec, g1_sim, g2_sim, size_x_deg=10, size_y_deg=10, pixel_size_emap_amin=0.4):
Copy link
Collaborator

Choose a reason for hiding this comment

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

break this up into a binning function and a mass mapping function

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, I'll do that. Then we will have only the binning function in the module, since the mass mapping itself is done by ks93 from lenspack.

Copy link
Collaborator

Choose a reason for hiding this comment

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

we could have a wrapper function that then calls the binning function and the mass mapping function

sp_peaks/slics.py Outdated Show resolved Hide resolved
sp_peaks/slics.py Outdated Show resolved Hide resolved

return data

def read_SLICS_cosmo_params(file_path):
Copy link
Collaborator

Choose a reason for hiding this comment

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

i'd modify this function to look more like "read_catalog"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The file that is to be read by this function is a .dat file (CosmoTable.dat) and I think it cannot be read with ascii.read(), so I could only do it like this. There should however be a better way to do this, I just don't know it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

i just tried ascii.read() for the .dat file and it works. make sure you include from astropy.io import ascii

example/master_file.txt Outdated Show resolved Hide resolved
example/#master_file.txt# Outdated Show resolved Hide resolved
@AndreasTersenov AndreasTersenov merged commit a8c5935 into CosmoStat:develop Sep 26, 2023
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.

2 participants