https://github.com/simonsobs/websky_model
Implements the data model for the websky simulation suite.
https://github.com/simonsobs/websky_model
Last synced: 8 months ago
JSON representation
Implements the data model for the websky simulation suite.
- Host: GitHub
- URL: https://github.com/simonsobs/websky_model
- Owner: simonsobs
- Created: 2019-02-01T19:20:03.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-08-26T17:40:51.000Z (almost 5 years ago)
- Last Synced: 2024-12-27T04:25:39.312Z (over 1 year ago)
- Language: Python
- Size: 19.5 KB
- Stars: 2
- Watchers: 19
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Websky Models
websky_models is a python library for dealing with websky maps and halo catalogues
Some functionalities require healpy or astropy. astropy is only used if comoving distance to redshift calculations required for halo catalogue (if zmin/zmax are used for halo catalogue, or practical=True). Should work without astropy installed if not using these.
## Usage
```python
import numpy as np
import websky_model as wm
# load model
wmodel = wm.WebSky(directory_path='/global/project/projectdirs/sobs/v4_sims/mbs/websky/data/',websky_version = 'v0.1', verbose=True)
# read in halo catalogue
hcat = wmodel.load_halo_catalogue(mmin=0, mmax=np.inf, zmin=0, zmax=np.inf, rmin=0., rmax=np.inf, practical=True)
# project halos onto healpix map.
# each halo is given a "flux" of weight=constant, or weight=array(len(Nhalo))
hpmap = wmodel.catalogue_to_map(hcat, nside=512, weight=1)
# get cib map filename
fname_cib = wmodel.cib_map_file_name(freq='545')
# get kappa map filename
fname_kappa = wmodel.kappa_map_file_name()
# get compton-y map filename
fname_comptony = wmodel.comptony_map_file_name()
```