Skip to content

cosmology.MultiEpoch.comoving_distance has O(1e-7) interpolation errors with default settings #3

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?

import defaults
import cosmology

cosmo1 = cosmology.MultiEpoch(z_min=0, z_max=5, 
cosmo_dict=defaults.default_cosmo_dict)
d1 = cosmo1.comoving_distance(0.2)
print "d(z=1): {}".format(d1)

defaults.default_precision["cosmo_npoints"] = 500
cosmo2 = cosmology.MultiEpoch(z_min=0, z_max=5, 
cosmo_dict=defaults.default_cosmo_dict)
d2 = cosmo2.comoving_distance(0.2)
print "d(z=1): {}".format(d2)

print "Fractional error: {}".format((d1 - d2) / d2)

Proposed solution: Change defaults.default_precision["cosmo_npoints"] to a 
larger number (e.g., 500). This is a slower initialization for cosmology 
objects, but should help users get the expected precision 
(defaults.default_precision["cosmo_precision"] is set to 1.48e-8). 



Original issue reported on code.google.com by misch...@gmail.com on 1 Jan 2015 at 8:31

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions