Giter Site home page Giter Site logo

clmassmod's Introduction

CLMassMod

Code of Conduct

Contributing

Getting started:

python setup.py develop

Currently, to use the Diemer+Kravtsov M-c relationship, CLMassMod also requires a separate installation of Benedikt Diemer's code, colossus: https://bitbucket.org/bdiemer/colossus

Description

A galaxy cluster weak-lensing mass modeling and verification code

This repository documents the work done within the SPT-WL working group and the LSST DESC Clusters working group to measure how weak lensing mass estimates relate to the true 3D mass of a cluster. The work focuses on emulating actual observations and mimicing procedures used by weak lensing observers. Mock observations are based on simulated lensing maps from n-body simulations.

Set of to-do's for LSST-DESC sprint week's planning session

  • Create a template for an ideal "config file" that the general user could modify

  • Map out modules for the code (e.g. readers, observing strategies, M-c relations, (mis-)centering options and implementations, model profile to fit for mass (NFW, Diemer+, etc.), etc.

  • Figure out how/where we can integrate with CCL and Tom M.'s cluster_toolkit package: https://github.com/tmcclintock/cluster_toolkit

  • Map out steps to integrate SPHINX for documentation (Note - this should be done in parallel with refactoring): http://www.sphinx-doc.org/en/stable/contents.html

  • Assign a list of mini-tasks so anyone can jump in

  • Outline the process to jump in (submit an issue, reach out to "developers" involved for help, fork the repo, create a branch, make changes, merge into dev, etc.)

Projects for the DESC Hack Day, 17 Feb 2017!

1.) Experiment with jointly fitting individual cluster shear profiles (Mass, concentration, miscentering, 2-halo amplitude) jointly as a population, ie a hierarchical model. Similar to Lieu et al 2017, but we want to fit more parameters per cluster and fit an order of magnitude more clusters simultaneously. From a statistics & computation standpoint, can we sample O(2k) parameters with an MCMC engine, perhaps by taking advantage of the hierarchical structure of the problem?

2.) Daisuke Nagai & Erwin Lau, Nick Battaglia, and Stefan Hilbert & the Magneticum team have offered lensing maps produced from hydro simulations for analysis. Each simulation needs a reader that will bring the lensing information to a common format for CLMASSMOD use. We need to write that wrapper. We might also need to write an algorithm that coverts 2D mass maps to shear maps.

clmassmod's People

Contributors

aimalz avatar cavestruz avatar deapplegate avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clmassmod's Issues

clmm validation tests

This thread is for people to brainstorm validation tests for the code as the refactor progresses.

A first basic test would be to produce some ideal NFW, Einasto, DK (and whatever other profiles y'all want implemented) clusters with some added noise and see if CLMM can recover the correct cluster parameters. We should do this for a variety of SNR and masses (maybe around 10^13.8 or so to 10^15 solar masses/h).

I think another important test would be trying to use CLMM to investigate mass bias for simulated hydro clusters that don't come from cosmo-OWLS or BAHAMAS. Both of these implement AGN feedback from Booth and Schaye 2009, and since AGN feedback seems to be one of the most important non-gravity processes, it'd be nice to test on clusters produced with a different AGN prescription. In my project I found that, when concentration is left free, NFW mass bias does not significantly change when baryons are present in cosmo-OWLS clusters. However, clusters at low SNR tend to have very poorly constrained concentration which tends to drive the estimated mass down depending on your upper limit on c. Mummery et al 2017 found that M-c relations can depend on baryon implementation, so we should be careful if we want to use one of those. Anja mentioned it may be possible to use an M-c relation as a prior that's sufficiently wide enough to capture variations in baryonic physics, though I didn't explore that.

I'll probably keep adding to this as I think of stuff.

-Brandyn

Map out modules for the code

Map out modules for the code (e.g. readers, observing strategies, M-c relations, (mis-)centering options and implementations, model profile to fit for mass (NFW, Diemer+, etc.), etc. This would also be a good place to decide what the focus of CLMassMod should be.

Observables to use

Clusters have various weak lensing observables associated with them that different people use. You can use Kappa maps, gamma(theta), DeltaSigma and other signals. It might be a good idea to have CLMM work on one of these (which might be what Doug had already, not sure) as opposed to "weak lensing" in general.

Reading in config files

So we talked today about making the config file not a .py file. Something that I suggested was throwing everything into a .ini file that we can then parse as needed using configparser. This loads all of the contents of the ini file into a nice structured dictionary that can be broken up into sections. This object can then be passed around and is more transparent than what is currently in place.

I drew up a sample ini file combining the current contents of the .job file and the config.py files. So far, this is only prepped for running the nfwfit portion of the code.

[General]
# Todo: Some of these things must be able to be removed
# Todo: outputExt should be pkl??
catname = /Users/matthewkirby/research/CLMassMod/data/mxxl/halo_54_100_0
outbasename = outputs/halo_54_100_0
workbase = null
outputExt = .out
# Number of configuration files to include
number_configurations = 1


[Input Files]
number_inputfiles = 4
infile1 = /Users/matthewkirby/research/CLMassMod/data/mxxl/halo_54_100_0.convergence_map
infile2 = /Users/matthewkirby/research/CLMassMod/data/mxxl/halo_54_100_0.shear_1_map
infile3 = /Users/matthewkirby/research/CLMassMod/data/mxxl/halo_54_100_0.shear_2_map
infile4 = /Users/matthewkirby/research/CLMassMod/data/mxxl/halo_54_100_0.answer


[Config1]
# Todo: List options for each of these
# Todo: More useful names
profilebuilder = profilebuilder 
rescale_cluster = no_redshift_rescaling
beta_calcer = fixed_redshift

binner = gaussian_fixed_bins
profilecol = r_mpc
binspacing = linear
nbins = 12

density_picker = density_picker
nperarcmin = 20

shearnoise = gaussian_shape_noise
shapenoise = 0.25

fovpicker = ACS_mask
binnoiser = no_bin_noise

simreader = MXXL

model = NFW
fitter = MCMC

profile_min = 0.25
profile_max = 0.8

center_generator = no_offset
# This one may be a little more complicated. Need to look more in depth though first
#galaxypicker=simutils.Composite(densitypicker,fovpicker)
galaxy_picker = composite
zsource = 2.0

To make this, I only pasted together what was there so names and format is a little lacking. The general idea though is you load this object and then you can access each section by
cfgin['General']['number_of_configurations']

You would be able to set multiple configurations by just making a section [Config2], [Config3], etc and it can simply be looped over. Let me know what you guys think, if you think it would be a good use of time, I can go through and make the changes.

Demos

We need a demo that the new user can run to see how mass modeling works.

Documentation

There's some existing documentation in the code (in different formats). This is an issue to start formalizing and unifying that documentation, plus filling in missing bits.

Set scope and timeline

@cavestruz mentioned setting 1, 6, and 12 month goals for the project in today's call. I'm assigning us to do some organizational tasks, particularly making milestones, to help the team stay on track.

Epic: other codes

Let's use this as a space to collect issues about other codes:
What other codes do we want to interface with?
What purposes will they serve in this project and what modules do they belong in?
How do we work them into this code?

Epic: Refactoring

Let's collect all issues related to the great refactoring of 2017-18 here!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.