项目作者: lsst-lpc

项目描述 :
Hubble diagram fit
高级语言: Python
项目地址: git://github.com/lsst-lpc/hubble-fit.git
创建时间: 2017-04-27T10:43:48Z
项目社区:https://github.com/lsst-lpc/hubble-fit

开源协议:BSD 3-Clause "New" or "Revised" License

下载


hubble-fit

Build Status

hubble-fit is a collection of functions to fit the Hubble diagram with a Cosmological model.

The initial version was written in Python.
This is a reimplementation in Go.

Introduction

The data/jla_lcparams.txt file contains light-curve parameters as described by the Joint Light-curve Analysis package:

  1. name: name of the SN
  2. zcmb: CMB frame redshift (including peculiar velocity corrections for
  3. nearby supernova based on the models of M.J. Hudson)
  4. zhel: Heliocentric redshift (note both zcmb and zhel are needed
  5. to compute the luminosity distance)
  6. dz: redshift error (no longer used by the plugin)
  7. mb: B band peak magnitude
  8. dmb: Error in mb (includes contributions from intrinsic dispersion,
  9. lensing, and redshift uncertainty)
  10. x1: SALT2 shape parameter
  11. dx1: Error in shape parameter
  12. colour: Colour parameter
  13. dcolour: Error in colour
  14. 3rdvar: In these files, the log_10 host stellar mass
  15. d3rdvar: Error in 3rdvar
  16. tmax: Date of peak brightness (mjd)
  17. dtmax: Error in tmax
  18. cov_m_s: The covariance between mb and x1
  19. cov_m_c: The covariance between mb and colour
  20. cov_s_c: The covariance between x1 and colour
  21. set: A number indicating which sample this SN belongs to, with
  22. 1 - SNLS, 2 - SDSS, 3 - low-z, 4 - Riess HST
  23. ra: Right Ascension in degree (J2000)
  24. dec: Declination in degree (J2000)
  25. biascor: The correction for analysis bias applied to measured magnitudes
  26. (this correction is already applied to mb, original measurements
  27. can be obtained by subtracting this term to mb)

Note that you will need the covariance matrices from JLA to run the hubble-fit code.

Example

Once you have installed the Go toolchain:

  1. $> go get github.com/lsst-lpc/hubble-fit
  2. $> cd $GOPATH/github.com/lsst-lpc/hubble-fit
  3. $> time hubble-fit
  4. hubble: using method: *optimize.NelderMead (grad=false hessian=false)
  5. Number of supernovae : 740
  6. mean of the residuals 0.014391538550558799
  7. mean of the absolute residuals 0.12726543895212666
  8. hubble: initial parameters: [0.295 0.141 3.101 -19.05 -0.07]
  9. res=&{Location:{X:[0.295 0.141 3.101 -19.05 -0.07] F:652.7606127419591 Gradient:[] Hessian:0xc429cd80c0} Stats:{MajorIterations:19 FuncEvaluations:41 GradEvaluations:0 HessEvaluations:0 Runtime:25.060160788s} Status:FunctionConvergence}
  10. hubble: status = FunctionConvergence
  11. hubble: func = 652.760613
  12. ==== results ====
  13. Omega M = +0.2950
  14. Alpha = +0.1410
  15. Beta = +3.1010
  16. Mb = -19.0500
  17. Delta M = -0.0700
  18. Hessian: 3510.2425270080566 1167.8890228271484 181.1999397277832 -3906.792751312256 -1216.6510734558105
  19. 1167.8890228271484 46425.35659790039 257.57526779174805 -784.8816604614258 3034.029556274414
  20. 181.1999397277832 257.57526779174805 302.06271743774414 -200.42919158935547 -21.88933563232422
  21. -3906.792751312256 -784.8816604614258 -200.42919158935547 8549.161113739014 3000.5796813964844
  22. ⎣-1216.6510734558105 3034.029556274414 -21.88933563232422 3000.5796813964844 4887.541770935059
  23. real 0m35.845s
  24. user 1m3.329s
  25. sys 0m0.545s

Python reference

  1. $> cd $GOPATH/github.com/lsst-lpc/hubble-fit
  2. $> time python2 ./py/hubblefit.py
  3. ./py/hubblefit.py:387: InitialParamWarning: errordef is not given. Default to 1.
  4. limit_Mb=(-20., -18.), limit_delta_M=(-0.1, -0.0), fix_omgM=False, fix_alpha=False, fix_beta=False, fix_Mb=False, fix_delta_M=False, print_level=1)
  5. **************************************************
  6. * MIGRAD *
  7. **************************************************
  8. **********************************************************************
  9. ---------------------------------------------------------------------------------------
  10. fval = 682.8910357476947 | total call = 90 | ncalls = 90
  11. edm = 5.6711138504257765e-05 (Goal: 1e-05) | up = 1.0
  12. ---------------------------------------------------------------------------------------
  13. | Valid | Valid Param | Accurate Covar | Posdef | Made Posdef |
  14. ---------------------------------------------------------------------------------------
  15. | True | True | True | True | False |
  16. ---------------------------------------------------------------------------------------
  17. | Hesse Fail | Has Cov | Above EDM | | Reach calllim |
  18. ---------------------------------------------------------------------------------------
  19. | False | True | False | u'' | False |
  20. ---------------------------------------------------------------------------------------
  21. ------------------------------------------------------------------------------------------------
  22. | | Name | Value | Para Err | Err- | Err+ | Limit- | Limit+ | |
  23. ------------------------------------------------------------------------------------------------
  24. | 0 | omgM = 0.2951 | 0.03327 | | | 0.2 | 0.4 | |
  25. | 1 | alpha = 0.1412 | 0.00657 | | | 0.1 | 0.2 | |
  26. | 2 | beta = 3.102 | 0.08064 | | | 2 | 4 | |
  27. | 3 | Mb = -19.05 | 0.02317 | | | -20 | -18 | |
  28. | 4 | delta_M = -0.07008 | 0.02216 | | | -0.1 | -0 | |
  29. ------------------------------------------------------------------------------------------------
  30. **********************************************************************
  31. real 1m17.719s
  32. user 1m12.372s
  33. sys 0m4.808s