Skip to content

Commit

Permalink
added input_root parameter to camb2ngenic
Browse files Browse the repository at this point in the history
  • Loading branch information
apetri committed May 19, 2016
1 parent 5580914 commit 8671e0d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lenstools/pipeline/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2376,17 +2376,20 @@ def loadTransferFunction(self,name_root="camb_transferfunc"):
#Return to user
return tfr

def camb2ngenic(self,z):
def camb2ngenic(self,z,input_root="camb"):

"""
Read CAMB power spectrum file and convert it in a N-GenIC readable format
:param z: redshift of the matter power spectrum file to convert
:type z: float.
:param input_root: name root of camb products
:type input_root: str.
"""

camb_ps_file = os.path.join(self.environment.home,self.cosmo_id,self.geometry_id,"camb_matterpower_z{0:.6f}.dat".format(z))
camb_ps_file = os.path.join(self.environment.home,self.cosmo_id,self.geometry_id,"{0}_matterpower_z{1:.6f}.dat".format(input_root,z))
if not(self.syshandler.exists(camb_ps_file)):
raise IOError("CAMB matter power spectrum file {0} does not exist yet!!".format(camb_ps_file))

Expand Down Expand Up @@ -2646,6 +2649,9 @@ def linkPlaneSet(self,plane,linkname):
os.symlink(plane.storage,new_plane.storage)
print("[+] Linked plane set {0} to {1}".format(plane.storage,new_plane.storage))

#Restore settings
plane.settings.directory_name = old_plane_name

####################################################################################################################################

@property
Expand Down

0 comments on commit 8671e0d

Please sign in to comment.