Skip to content

Commit

Permalink
pulling default into ares-dev branch (i.e., syncing up branches)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirochaj committed Jul 1, 2016
2 parents 82da997 + d7f9353 commit 52632a7
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 24 deletions.
1 change: 1 addition & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,4 @@ Additional contributions / corrections / suggestions from:
- Keith Tauscher (CU-Boulder)
- Saurabh Singh (RRI)


4 changes: 2 additions & 2 deletions ares/analysis/ModelSet.py
Original file line number Diff line number Diff line change
Expand Up @@ -2692,12 +2692,12 @@ def AssembleParametersList(self, N=None, loc=None, include_bkw=False):
kwargs[parameter] = self.chain[i,j]

all_kwargs.append(kwargs.copy())

if loc is not None:
return all_kwargs[0]
else:
return all_kwargs

def CorrelationMatrix(self, pars, ivar=None, fig=1, ax=None):
"""
Plot correlation matrix.
Expand Down
10 changes: 2 additions & 8 deletions ares/physics/Cosmology.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,7 @@
from .Constants import c, G, km_per_mpc, m_H, m_He, sigma_SB, g_per_msun

class Cosmology(object):
def __init__(self, **kwargs):
"""Initialize a Cosmology object.
:param: omega_m_0: Pretty self-explanatory.
"""

def __init__(self, **kwargs):
self.pf = ParameterFile(**kwargs)

self.omega_m_0 = self.pf['omega_m_0']
Expand Down Expand Up @@ -105,7 +99,7 @@ def LookbackTime(self, z_i, z_f):
"""

return self.t_of_z(z_i) - self.t_of_z(z_f)

def TCMB(self, z):
return self.cmb_temp_0 * (1. + z)

Expand Down
9 changes: 3 additions & 6 deletions ares/util/PrintInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,19 +667,16 @@ def print_fit(fitter):
return

warnings = []

is_cov = False

header = 'Parameter Estimation'
print "\n" + "#"*width
print "%s %s %s" % (pre, header.center(twidth), post)
print "#"*width

if is_cov:
cols = ['position', 'error (diagonal of cov)']
else:
cols = ['position', 'error']

cols = ['position', 'error']

if fit_TP:

print line('-'*twidth)
Expand Down
1 change: 0 additions & 1 deletion ares/util/SetDefaultParameterValues.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,6 @@ def ControlParameters():
"solver_rtol": 1e-8,
"solver_atol": 1e-8,
"interp_method": 'cubic',

"interp_cc": 'linear',

# Initialization
Expand Down
1 change: 0 additions & 1 deletion doc/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ This is known to occur in ``ares.physics.Hydrogen`` when using ``scipy.interpola
---------------------------------
If the derivative of the signal is noisy (due to numerical artifacts, for example) then the extrema-finding can fail. If you can visually see three extrema in the global 21-cm signal but they are either absent or crazy in ``ares.simulations.Global21cm.turning_points``, then this might be going on. Try setting the ``smooth_derivative`` parameter to a value of 0.1 or 0.2. This parameter will smooth the derivative with a boxcar of width :math:`\Delta z=` ``smooth_derivative`` before performing the extrema finding. Let me know if this happens (and under what circumstances), as it would be better to eliminate numerical artifacts than to smooth them out after the fact.


``AttributeError: No attribute blobs.``
---------------------------------------
This is a bit of a red herring. If you're running an MCMC fit and saving 2-D blobs, which always require you to pass the name of the function, this error occurs if you supply a function that does not exist. Check for typos and/or that the function exists where it should.
Expand Down
2 changes: 1 addition & 1 deletion input/litdata/eldridge2009.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def _kwargs_to_fn(**kwargs):
"""
Determine filename of appropriate BPASS lookup table based on kwargs.
"""

# All files share this prefix
fn = 'sed.bpass'

Expand Down
30 changes: 26 additions & 4 deletions remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,39 @@

os.chdir('input')

if 'minimal' in options:
to_download = ['inits', 'secondary_electrons']
files = []
if len(options) > 0:
if 'minimal' in options:
to_download = ['inits', 'secondary_electrons']
files = [None, None]
else:
to_download = []
for key in options:
if re.search(':', key):
pre, post = key.split(':')
to_download.append(pre)
files.append(int(post))
else:
to_download.append(key)
files.append(None)
else:
to_download = aux_data.keys()
files = [None] * len(to_download)

for direc in to_download:
for i, direc in enumerate(to_download):
if not os.path.exists(direc):
os.mkdir(direc)

os.chdir(direc)

web = aux_data[direc][0]
for fn in aux_data[direc][1:-1]:

if files[i] is None:
fns = aux_data[direc][1:-1]
else:
fns = [aux_data[direc][1:-1][files[i]]]

for fn in fns:

if os.path.exists(fn):
if 'fresh' or 'clean' in options:
Expand All @@ -63,9 +83,11 @@
print "Downloading %s/%s..." % (web, fn)
urllib.urlretrieve('%s/%s' % (web, fn), fn)

# If it's not a tarball, move on
if not re.search('tar', fn):
continue

# Otherwise, unpack it
tar = tarfile.open(fn)
tar.extractall()
tar.close()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_physics_HI_cc.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ def test():
if __name__ == '__main__':
test()


0 comments on commit 52632a7

Please sign in to comment.