Page MenuHomec4science

No OneTemporary

File Metadata

Created
Tue, Dec 3, 20:16
This file is larger than 256 KB, so syntax highlighting was skipped.
diff --git a/ParticlesToSurfaceBrightness/ARRAKIHS.py b/ParticlesToSurfaceBrightness/ARRAKIHS.py
deleted file mode 100644
index 026b907..0000000
--- a/ParticlesToSurfaceBrightness/ARRAKIHS.py
+++ /dev/null
@@ -1,621 +0,0 @@
-#!/usr/bin/env python3
-###########################################################################################
-# package: pNbody
-# file: __init__.py
-# brief: init file
-# copyright: GPLv3
-# Copyright (C) 2019 EPFL (Ecole Polytechnique Federale de Lausanne)
-# LASTRO - Laboratory of Astrophysics of EPFL
-# author: Yves Revaz <yves.revaz@epfl.ch>
-#
-# This file is part of pNbody.
-###########################################################################################
-
-
-import numpy as np
-
-from astropy import constants as cte
-from astropy import units as u
-
-from pNbody import *
-from pNbody import ic
-from pNbody import mapping
-from pNbody import geometry
-
-import argparse
-
-import matplotlib.pyplot as plt
-import matplotlib.colors as mcolors
-
-from scipy import signal
-
-import stars_class
-
-
-def SetTelecope(opt):
-
-
- ##################
- # set telescope
-
- if opt.telescope=='arrakihs_vis':
-
- opt.ccd_shape=[4096,4096]
- opt.ccd_size=[1.5,1.5]
-
- if opt.filter is None:
- opt.filter = "VIS"
-
- elif opt.telescope=='arrakihs_nir':
-
- opt.ccd_shape=[2048,2048]
- opt.ccd_size=[1.3,1.3]
-
- if opt.filter is None:
- opt.filter = "UKIRT_J"
-
-
- elif opt.telescope=='euclid_vis':
-
- opt.ccd_shape=[24576,24576]
- opt.ccd_size=[0.787,0.787]
-
-
- ##################
- # set filters
-
- if opt.filter=='F475X':
- opt.mlim = 30.12
- opt.mlmin = 29.50
- opt.mlmax = opt.mlim
-
- elif opt.filter=='VISeuclid':
- opt.mlim = 33 #30.23
- opt.mlmin = 29.5 #29.50 # Euclid preparation: XVI. Borlaff 2021
- opt.mlmax = opt.mlim
-
- elif opt.filter=='Yeuclid':
- opt.mlim = 29.59
- opt.mlmin = 29.50
- opt.mlmax = opt.mlim
-
- elif opt.filter=='Jeuclid':
- opt.mlim = 31.37
- opt.mlmin = 29.50
- opt.mlmax = opt.mlim
-
-
-
-
-
-
- ##################################
- # ccd size
- ##################################
-
- # degree to arcsec
- opt.ccd_size = [opt.ccd_size[0]*3600,opt.ccd_size[1]*3600]
- opt.ccd_pixel_size = [opt.ccd_size[0]/opt.ccd_shape[0],opt.ccd_size[1]/opt.ccd_shape[1]]
- opt.ccd_pixel_area = opt.ccd_pixel_size[0]*opt.ccd_pixel_size[1]
-
-
-
-
-def GenerateDwarf(opt):
- '''
- Generate a dwarf model based on a plummer sphere.
- Note that the plummer scaling length is equivalent to
- the projected half light radius.
- '''
-
- # set maximal radius
- rmax = opt.e * opt.rmax_e_ratio
-
- # convert to int
- opt.N = int(opt.N)
-
- # generate the model
- nb = ic.plummer(opt.N,1,1,1,opt.e,rmax,M=opt.M,irand=1,vel='no',name=opt.outputfilename,ftype='swift')
-
- if opt.outputfilename is not None:
- nb.write()
-
- return nb
-
-
-
-def gaussian_filter(kernel_size, sigma=1, muu=0):
-
- # Initializing value of x,y as grid of kernel size
- # in the range of kernel size
-
- x, y = np.meshgrid(np.linspace(-kernel_size, kernel_size, kernel_size),np.linspace(-kernel_size, kernel_size, kernel_size))
- dst = np.sqrt(x**2+y**2)
-
-
- # lower normal part of gaussian
- #normal = 1/np.sqrt(2 * np.pi * sigma**2)
-
- # Calculating Gaussian filter
- gauss = np.exp(-((dst-muu)**2 / (2.0 * sigma**2)))
- gauss = gauss/gauss.sum()
-
- return gauss
-
-
-
-def Project(opt):
- '''
- Project a stellar model
- '''
-
-
- ##################################
- # factor conversion kpc to arcsec
- ##################################
-
- # Mpc to kpc
- distance = opt.distance * 1000
-
- # define a conversion function : kpc -> arcsec
- fct_kpc2arcsec = np.vectorize(lambda x: 3600*180/np.pi* np.arctan(x/distance) )
- opt.fct_kpc2arcsec = lambda x: 3600*180/np.pi* np.arctan(x/distance)
-
- # define a conversion function : arcsec -> kpc
- fct_arcsec2kpc = np.vectorize(lambda x: distance*np.tan(x*np.pi/3600/180) )
- opt.fct_arcsec2kpc = lambda x: distance*np.tan(x*np.pi/3600/180)
-
-
- # image properties
- if opt.fov is not None:
- xmin = -opt.fov/2.
- xmax = +opt.fov/2.
- ymin = -opt.fov/2.
- ymax = +opt.fov/2.
-
- nx = int(opt.fov/opt.ccd_pixel_size[0])+1
- ny = int(opt.fov/opt.ccd_pixel_size[1])+1
-
-
- elif opt.size is not None:
- nx = opt.size[0] + 1 # +1 as the resulting matrix will be -1
- ny = opt.size[1] + 1 # +1 as the resulting matrix will be -1
-
- xmin = -nx*opt.ccd_pixel_size[0] /2.
- xmax = +nx*opt.ccd_pixel_size[0] /2.
- ymin = -ny*opt.ccd_pixel_size[1] /2.
- ymax = +ny*opt.ccd_pixel_size[1] /2.
-
- else:
- nx = int(opt.ccd_shape[0] *opt.ccd_field_fraction)
- ny = int(opt.ccd_shape[1] *opt.ccd_field_fraction)
-
- xmin = -opt.ccd_size[0]/2 *opt.ccd_field_fraction
- xmax = +opt.ccd_size[0]/2 *opt.ccd_field_fraction
- ymin = -opt.ccd_size[1]/2 *opt.ccd_field_fraction
- ymax = +opt.ccd_size[1]/2 *opt.ccd_field_fraction
-
-
-
- # extension in kpc
- opt.xmin_kpc = fct_arcsec2kpc(xmin)
- opt.xmax_kpc = fct_arcsec2kpc(xmax)
- opt.ymin_kpc = fct_arcsec2kpc(ymin)
- opt.ymax_kpc = fct_arcsec2kpc(ymax)
-
-
-
- ##################################
- # open the model
- ##################################
-
- if opt.file is None:
- nb = opt.nb
- else:
- nb = Nbody(opt.file)
- nb.mass = nb.mass*opt.toMsol
-
- # remove doublets
- u,idx = np.unique(nb.rxyz(),return_index=True)
- nb = nb.selectp(lst=nb.num[idx])
-
- if not nb.has_array("rsp"):
- # compute Hsml
- #nb.set_tpe(0)
- #nb.InitSphParameters(DesNumNgb=32, MaxNumNgbDeviation=2)
- #nb.getTree()
- #nb.rsp = nb.get_rsp_approximation()
- nb.ComputeRsp(5)
-
- if not nb.has_array("age"):
- # compute Age [in Gyr]
- print("Compute ages...")
- nb.age = nb.StellarAge(units="Gyr")
- print("done.")
-
- # rotate
- if opt.los is not None:
- nb.align(opt.los)
-
-
- # compute mass
- mass = nb.mass
-
-
-
-
- # scale the model : kpc -> arcsec
- x = fct_kpc2arcsec(nb.x())
- y = fct_kpc2arcsec(nb.y())
- z = fct_kpc2arcsec(nb.z())
-
- nb.pos = np.transpose((x,y,z))
- nb.pos = nb.pos.astype(np.float32)
-
-
- binsx = np.linspace(xmin,xmax,nx)
- binsy = np.linspace(ymin,ymax,ny)
-
-
-
-
- # get the luminosity:
- if opt.filter=="V" or opt.filter=="VIS" or opt.filter=="UKIRT_J" :
-
- # here we assume the mass of the particle to contain its luminosity
-
- # luminosity (L_sun)
- #L = nb.mass.sum()
-
- # map from numpy
- #L_map,xe,ye = np.histogram2d(x, y,bins=[binsx,binsy],weights=nb.mass)
- #L_map = np.rot90(L_map)
-
- # map from pnbody
- params = {}
- params['size'] = (xmax,ymax)
- params['shape'] = (nx,ny)
- params['rendering'] = 'map'
- params['obs'] = None
- params['xp'] = None
- params['view'] = opt.view
- params['mode'] = 'm'
- params['exec'] = None
- params['macro'] = None
- params['frsp'] = opt.frsp
- params['filter_name'] = None
-
- L_map = nb.CombiMap(params)
- L_map = np.rot90(L_map)
- L_map = np.flipud(L_map)
-
- # psf convolution
- if opt.convolve:
- psf = opt.psf/opt.ccd_pixel_size[0]
- # gaussian filter
- psf_map = gaussian_filter(L_map.shape[0],psf)
- # convolve
- L_map = signal.convolve2d(L_map, psf_map, mode='same', boundary='fill', fillvalue=0)
-
-
- # compute the absolute magnitude in each pixel (vband)
- Mvega = 4.81
- M_map = Mvega - 2.5*np.log10(L_map)
-
- # filter stuffs
- M_V = M_map
- L_V = L_map
-
- M_R = M_V -0.45
- M_I = M_R -0.5
- M_J = M_I -0.6
- L_R = np.log10( (M_R-4.43)/(-2.5) )
- L_I = np.log10( (M_R-4.10)/(-2.5) )
- L_J = np.log10( (M_J-3.65)/(-2.5) )
-
- L_VIS = L_V + L_R + L_I
- M_VIS = 3.216 - 2.5*np.log10(L_VIS)
-
- if opt.filter=="V":
- M_map = M_V
- elif opt.filter=="VIS":
- M_map = M_VIS
- elif opt.filter=="UKIRT_J":
- M_map = M_J
-
-
- # compute the apparent magnitude in each pixel
- d = distance*100 # kpc -> 10pc
- m_map = M_map + 5*np.log10(d)
-
- # compute the surface brightness in each pixel
- S_map = m_map + 2.5*np.log10(opt.ccd_pixel_area)
-
-
- #S_map = L_map
-
-
-
- elif opt.filter=="F475X" or opt.filter=="VISeuclid" or opt.filter=="Yeuclid" or opt.filter=="Jeuclid":
-
- if not nb.has_array("MagF475X") or not nb.has_array("MagVISeuclid") or not nb.has_array("MagYeuclid") or not nb.has_array("MagJeuclid"):
-
-
- # compute a magnitude for the filter in each mass bin
- print("Compute magnitudes...")
-
- if opt.filter=="F475X":
- M = stars_class.HST475X_fun(None,nb.age,nb.MH())
-
- elif opt.filter=="VISeuclid":
- M = stars_class.VISeuclid_fun(None,nb.age,nb.MH())
-
- elif opt.filter=="Yeuclid":
- M = stars_class.Yeuclid_fun(None,nb.age,nb.MH())
-
- elif opt.filter=="Jeuclid":
- M = stars_class.Jeuclid_fun(None,nb.age,nb.MH())
-
- # convert to flux (ignore the zero point)
- # to get the correct flux, see notes in Garrotxa
- F = 10**(-M/2.5)
-
- # get the number of stars in each mass bin
- Nstars = stars_class.Stars_fun(mass,None,None, 'normed_3slope')
-
- # sum the contribution of the mass bins
- F = np.sum(F*Nstars, axis=0)
-
- # compute the absolute magnitude in each pixel (as before we ignore the zero point)
- M = - 2.5*np.log10(F)
-
- print("done.")
-
- else:
-
- if opt.filter=="F475X":
- M = nb.MagF475X
-
- elif opt.filter=="VISeuclid":
- M = nb.MagVISeuclid
-
- elif opt.filter=="Yeuclid":
- M = nb.MagYeuclid
-
- elif opt.filter=="Jeuclid":
- M = nb.MagJeuclid
-
-
-
-
- # convert to flux (ignore the zero point)
- F = 10**(-M/2.5)
-
- # store in the mass field
- nb.mass = F.astype(np.float32)
-
- # map from numpy
- #L_map,xe,ye = np.histogram2d(x, y,bins=[binsx,binsy],weights=nb.mass)
- #L_map = np.rot90(L_map)
-
- # map from pnbody
- params = {}
- params['size'] = (xmax,ymax)
- params['shape'] = (nx,ny)
- params['rendering'] = 'map'
- params['obs'] = None
- params['xp'] = None
- params['view'] = opt.view
- params['mode'] = 'm'
- params['exec'] = None
- params['macro'] = None
- params['frsp'] = opt.frsp
- params['filter_name'] = None
-
- L_map = nb.CombiMap(params)
- L_map = np.rot90(L_map)
- L_map = np.flipud(L_map)
-
- # psf convolution
- if opt.convolve:
- psf = opt.psf/opt.ccd_pixel_size[0]
- # gaussian filter
- psf_map = gaussian_filter(L_map.shape[0],psf)
- # convolve
- L_map = signal.convolve2d(L_map, psf_map, mode='same', boundary='fill', fillvalue=0)
-
-
- # compute the absolute magnitude in each pixel (as before we ignore the zero point)
- M_map = - 2.5*np.log10(L_map)
-
- # compute the apparent magnitude in each pixel
- d = distance*100 # kpc -> 10pc
- m_map = M_map + 5*np.log10(d)
-
- # compute the surface brightness in each pixel
- S_map = m_map + 2.5*np.log10(opt.ccd_pixel_area)
-
-
-
-
-
-
-
-
-
-
- return S_map,xmin,xmax,ymin,ymax
-
-
-
-
-def SkySurfaceBrightness(opt,shape):
- '''
- Generate a sky surface brightness
-
- sky background on earth : 21.8 mag/arcsec2 in V
- '''
-
- mean = opt.sky_mean
- std = (mean - opt.mlim)/3.
- sky_image = np.random.normal(mean,std,shape)
-
- print(" mean :",sky_image.mean())
- print(" 3*std :",3*sky_image.std())
- print(" mean-3*std :",sky_image.mean()-3*sky_image.std())
-
- return sky_image
-
-
-
-
-
-def AddSkyBackground(opt,image):
- """
- !!! this must be corrected !!! the filter is bad
- """
-
- if opt.sky_background:
- sky = SkySurfaceBrightness(opt,image.shape)
-
-
- M0 = 4.81
- Fg = 10**((-image+M0)/2.5)
- Fs = 10**((-sky +M0)/2.5)
-
- image = -2.5*np.log10(Fg + Fs) + M0
-
- plt.imshow(image)
- plt.show()
-
-
-
- return image
-
-
-def Display(opt,ax,image,xmin,xmax,ymin,ymax):
-
-
- mmin = 25 # min magnitude
- mmax = 36 # max magnitude
-
-
- if opt.split_colorbar:
- mlim = opt.mlim # limit magnitude
-
- n1 = int(256* (mlim-mmin)/(mmax-mmin))
- n2 = 256-n1
-
- colors1 = plt.cm.gist_heat_r(np.linspace(0.75, 0.25, n1))
- #colors2 = plt.cm.binary(np.linspace(0.25, 0.0, n2))
- colors2 = plt.cm.binary(np.linspace(0.25, 0.0, n2))
-
- # combine them and build a new colormap
- colors = np.vstack((colors1, colors2))
- mymap = mcolors.LinearSegmentedColormap.from_list('my_colormap', colors)
-
- else:
- mymap = plt.cm.Greys_r
-
- # use kpc units
- xmin=opt.xmin_kpc
- xmax=opt.xmax_kpc
- ymin=opt.ymin_kpc
- ymax=opt.ymax_kpc
-
- im = ax.imshow(image,aspect='equal',extent=(xmin,xmax,ymin,ymax),cmap=mymap,interpolation=None,vmin=mmin,vmax=mmax)
-
-
- return im
-
-
-
-
-def DisplayDiff(opt,ax,image,xmin,xmax,ymin,ymax):
-
-
- mmin = 25 # min magnitude
- mmax = 36 # max magnitude
-
-
- if opt.split_colorbar:
- mlim = opt.mlim # limit magnitude
-
- mlmin = opt.mlmin
- mlmax = opt.mlmax
-
- n1 = int(256* (mlmin-mmin)/(mmax-mmin))
- n2 = int(256* (mlmax-mmin)/(mmax-mmin)) - n1
- n3 = 256 - int(256* (mlmax-mmin)/(mmax-mmin))
-
-
- colors1 = plt.cm.binary(np.linspace(0.0, 0.0, n1))
- colors2 = plt.cm.gist_heat_r(np.linspace(0.7, 0.3, n2))
- colors3 = plt.cm.binary(np.linspace(0.0, 0.0, n3))
-
-
- # combine them and build a new colormap
- colors = np.vstack((colors1,colors2,colors3))
- mymap = mcolors.LinearSegmentedColormap.from_list('my_colormap', colors)
-
- else:
- mymap = plt.cm.Greys_r
-
- # use kpc units
- xmin=opt.xmin_kpc
- xmax=opt.xmax_kpc
- ymin=opt.ymin_kpc
- ymax=opt.ymax_kpc
-
- im = ax.imshow(image,aspect='equal',extent=(xmin,xmax,ymin,ymax),cmap=mymap,interpolation=None,vmin=mmin,vmax=mmax)
-
-
- return im
-
-
-
-
-def DisplaySingle(opt,ax,image,xmin,xmax,ymin,ymax):
-
-
-
- mmin = opt.mlmin
- mmax = opt.mlmax
-
- opt.split_colorbar=False
-
- if opt.split_colorbar:
- #mlim = opt.mlim # limit magnitude
-
- #mlmin = opt.mlmin
- #mlmax = opt.mlmax
-
- #n1 = int(256* (mlmin-mmin)/(mmax-mmin))
- #n2 = int(256* (mlmax-mmin)/(mmax-mmin)) - n1
- #n3 = 256 - int(256* (mlmax-mmin)/(mmax-mmin))
-
-
- #colors1 = plt.cm.binary(np.linspace(0.0, 0.0, n1))
- colors2 = plt.cm.gist_heat(np.linspace(0.3, 1.0, 255))
- #colors3 = plt.cm.binary(np.linspace(0.0, 0.0, n3))
-
-
- # combine them and build a new colormap
- #colors = np.vstack((colors1,colors2,colors3))
- mymap = mcolors.LinearSegmentedColormap.from_list('my_colormap', colors2)
-
- #mymap = plt.cm.gist_heat
-
- else:
- mymap = plt.cm.gist_heat
-
- # use kpc units
- xmin=opt.xmin_kpc
- xmax=opt.xmax_kpc
- ymin=opt.ymin_kpc
- ymax=opt.ymax_kpc
-
- im = ax.imshow(image,aspect='equal',extent=(xmin,xmax,ymin,ymax),cmap=mymap,interpolation=None,vmin=mmin,vmax=mmax)
-
-
- return im
diff --git a/ParticlesToSurfaceBrightness/IMF.py b/ParticlesToSurfaceBrightness/IMF.py
deleted file mode 100644
index f82e34d..0000000
--- a/ParticlesToSurfaceBrightness/IMF.py
+++ /dev/null
@@ -1,232 +0,0 @@
-import numpy as np
-
-####################
- ## IMF subroutines
-####################
-
-def slope_imf(x,p1,p2,p3,kn1,kn2):
-
-#Is calculating a three slope IMF
-#INPUT:
-# x = An array of masses for which the IMF should be calculated
-# p1..p3 = the slopes of the power law
-# kn1, kn2 = Where the breaks of the power law are
-#OUTPUT:
-# An array of frequencies matching the mass base array x
- if(x > kn2):
- t = (pow(kn2,p2)/pow(kn2,p3))*pow(x,p3+1)
- elif (x < kn1):
- t = (pow(kn1,p2)/pow(kn1,p1))*pow(x,p1+1)
- else:
- t = pow(x,p2+1)
- return t
-
-
-def lifetime(m,Z):
-
-#here we will calculate the MS lifetime of the star after Argast et al., 2000, A&A, 356, 873
-#INPUT:¡
-# m = mass in Msun
-# Z = metallicity in Zsun
-
-#OUTPUT:
-# returns the lifetime of the star in Gyrs
-
- lm = np.log10(m)
- a0 = 3.79 + 0.24*Z
- a1 = -3.10 - 0.35*Z
- a2 = 0.74 + 0.11*Z
- tmp = a0 + a1*lm + a2*lm*lm
- return np.divide(np.power(10,tmp),1000)
-
-
-class IMF(object):
-
-#This class represents the IMF normed to 1 in units of M_sun.
-#Input for initialisation:
-
-# mmin = minimal mass of the IMF
-
-# mmax = maximal mass of the IMF
-
-# intervals = how many steps inbetween mmin and mmax should be given
-
-#Then one of the IMF functions can be used
-
-# self.x = mass base
-
-# self.dn = the number of stars at x
-
-# self.dm = the masses for each mass interval x
-
- def __init__(self, mmin = 0.08 , mmax = 100., intervals = 5000):
- self.mmin = mmin
- self.mmax = mmax
- self.intervals = intervals
- self.x = np.linspace(mmin,mmax,intervals)
- self.dx = self.x[1]-self.x[0]
-
- def normed_3slope(self,paramet = (-1.3,-2.2,-2.7,0.5,1.0)):
-
-# Three slope IMF, Kroupa 1993 as a default
-
- s1,s2,s3,k1,k2 = paramet
- u = np.zeros_like(self.x)
- v = np.zeros_like(self.x)
- for i in range(len(self.x)):
- u[i] = slope_imf(self.x[i],s1,s2,s3,k1,k2)
- v = np.divide(u,self.x)
- self.dm = np.divide(u,sum(u))
- self.dn = np.divide(self.dm,self.x)
- return(self.dm,self.dn)
-
-
- def Chabrier_1(self, paramet = (0.69, 0.079, -2.3)):
-
-# Chabrier IMF from Chabrier 2003 equation 17 field IMF with variable high mass slope and automatic normalisation
-
- sigma, m_c, expo = paramet
- dn = np.zeros_like(self.x)
- for i in range(len(self.x)):
- if self.x[i] <= 1:
- index_with_mass_1 = i
- dn[i] = (1. / float(self.x[i])) * np.exp(-1*(((np.log10(self.x[i] / m_c))**2)/(2*sigma**2)))
- else:
- dn[i] = (pow(self.x[i],expo))
- # Need to 'attach' the upper to the lower branch
- derivative_at_1 = dn[index_with_mass_1] - dn[index_with_mass_1 - 1]
- target_y_for_m_plus_1 = dn[index_with_mass_1] + derivative_at_1
- rescale = target_y_for_m_plus_1 / dn[index_with_mass_1 + 1]
- dn[np.where(self.x>1.)] *= rescale
- # Normalizing to 1 in mass space
- self.dn = np.divide(dn,sum(dn))
- dm = dn*self.x
- self.dm = np.divide(dm,sum(dm))
- self.dn = np.divide(self.dm,self.x)
- return(self.dm,self.dn)
-
-
- def Chabrier_2(self,paramet = (22.8978, 716.4, 0.25,-2.3)):
-
-# Chabrier IMF from Chabrier 2001, IMF 3 = equation 8 parameters from table 1
-
-
- A,B,sigma,expo = paramet
- expo -= 1. ## in order to get an alpha index normalisation
- dn = np.zeros_like(self.x)
- for i in range(len(self.x)):
- dn[i] = A*(np.exp(-pow((B/self.x[i]),sigma)))*pow(self.x[i],expo)
- self.dn = np.divide(dn,sum(dn))
- dm = dn*self.x
- self.dm = np.divide(dm,sum(dm))
- self.dn = np.divide(self.dm,self.x)
- return(self.dm,self.dn)
-
-
- def salpeter(self, alpha = (2.35)):
-
-# Salpeter IMF
-
-# Input the slope of the IMF
-
- self.alpha = alpha
- temp = np.power(self.x,-self.alpha)
- norm = sum(temp)
- self.dn = np.divide(temp,norm)
- u = self.dn*self.x
- self.dm = np.divide(u,sum(u))
- self.dn = np.divide(self.dm,self.x)
- return (self.dm,self.dn)
-
-
- def BrokenPowerLaw(self, paramet):
- breaks,slopes = paramet
- if len(breaks) != len(slopes)-1:
- print("error in the precription of the power law. It needs one more slope than break value")
- else:
- dn = np.zeros_like(self.x)
- self.breaks = breaks
- self.slopes = slopes
- self.mass_range = np.hstack((self.mmin,breaks,self.mmax))
- for i,item in enumerate(self.slopes):
- cut = np.where(np.logical_and(self.x>=self.mass_range[i],self.x<self.mass_range[i+1]))
- dn[cut] = np.power(self.x[cut],item)
- if i != 0:
- renorm = np.divide(last_dn,dn[cut][0])
- dn[cut] = dn[cut]*renorm
- last_dn = dn[cut][-1]
- last_x = self.x[cut][-1]
- self.dn = np.divide(dn,sum(dn))
- u = self.dn*self.x
- self.dm = np.divide(u,sum(u))
- self.dn = np.divide(self.dm,self.x)
- return (self.dm,self.dn)
-
-
- def imf_mass_fraction(self,mlow,mup):
-
-# Calculates the mass fraction of the IMF sitting between mlow and mup
-
- norm = sum(self.dm)
- cut = np.where(np.logical_and(self.x>=mlow,self.x<mup))
- fraction = np.divide(sum(self.dm[cut]),norm)
- return(fraction)
-
- def imf_number_fraction(self,mlow,mup):
-
-# Calculating the number fraction of stars of the IMF sitting between mlow and mup
-
- norm = sum(self.dn)
- cut = np.where(np.logical_and(self.x>=mlow,self.x<mup))
- fraction = np.divide(sum(self.dn[cut]),norm)
- return(fraction)
-
- def imf_number_stars(self,mlow,mup):
- cut = np.where(np.logical_and(self.x>=mlow,self.x<mup))
- number = sum(self.dn[cut])
- return(number)
-
- def stochastic_sampling(self, mass):
-
-# The analytic IMF will be resampled according to the mass of the SSP.
-# The IMF will still be normalised to 1
-
-# Stochastic sampling is realised by fixing the number of expected stars and then drawing from the probability distribution of the number density
-# Statistical properties are tested for this sampling and are safe: number of stars and masses converge.
-
- number_of_stars = int(round(sum(self.dn) * mass))
- self.dm_copy = np.copy(self.dm)
- self.dn_copy = np.copy(self.dn)
-
- #self.dn_copy = np.divide(self.dn_copy,sum(self.dn_copy))
- random_number = np.random.uniform(low = 0.0, high = sum(self.dn_copy), size = number_of_stars)
- self.dm = np.zeros_like(self.dm)
- self.dn = np.zeros_like(self.dn)
-
- ### This could be favourable if the number of stars drawn is low compared to the imf resolution
-# for i in range(number_of_stars):
- ### the next line randomly draws a mass according to the number distribution of stars
-# cut = np.where(np.abs(np.cumsum(self.dn_copy)-random_number[i])== np.min(np.abs(np.cumsum(self.dn_copy)-random_number[i])))
-# x1 = self.x[cut][0]
- #self.dn[cut] += 0.5
-# self.dn[cut[0]] += 1
-# self.dm[cut[0]] += x1 + self.dx/2.
-# t.append(x1 + self.dx/2.)
-
- counting = np.cumsum(self.dn_copy)
- for i in range(len(counting)-1):
- if i == 0:
- cut = np.where(np.logical_and(random_number>0.,random_number<=counting[i]))
- else:
- cut = np.where(np.logical_and(random_number>counting[i-1],random_number<=counting[i]))
- number_of_stars_in_mass_bin = len(random_number[cut])
- self.dm[i] = number_of_stars_in_mass_bin * self.x[i]
- if number_of_stars:
- self.dm = np.divide(self.dm,sum(self.dm))
- else:
- self.dm = np.divide(self.dm, 1)
- self.dn = np.divide(self.dm,self.x)
- return (self.dm,self.dn)
-########
- ## End IMF subroutines
-########
diff --git a/ParticlesToSurfaceBrightness/Readme b/ParticlesToSurfaceBrightness/Readme
deleted file mode 100644
index 5b4e86f..0000000
--- a/ParticlesToSurfaceBrightness/Readme
+++ /dev/null
@@ -1,52 +0,0 @@
-# Note : this is now obsolete.
-# use https://lastro.epfl.ch/projects/pNbody//rst/MockImages/SurfaceBrightnessMaps.html
-# instead
-
-# requirement : pNbody https://lastro.epfl.ch/projects/pNbody/
-
-
-#################################################
-# download snapshots containing only stars
-# we need to find another repo for big data
-
-stars_1keV_1000kpc.hdf5
-stars_3keV_1000kpc.hdf5
-stars_10keV_1000kpc.hdf5
-stars_30keV_1000kpc.hdf5
-
-#################################################
-# add additional information (age, magnitudes, html)
-
-./arrakihs_addfields.py -o stars_1keV_1000kpc.hdf5 stars_1keV_1000kpc.hdf5
-./arrakihs_addfields.py -o stars_3keV_1000kpc.hdf5 stars_3keV_1000kpc.hdf5
-./arrakihs_addfields.py -o stars_10keV_1000kpc.hdf5 stars_10keV_1000kpc.hdf5
-./arrakihs_addfields.py -o stars_30keV_1000kpc.hdf5 stars_30keV_1000kpc.hdf5
-
-
-################################################
-# compute a set of images
-
-./arrakihs_compute_images.py --telescope arrakihs_vis --filter F475X --fov 5000 --distance 25 --frsp 0.25 --nlos 16 -o F475X_1keV.pkl stars_1keV_1000kpc.hdf5
-./arrakihs_compute_images.py --telescope arrakihs_vis --filter VISeuclid --fov 5000 --distance 25 --frsp 0.25 --nlos 16 -o VISeuclid_3keV.pkl stars_3keV_1000kpc.hdf5
-./arrakihs_compute_images.py --telescope arrakihs_vis --filter Yeuclid --fov 5000 --distance 25 --frsp 0.25 --nlos 16 -o Yeuclid_1keV.pkl stars_1keV_1000kpc.hdf5
-./arrakihs_compute_images.py --telescope arrakihs_vis --filter Jeuclid --fov 5000 --distance 25 --frsp 0.25 --nlos 16 -o Jeuclid_1keV.pkl stars_1keV_1000kpc.hdf5
-
-################################################
-# display or save images in the pkl file
-
-./arrakihs_show_images.py F475X_1keV.pkl -o F475X_1keV.png
-./arrakihs_show_images.py VISeuclid_3keV.pkl -o VISeuclid_3keV.png
-./arrakihs_show_images.py Yeuclid_1keV.pkl -o Yeuclid_1keV.png
-./arrakihs_show_images.py Jeuclid_1keV.pkl -o Jeuclid_1keV.png
-
-###############################################
-# compute and compare the fraction of illuminated pixels
-
-./arrakihs_compute_illuminated.py -o F475X_coverage_fraction.png F475X_1keV.pkl F475X_3keV.pkl F475X_10keV.pkl F475X_30keV.pkl
-./arrakihs_compute_illuminated.py -o VISeuclid_coverage_fraction.png VISeuclid_1keV.pkl VISeuclid_3keV.pkl VISeuclid_10keV.pkl VISeuclid_30keV.pkl
-./arrakihs_compute_illuminated.py -o Yeuclid_coverage_fraction.png Yeuclid_1keV.pkl Yeuclid_3keV.pkl Yeuclid_10keV.pkl Yeuclid_30keV.pkl
-./arrakihs_compute_illuminated.py -o Jeuclid_coverage_fraction.png Jeuclid_1keV.pkl Jeuclid_3keV.pkl Jeuclid_10keV.pkl Jeuclid_30keV.pkl
-
-
-
-
diff --git a/ParticlesToSurfaceBrightness/arrakihs_addfields.py b/ParticlesToSurfaceBrightness/arrakihs_addfields.py
deleted file mode 100755
index 102dfe5..0000000
--- a/ParticlesToSurfaceBrightness/arrakihs_addfields.py
+++ /dev/null
@@ -1,154 +0,0 @@
-#!/usr/bin/env python3
-
-import argparse
-import numpy as np
-from pNbody import *
-
-import stars_class
-
-
-####################################################################
-# option parser
-####################################################################
-
-description=""
-epilog =""""""
-
-parser = argparse.ArgumentParser(description=description,epilog=epilog,formatter_class=argparse.RawDescriptionHelpFormatter)
-
-
-parser.add_argument(action="store",
- dest="files",
- metavar='FILE',
- type=str,
- default=None,
- nargs='*',
- help='a file name')
-
-parser.add_argument("-o",
- action="store",
- type=str,
- dest="outputfilename",
- default=None,
- help="Name of the output file")
-
-####################################################################
-# main
-####################################################################
-
-
-if __name__ == '__main__':
-
- opt = parser.parse_args()
-
- for f in opt.files:
- nb = Nbody(f,ftype="arepo")
-
-
- # remove doublets
- u,idx = np.unique(nb.rxyz(),return_index=True)
- nb = nb.selectp(lst=nb.num[idx])
-
-
- ###################################
- # Stellar ages
- ###################################
- print("Compute ages...")
- nb.age = nb.StellarAge(units="Gyr")
- print("done.")
-
- ###################################
- # compute Hsml
- ###################################
- print("Compute Rsp...")
- #nb.set_tpe(0)
- #nb.InitSphParameters(DesNumNgb=32, MaxNumNgbDeviation=2)
- #nb.getTree()
- #nb.rsp = nb.get_rsp_approximation()
- #nb.set_tpe(4)
- nb.ComputeRsp(5)
- print("done.")
-
- ###################################
- # compute Magnitudes
- ###################################
- print("Compute magnitudes...")
- MH = nb.MH()
-
- # mass in Msol
- mass = nb.mass * 1e10
-
- # get the number of stars in each mass bin
- Nstars = stars_class.Stars_fun(mass,None,None, 'normed_3slope')
-
- ##############################
- # F475X magnitude
-
- M = stars_class.HST475X_fun(None,nb.age,MH)
- # convert to flux (ignore the zero point)
- F = 10**(-M/2.5)
- # sum the contribution of the mass bins
- F = np.sum(F*Nstars, axis=0)
- # compute the absolute magnitude in each pixel (as before we ignore the zero point)
- M = - 2.5*np.log10(F)
- nb.MagF475X = M
-
- ##############################
- # VIS Euclid magnitude
-
- M = stars_class.VISeuclid_fun(None,nb.age,MH)
- # convert to flux (ignore the zero point)
- F = 10**(-M/2.5)
- # sum the contribution of the mass bins
- F = np.sum(F*Nstars, axis=0)
- # compute the absolute magnitude in each pixel (as before we ignore the zero point)
- M = - 2.5*np.log10(F)
- nb.MagVISeuclid = M
-
- ##############################
- # Y Euclid magnitude
-
- M = stars_class.Yeuclid_fun(None,nb.age,MH)
- # convert to flux (ignore the zero point)
- F = 10**(-M/2.5)
- # sum the contribution of the mass bins
- F = np.sum(F*Nstars, axis=0)
- # compute the absolute magnitude in each pixel (as before we ignore the zero point)
- M = - 2.5*np.log10(F)
- nb.MagYeuclid = M
-
- ##############################
- # J Euclid magnitude
-
- M = stars_class.Jeuclid_fun(None,nb.age,MH)
- # convert to flux (ignore the zero point)
- F = 10**(-M/2.5)
- # sum the contribution of the mass bins
- F = np.sum(F*Nstars, axis=0)
- # compute the absolute magnitude in each pixel (as before we ignore the zero point)
- M = - 2.5*np.log10(F)
- nb.MagJeuclid = M
-
-
- print("done.")
-
-
- if opt.outputfilename:
- nb.rename(opt.outputfilename)
- nb.write()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/ParticlesToSurfaceBrightness/arrakihs_compute_illuminated.py b/ParticlesToSurfaceBrightness/arrakihs_compute_illuminated.py
deleted file mode 100755
index 45c31d6..0000000
--- a/ParticlesToSurfaceBrightness/arrakihs_compute_illuminated.py
+++ /dev/null
@@ -1,180 +0,0 @@
-#!/usr/bin/env python3
-
-import numpy as np
-
-from astropy import constants as cte
-from astropy import units as u
-
-import argparse
-
-import matplotlib.pyplot as plt
-import matplotlib.colors as mcolors
-
-from pNbody import *
-from pNbody import ic
-import ARRAKIHS
-
-import pickle
-
-
-####################################################################
-# option parser
-####################################################################
-
-description=""
-epilog =""""""
-
-parser = argparse.ArgumentParser(description=description,epilog=epilog,formatter_class=argparse.RawDescriptionHelpFormatter)
-
-
-
-
-
-parser.add_argument(action="store",
- dest="files",
- metavar='FILE',
- type=str,
- default=None,
- nargs='*',
- help='a file name')
-
-parser.add_argument("-o",
- action="store",
- type=str,
- dest="outputfilename",
- default=None,
- help="Name of the output file")
-
-
-
-parser.add_argument('--mlim',
- action="store",
- dest="mlim",
- metavar='FLOAT',
- type=float,
- default=31,
- help='magnitude limit')
-
-
-
-
-
-parser.add_argument("--mlmin",
- action="store",
- dest="mlmin",
- metavar='FLOAT',
- type=float,
- default=None,
- help='mag lim min')
-
-parser.add_argument("--mlmax",
- action="store",
- dest="mlmax",
- metavar='FLOAT',
- type=float,
- default=None,
- help='mag lim max')
-
-parser.add_argument("--nlos",
- action="store",
- dest="nlos",
- metavar='INT',
- type=int,
- default=1,
- help='number of los')
-
-
-
-
-####################################################################
-# main
-####################################################################
-
-cs = ['r','g','b','y']
-nmagbins = 50
-mag0 = 33
-magmax = mag0
-
-if __name__ == '__main__':
-
- opt = parser.parse_args()
-
-
- for j,f in enumerate(opt.files):
-
- print(f)
-
- fd = open(f,"rb")
- images = pickle.load(fd)
- fd.close()
-
- # loop over images of the same model
-
- Npixs = np.zeros((len(images),nmagbins))
-
-
- for k in range(len(images)):
-
- image,xmin,xmax,ymin,ymax = images[k]
-
-
- Npixtot = image.shape[0]*image.shape[1]
-
- # clean
- image = np.where(np.isinf(image),100,image)
-
-
-
- magbins = np.linspace(26,magmax,nmagbins)
- Npix = np.zeros(nmagbins)
-
- for i in tqdm(range(nmagbins)):
- img1 = np.where(image<magbins[i],1,0)
- Npix[i] = np.ravel(img1).sum()
-
- # normalize
- #Npix = Npix/Npixtot
- #idx = np.argmin(np.fabs(magbins - mag0))
- #Npix = Npix/Npix[idx]
- Npix = Npix/Npixtot
-
-
-
- #plt.plot(magbins,Npix,color=cs[j])
-
-
- # sum
- Npixs[k] = Npix
-
-
-
- mean = Npixs.mean(axis=0)
- std = Npixs.std(axis=0)
-
- label = os.path.basename(f)
- label = label[label.find("_")+1:]
- label = label[:-4]
-
-
- plt.plot(magbins,mean,color=cs[j],label=r"$%s$"%label,lw=2)
- #plt.plot(magbins,mean+1*std,color=cs[j],lw=5)
- #plt.plot(magbins,mean-1*std,color=cs[j],lw=5)
-
- ax = plt.gca()
- ax.fill_between(magbins,mean+1*std,mean-1*std,facecolor=cs[j],alpha=0.1)
-
-
-
- plt.legend()
- plt.xlabel(r"$\rm{VIS}\,\,\rm{magnitude}$")
- plt.ylabel(r"$\rm{coverage\,\,fraction}$")
-
- if opt.outputfilename is None:
- plt.show()
- else:
- plt.savefig(opt.outputfilename)
-
-
-
-
-
diff --git a/ParticlesToSurfaceBrightness/arrakihs_compute_images.py b/ParticlesToSurfaceBrightness/arrakihs_compute_images.py
deleted file mode 100755
index e8a3055..0000000
--- a/ParticlesToSurfaceBrightness/arrakihs_compute_images.py
+++ /dev/null
@@ -1,294 +0,0 @@
-#!/usr/bin/env python3
-
-import numpy as np
-
-from astropy import constants as cte
-from astropy import units as u
-
-import argparse
-
-import matplotlib.pyplot as plt
-import matplotlib.colors as mcolors
-
-from pNbody import *
-from pNbody import ic
-import ARRAKIHS
-
-import pickle
-
-
-####################################################################
-# option parser
-####################################################################
-
-description=""
-epilog =""""""
-
-parser = argparse.ArgumentParser(description=description,epilog=epilog,formatter_class=argparse.RawDescriptionHelpFormatter)
-
-
-
-
-
-parser.add_argument(action="store",
- dest="file",
- metavar='FILE',
- type=str,
- default=None,
- nargs='*',
- help='a file name')
-
-parser.add_argument("-o",
- action="store",
- type=str,
- dest="outputfilename",
- default=None,
- help="Name of the output file")
-
-
-parser.add_argument("--ccd_shape",
- action="store",
- dest="ccd_shape",
- metavar='INT INT',
- type=int,
- default=[4096,4096],
- nargs=2,
- help='ccd shape')
-
-parser.add_argument("--size",
- action="store",
- dest="size",
- metavar='INT INT',
- type=int,
- default=None,
- nargs=2,
- help='image size')
-
-
-
-parser.add_argument("--ccd_size",
- action="store",
- dest="ccd_size",
- metavar='FLOAT FLOAT',
- type=float,
- default=[1.5,1.5],
- nargs=2,
- help='ccd size in degree')
-
-
-parser.add_argument("--ccd_field_fraction",
- action="store",
- dest="ccd_field_fraction",
- metavar='FLOAT',
- type=float,
- default=1,
- help='fraction of the field displayed')
-
-
-parser.add_argument("--fov",
- action="store",
- dest="fov",
- metavar='FLOAT',
- type=float,
- default=None,
- help='field of view in arcsec')
-
-
-
-parser.add_argument("--psf",
- action="store",
- dest="psf",
- metavar='FLOAT',
- type=float,
- default=0.8,
- help='psf in arcsec')
-
-
-parser.add_argument("--convolve",
- action="store_true",
- dest="convolve",
- default=False,
- help='convolve with the pdf')
-
-
-parser.add_argument('--distance',
- action="store",
- dest="distance",
- metavar='FLOAT',
- type=float,
- default=20,
- help='distance of the object in Mpc')
-
-
-
-parser.add_argument('--mlim',
- action="store",
- dest="mlim",
- metavar='FLOAT',
- type=float,
- default=31,
- help='magnitude limit')
-
-
-parser.add_argument("--sky_background",
- action="store_true",
- dest="sky_background",
- default=False,
- help='add sky background')
-
-
-parser.add_argument("--sky_N",
- action="store",
- dest="sky_N",
- metavar='FLOAT',
- type=float,
- default=1e6,
- help='number of particles in the sky')
-
-parser.add_argument("--sky_M",
- action="store",
- dest="sky_M",
- metavar='FLOAT',
- type=float,
- default=3.4e5,
- help='total sky mass [Msol]')
-
-parser.add_argument("--sky_e",
- action="store",
- dest="sky_e",
- metavar='FLOAT',
- type=float,
- default=3,
- help='sky size [kpc]')
-
-parser.add_argument("--sky_mean",
- action="store",
- dest="sky_mean",
- metavar='FLOAT',
- type=float,
- default=34,
- help='sky mean surface brighness')
-
-
-
-parser.add_argument("--telescope",
- action="store",
- dest="telescope",
- metavar='STR',
- type=str,
- default='arrakihs_vis',
- help='telescope name')
-
-parser.add_argument("--filter",
- action="store",
- dest="filter",
- metavar='STR',
- type=str,
- default=None,
- help='filter name')
-
-
-parser.add_argument("--toMsol",
- action="store",
- dest="toMsol",
- metavar='FLOAT',
- type=float,
- default=1e10,
- help='mass convertion to solar mass')
-
-parser.add_argument("--frsp",
- action="store",
- dest="frsp",
- metavar='FLOAT',
- type=float,
- default=0,
- help='factor for the image smoothing')
-
-
-parser.add_argument("--view",
- action="store",
- dest="view",
- metavar='STR',
- type=str,
- default='xy',
- help='view xy, yz, zx')
-
-parser.add_argument("--mlmin",
- action="store",
- dest="mlmin",
- metavar='FLOAT',
- type=float,
- default=None,
- help='mag lim min')
-
-parser.add_argument("--mlmax",
- action="store",
- dest="mlmax",
- metavar='FLOAT',
- type=float,
- default=None,
- help='mag lim max')
-
-parser.add_argument("--nlos",
- action="store",
- dest="nlos",
- metavar='INT',
- type=int,
- default=1,
- help='number of los')
-
-
-
-
-####################################################################
-# main
-####################################################################
-
-def get_axes(n=7,irand=0):
-
- np.random.seed(irand)
- random2 = np.random.random(n)
- random3 = np.random.random(n)
-
- phi = random2 * np.pi * 2.
- costh = 1. - 2. * random3
-
- sinth = np.sqrt(1. - costh**2)
-
- x = sinth * np.cos(phi)
- y = sinth * np.sin(phi)
- z = costh
-
- pos = np.transpose(np.array([x, y, z]))
-
- return pos
-
-
-
-
-if __name__ == '__main__':
-
- opt = parser.parse_args()
-
- naxes = opt.nlos
- axes = get_axes(naxes)
-
-
- ARRAKIHS.SetTelecope(opt)
-
- images = []
-
- # loop over axes
- for i in range(naxes):
- opt.los=axes[i]
- image = ARRAKIHS.Project(opt) # here we get: image,xmin,xmax,ymin,ymax
- images.append(image)
-
-
- if opt.outputfilename is not None:
-
- f = open(opt.outputfilename,'wb')
- pickle.dump(images,f)
- f.close()
-
-
diff --git a/ParticlesToSurfaceBrightness/arrakihs_show_images.py b/ParticlesToSurfaceBrightness/arrakihs_show_images.py
deleted file mode 100755
index 1ef266a..0000000
--- a/ParticlesToSurfaceBrightness/arrakihs_show_images.py
+++ /dev/null
@@ -1,203 +0,0 @@
-#!/usr/bin/env python3
-
-import numpy as np
-
-from astropy import constants as cte
-from astropy import units as u
-
-import argparse
-
-import matplotlib.pyplot as plt
-import matplotlib.colors as mcolors
-
-from pNbody import *
-from pNbody import ic
-import ARRAKIHS
-
-import pickle
-import os
-
-####################################################################
-# option parser
-####################################################################
-
-description=""
-epilog =""""""
-
-parser = argparse.ArgumentParser(description=description,epilog=epilog,formatter_class=argparse.RawDescriptionHelpFormatter)
-
-
-
-
-
-parser.add_argument(action="store",
- dest="file",
- metavar='FILE',
- type=str,
- default=None,
- nargs='*',
- help='a file name')
-
-parser.add_argument("-o",
- action="store",
- type=str,
- dest="outputfilename",
- default=None,
- help="Name of the output file")
-
-
-
-
-
-
-parser.add_argument('--mlim',
- action="store",
- dest="mlim",
- metavar='FLOAT',
- type=float,
- default=31,
- help='magnitude limit')
-
-
-
-
-
-parser.add_argument("--mlmin",
- action="store",
- dest="mlmin",
- metavar='FLOAT',
- type=float,
- default=None,
- help='mag lim min')
-
-parser.add_argument("--mlmax",
- action="store",
- dest="mlmax",
- metavar='FLOAT',
- type=float,
- default=None,
- help='mag lim max')
-
-parser.add_argument("--nlos",
- action="store",
- dest="nlos",
- metavar='INT',
- type=int,
- default=1,
- help='number of los')
-
-
-parser.add_argument("--filter",
- action="store",
- dest="filter",
- metavar='STR',
- type=str,
- default=None,
- help='filter name')
-
-
-parser.add_argument("--MDM",
- action="store",
- dest="MDM",
- metavar='FLOAT',
- type=float,
- default=1,
- help='dark mattermass')
-
-
-
-####################################################################
-# main
-####################################################################
-
-
-if __name__ == '__main__':
-
- opt = parser.parse_args()
-
-
- if len(opt.file)==0:
- print("need to provie one file")
- exit()
-
-
- f = open(opt.file[0],"rb")
- images = pickle.load(f)
- f.close()
-
- nx = int(np.sqrt(len(images)))
- ny = nx
-
-
- fig, ax = plt.subplots(nx,ny)
-
- # plot
- fig = plt.gcf()
- fig.set_size_inches(12*1.15, 12)
-
- fig.subplots_adjust(left=0.1)
- fig.subplots_adjust(right=1)
- fig.subplots_adjust(bottom=0.05)
- fig.subplots_adjust(top=0.95)
- fig.subplots_adjust(wspace=0.02)
- fig.subplots_adjust(hspace=0.02)
-
-
- colors2 = plt.cm.gist_heat(np.linspace(0.3, 1.0, 255))
- mymap = mcolors.LinearSegmentedColormap.from_list('my_colormap', colors2)
-
- for i in range(len(images)):
-
- image,xmin,xmax,ymin,ymax = images[i]
-
- #image = np.where(image>26,34,image)
-
-
- ix = i//nx
- iy = i- (ix*nx)
-
-
- #ax[i] = plt.gca()
- ax[ix,iy].set_aspect('equal')
-
- mmin = 24
- mmax = 33
-
- im = ax[ix,iy].imshow(image,aspect='equal',extent=(xmin,xmax,ymin,ymax),interpolation=None,vmin=mmin,vmax=mmax,cmap=mymap)
- #ax[ix,iy].contour(image,levels=[26],colors='r')
-
-
- ax[ix,iy].set_xlabel(r"$x\,[\rm{kpc}]$")
- ax[ix,iy].set_ylabel(r"$y\,[\rm{kpc}]$")
-
-
- if i != nx*(ny-1):
- ax[ix,iy].get_xaxis().set_visible(False)
- ax[ix,iy].get_yaxis().set_visible(False)
- ax[ix,iy].get_xaxis().set_ticks([])
- ax[ix,iy].get_yaxis().set_ticks([])
-
-
- plt.colorbar(im,label="surface brightness [mag/arcsec]",ax=ax)
-
- basename = os.path.basename(opt.file[0])
- opt.filter = basename.split("_")[0]
- opt.MDM = basename.split("_")[1].split("keV")[0]
-
- txt = r"$\rm{%s}\,\,:\,\,%s\,\rm{keV}$"%(opt.filter,opt.MDM)
- fig.suptitle(txt,fontsize=20)
-
-
-
-
- if opt.outputfilename:
- plt.savefig(opt.outputfilename)
- else:
- plt.show()
-
-
-
-
-
-
-
diff --git a/ParticlesToSurfaceBrightness/stars_class.py b/ParticlesToSurfaceBrightness/stars_class.py
deleted file mode 100644
index 811eda3..0000000
--- a/ParticlesToSurfaceBrightness/stars_class.py
+++ /dev/null
@@ -1,1449 +0,0 @@
-import numpy as np
-from IMF import *
-
-
-
-def Stars_fun(mass, age, metals, imf = 'normed_3slope'):
- """
- This function calculates the number of stars for a given stellar mass particle, for different IMFs:
- Parameters
- -------
- mass: numpy array.
- Mass of the particle.
- age: numpy array.
- Age of the particle
- metals: numpy array.
- Metallicity of the particle [M/H]
- imf: str.
- Initial Mass Function. Eligible: 'normed_3slope', 'Chabier_1', 'Chabier_2', 'sapeter' or 'BrokenPowerLaw'. By default: 'normed_3slope'.
-
- """
- init_imf=IMF(mmin=0.05, mmax=100.0, intervals=5000)
- if imf=='Chabrier_1':
- IMF_type=init_imf.Chabrier_1() # Chabrier_1() # Chabrier_2(), salpeter(), BrokenPowerLaw(),
- # normed_3slope() that is Kroupa.
- if imf=='Chabrier_2':
- IMF_type=init_imf.Chabrier_2()
-
- if imf=='salpeter':
- IMF_type=init_imf.salpeter()
-
- if imf=='normed_3slope':
- IMF_type=init_imf.normed_3slope()
-
-
- M1=init_imf.imf_mass_fraction(0.0,0.1)
- M2=init_imf.imf_mass_fraction(0.1,0.2)
- M3=init_imf.imf_mass_fraction(0.2,0.3)
- M4=init_imf.imf_mass_fraction(0.3,0.4)
- M5=init_imf.imf_mass_fraction(0.4,0.5)
- M6=init_imf.imf_mass_fraction(0.5,0.6)
- M7=init_imf.imf_mass_fraction(0.6,0.7)
- M8=init_imf.imf_mass_fraction(0.7,0.8)
- M9=init_imf.imf_mass_fraction(0.8,0.9)
- M10=init_imf.imf_mass_fraction(0.9,1)
- M11=init_imf.imf_mass_fraction(1,2)
- M12=init_imf.imf_mass_fraction(2,3)
- M13=init_imf.imf_mass_fraction(3,4)
- M14=init_imf.imf_mass_fraction(4,5)
- M15=init_imf.imf_mass_fraction(5,6)
- M16=init_imf.imf_mass_fraction(6,7)
- M17=init_imf.imf_mass_fraction(7,8)
- M18=init_imf.imf_mass_fraction(8,101.)
-
-
-
- n_1=[M1*i/0.1 for i in mass]
- n_2=[M2*i/0.2 for i in mass]
- n_3=[M3*i/0.3 for i in mass]
- n_4=[M4*i/0.4 for i in mass]
- n_5=[M5*i/0.5 for i in mass]
- n_6=[M6*i/0.6 for i in mass]
- n_7=[M7*i/0.7 for i in mass]
- n_8=[M8*i/0.8 for i in mass]
- n_9=[M9*i/0.9 for i in mass]
- n_10=[M10*i/1 for i in mass]
- n_11=[M11*i/2 for i in mass]
- n_12=[M12*i/3 for i in mass]
- n_13=[M13*i/4 for i in mass]
- n_14=[M14*i/5 for i in mass]
- n_15=[M15*i/6 for i in mass]
- n_16=[M16*i/7 for i in mass]
- n_17=[M17*i/8 for i in mass]
- n_18=[M18*i/100 for i in mass]
-
-
- return np.array([n_1,n_2, n_3,n_4,n_5,n_6, n_7,n_8,n_9,n_10, n_11, n_12,n_13, n_14, n_15,n_16,n_17,n_18])
-
-
-def Temp_fun(mass, age, metals):
- '''''''''''''''
- This function calculates the temperature of stars from the synthetic CMD:
- Parameters
- -------
- mass: numpy array.
- Mass of the particle.
- age: numpy array.
- Age of the particle
- metals: numpy array.
- '''''''''''''''
- Isoc=np.genfromtxt('./Isochrones/new_CMDs/Isoc_new_euclid.txt',comments='#')
- MH,logAge,Mini,Te,logL=Isoc[:,0],Isoc[:,1],Isoc[:,2],Isoc[:,3],Isoc[:,4]
- # Difererentes edades de las estrellas del cmd
- logAge_iter=[0]
- logAge_iter[0]=logAge[0]
- j=0
- for i in range(0,len(logAge)-1):
- if (logAge_iter[j] != logAge[i]) & (logAge_iter[j] <= logAge[i]):
- j=j+1
- logAge_iter.append(logAge[i])
-
- # Difererentes metalicidades de las estrellas del cmd
- MH_iter=[0]
- MH_iter[0]=MH[0]
- j=0
- for i in range(0,len(MH)-1):
- if MH_iter[j] != MH[i]:
- j=j+1
- MH_iter.append(MH[i])
-
- met_l = np.unique(MH)
- age_l = np.unique(logAge)
- Mass_l = np.unique(Mini)
- met_len=len(met_l)-1
- age_len=len(age_l)-1
- mass_len=len(Mass_l)-1
-
- m=((age_len)*((age*1e9-10**np.min(age_l))/(10**np.max(age_l)-10**np.min(age_l)))).round(0).astype(int)
- m[m<0]=0
- m[m>=age_len]=age_len
-
-
- j=((met_len)*(metals-np.min(met_l))/(np.max(met_l)-np.min(met_l))).astype(int)
-
- j[j<0]=0
- j[j>=met_len]=met_len
-
- k=(j*(age_len+1)*(mass_len+1)+m*(mass_len+1))
-
- t1=Te[k+1]
- t2=Te[k+2]
- t3=Te[k+3]
- t4=Te[k+4]
- t5=Te[k+5]
- t6=Te[k+6]
- t7=Te[k+7]
- t8=Te[k+8]
- t9=Te[k+9]
- t10=Te[k+10]
- t11=Te[k+11]
- t12=Te[k+12]
- t13=Te[k+13]
- t14=Te[k+14]
- t15=Te[k+15]
- t16=Te[k+16]
- t17=Te[k+17]
- t18=Te[k+18]
-
-
- return t1,t2,t3,t4,t5,t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18
-
-
-
-def Luminosity_fun(mass, age, metals):
- '''''''''''''''
- This function calculates the intrinsic luminosity of stars from the synthetic CMD:
- Parameters
- -------
- mass: numpy array.
- Mass of the particle.
- age: numpy array.
- Age of the particle
- metals: numpy array.
- '''''''''''''''
- Isoc=np.genfromtxt('./Isochrones/new_CMDs/Isoc_new_euclid.txt',comments='#')
- MH,logAge,Mini,Te,logL=Isoc[:,0],Isoc[:,1],Isoc[:,2],Isoc[:,3],Isoc[:,4]
- # Difererentes edades de las estrellas del cmd
-
- logAge_iter=[0]
- logAge_iter[0]=logAge[0]
- j=0
- for i in range(0,len(logAge)-1):
- if (logAge_iter[j] != logAge[i]) & (logAge_iter[j] <= logAge[i]):
- j=j+1
- logAge_iter.append(logAge[i])
-
- # Difererentes metalicidades de las estrellas del cmd
- MH_iter=[0]
- MH_iter[0]=MH[0]
- j=0
- for i in range(0,len(MH)-1):
- if MH_iter[j] != MH[i]:
- j=j+1
- MH_iter.append(MH[i])
-
- met_l = np.unique(MH)
- age_l = np.unique(logAge)
- Mass_l = np.unique(Mini)
- met_len=len(met_l)-1
- age_len=len(age_l)-1
- mass_len=len(Mass_l)-1
-
-
- m=((age_len)*((age*1e9-10**np.min(age_l))/(10**np.max(age_l)-10**np.min(age_l)))).round(0).astype(int)
- m[m<0]=0
- m[m>=age_len]=age_len
-
-
- j=((met_len)*(metals-np.min(met_l))/(np.max(met_l)-np.min(met_l))).astype(int)
-
- j[j<0]=0
- j[j>=met_len]=met_len
-
- k=(j*(age_len+1)*(mass_len+1)+m*(mass_len+1))
-
-
- l1=10**logL[k+1]
- l2=10**logL[k+2]
- l3=10**logL[k+3]
- l4=10**logL[k+4]
- l5=10**logL[k+5]
- l6=10**logL[k+6]
- l7=10**logL[k+7]
- l8=10**logL[k+8]
- l9=10**logL[k+9]
- l10=10**logL[k+10]
- l11=10**logL[k+11]
- l12=10**logL[k+12]
- l13=10**logL[k+13]
- l14=10**logL[k+14]
- l15=10**logL[k+15]
- l16=10**logL[k+16]
- l17=10**logL[k+17]
- l18=10**logL[k+18]
-
-
- return l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12, l13,l14,l15,l16,l17,l18
-
-
-#####################################
-########## HST FUNCTIONS
-#####################################
-
-
-
-
-def HST475X_fun(mass, age, metals):
- '''''''''''''''
- This function calculates the magnitude on HST-F475X from WFC3 of stars from the synthetic CMD:
- Parameters
- -------
- mass: numpy array.
- Mass of the particle.
- age: numpy array.
- Age of the particle
- metals: numpy array.
- '''''''''''''''
- Isoc=np.genfromtxt('./Isochrones/new_CMDs/Isoc_new_hst_wfc3.txt',comments='#')
- MH,logAge,Mini,Te,logL, HST475Xmag=Isoc[:,0],Isoc[:,1],Isoc[:,2],Isoc[:,3],Isoc[:,4], Isoc[:,5]
- # Difererentes edades de las estrellas del cmd
-
- logAge_iter=[0]
- logAge_iter[0]=logAge[0]
- j=0
- for i in range(0,len(logAge)-1):
- if (logAge_iter[j] != logAge[i]) & (logAge_iter[j] <= logAge[i]):
- j=j+1
- logAge_iter.append(logAge[i])
-
-
-
- # Difererentes metalicidades de las estrellas del cmd
- MH_iter=[0]
- MH_iter[0]=MH[0]
- j=0
- for i in range(0,len(MH)-1):
- if MH_iter[j] != MH[i]:
- j=j+1
- MH_iter.append(MH[i])
-
-
- met_l = np.unique(MH)
- age_l = np.unique(logAge)
- Mass_l = np.unique(Mini)
-
- met_len=len(met_l)-1
- age_len=len(age_l)-1
- mass_len=len(Mass_l)-1
-
- # yr: the following lines gives the wrong results !!!
- '''
- m=((age_len)*((age*1e9-10**np.min(age_l))/(10**np.max(age_l)-10**np.min(age_l)))).round(0).astype(int)
- m[m<0]=0
- m[m>=age_len]=age_len
-
- j=((met_len)*(metals-np.min(met_l))/(np.max(met_l)-np.min(met_l))).astype(int)
- j[j<0]=0
- j[j>=met_len]=met_len
-
- k=(j*(age_len+1)*(mass_len+1)+m*(mass_len+1))
- '''
-
- # yr
- get_age_idx = np.vectorize(lambda x:np.argmin( np.fabs( x*1e9 -10**age_l )))
- get_met_idx = np.vectorize(lambda x:np.argmin( np.fabs( x -met_l )))
-
- idx_age = get_age_idx(age)
- idx_met = get_met_idx(metals)
-
- k=(idx_met*(age_len+1)*(mass_len+1)+idx_age*(mass_len+1))
- k = k-1 # really ???
-
-
-
- l1 = HST475Xmag[k+1]
- l2 = HST475Xmag[k+2]
- l3 = HST475Xmag[k+3]
- l4 = HST475Xmag[k+4]
- l5 = HST475Xmag[k+5]
- l6 = HST475Xmag[k+6]
- l7 = HST475Xmag[k+7]
- l8 = HST475Xmag[k+8]
- l9 = HST475Xmag[k+9]
- l10 = HST475Xmag[k+10]
- l11 = HST475Xmag[k+11]
- l12 = HST475Xmag[k+12]
- l13 = HST475Xmag[k+13]
- l14 = HST475Xmag[k+14]
- l15 = HST475Xmag[k+15]
- l16 = HST475Xmag[k+16]
- l17 = HST475Xmag[k+17]
- l18 = HST475Xmag[k+18]
-
- return np.array([l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12, l13,l14,l15,l16,l17,l18])
-
-
-
-#####################################
-########## EUCLID FUNCTIONS
-#####################################
-
-def VISeuclid_fun(mass, age, metals):
- '''''''''''''''
- This function calculates the magnitude on Euclid-VIS of stars from the synthetic CMD:
- Parameters
- -------
- mass: numpy array.
- Mass of the particle.
- age: numpy array.
- Age of the particle
- metals: numpy array.
- '''''''''''''''
- Isoc=np.genfromtxt('./Isochrones/new_CMDs/Isoc_new_euclid.txt',comments='#')
- MH,logAge,Mini,Te,logL, VISmag = Isoc[:,0],Isoc[:,1],Isoc[:,2],Isoc[:,3],Isoc[:,4], Isoc[:,5]
- # Difererentes edades de las estrellas del cmd
-
- logAge_iter=[0]
- logAge_iter[0]=logAge[0]
- j=0
- for i in range(0,len(logAge)-1):
- if (logAge_iter[j] != logAge[i]) & (logAge_iter[j] <= logAge[i]):
- j=j+1
- logAge_iter.append(logAge[i])
-
- # Difererentes metalicidades de las estrellas del cmd
- MH_iter=[0]
- MH_iter[0]=MH[0]
- j=0
- for i in range(0,len(MH)-1):
- if MH_iter[j] != MH[i]:
- j=j+1
- MH_iter.append(MH[i])
-
- met_l = np.unique(MH)
- age_l = np.unique(logAge)
- Mass_l = np.unique(Mini)
- met_len=len(met_l)-1
- age_len=len(age_l)-1
- mass_len=len(Mass_l)-1
-
- # yr: the following lines gives the wrong results !!!
- '''
- m=((age_len)*((age*1e9-10**np.min(age_l))/(10**np.max(age_l)-10**np.min(age_l)))).round(0).astype(int)
- m[m<0]=0
- m[m>=age_len]=age_len
-
- j=((met_len)*(metals-np.min(met_l))/(np.max(met_l)-np.min(met_l))).astype(int)
- j[j<0]=0
- j[j>=met_len]=met_len
-
- k=(j*(age_len+1)*(mass_len+1)+m*(mass_len+1))
- '''
-
- # yr
- get_age_idx = np.vectorize(lambda x:np.argmin( np.fabs( x*1e9 -10**age_l )))
- get_met_idx = np.vectorize(lambda x:np.argmin( np.fabs( x -met_l )))
-
- idx_age = get_age_idx(age)
- idx_met = get_met_idx(metals)
-
- k=(idx_met*(age_len+1)*(mass_len+1)+idx_age*(mass_len+1))
- k = k-1 # really ???
-
-
-
- l1 = VISmag[k+1]
- l2 = VISmag[k+2]
- l3 = VISmag[k+3]
- l4 = VISmag[k+4]
- l5 = VISmag[k+5]
- l6 = VISmag[k+6]
- l7 = VISmag[k+7]
- l8 = VISmag[k+8]
- l9 = VISmag[k+9]
- l10 = VISmag[k+10]
- l11 = VISmag[k+11]
- l12 = VISmag[k+12]
- l13 = VISmag[k+13]
- l14 = VISmag[k+14]
- l15 = VISmag[k+15]
- l16 = VISmag[k+16]
- l17 = VISmag[k+17]
- l18 = VISmag[k+18]
-
-
- return np.array([l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12, l13,l14,l15,l16,l17,l18])
-
-
-
-def Yeuclid_fun(mass, age, metals):
- '''''''''''''''
- This function calculates the magnitude on Euclid-Y of stars from the synthetic CMD:
- Parameters
- -------
- mass: numpy array.
- Mass of the particle.
- age: numpy array.
- Age of the particle
- metals: numpy array.
- '''''''''''''''
- Isoc=np.genfromtxt('./Isochrones/new_CMDs/Isoc_new_euclid.txt',comments='#')
- MH,logAge,Mini,Te,logL, Ymag = Isoc[:,0],Isoc[:,1],Isoc[:,2],Isoc[:,3],Isoc[:,4], Isoc[:,7]
- # Difererentes edades de las estrellas del cmd
-
- logAge_iter=[0]
- logAge_iter[0]=logAge[0]
- j=0
- for i in range(0,len(logAge)-1):
- if (logAge_iter[j] != logAge[i]) & (logAge_iter[j] <= logAge[i]):
- j=j+1
- logAge_iter.append(logAge[i])
-
- # Difererentes metalicidades de las estrellas del cmd
- MH_iter=[0]
- MH_iter[0]=MH[0]
- j=0
- for i in range(0,len(MH)-1):
- if MH_iter[j] != MH[i]:
- j=j+1
- MH_iter.append(MH[i])
-
- met_l = np.unique(MH)
- age_l = np.unique(logAge)
- Mass_l = np.unique(Mini)
- met_len=len(met_l)-1
- age_len=len(age_l)-1
- mass_len=len(Mass_l)-1
-
- # yr: the following lines gives the wrong results !!!
- '''
- m=((age_len)*((age*1e9-10**np.min(age_l))/(10**np.max(age_l)-10**np.min(age_l)))).round(0).astype(int)
- m[m<0]=0
- m[m>=age_len]=age_len
-
- j=((met_len)*(metals-np.min(met_l))/(np.max(met_l)-np.min(met_l))).astype(int)
- j[j<0]=0
- j[j>=met_len]=met_len
-
- k=(j*(age_len+1)*(mass_len+1)+m*(mass_len+1))
- '''
-
- # yr
- get_age_idx = np.vectorize(lambda x:np.argmin( np.fabs( x*1e9 -10**age_l )))
- get_met_idx = np.vectorize(lambda x:np.argmin( np.fabs( x -met_l )))
-
- idx_age = get_age_idx(age)
- idx_met = get_met_idx(metals)
-
- k=(idx_met*(age_len+1)*(mass_len+1)+idx_age*(mass_len+1))
- k = k-1 # really ???
-
-
- l1 = Ymag[k+1]
- l2 = Ymag[k+2]
- l3 = Ymag[k+3]
- l4 = Ymag[k+4]
- l5 = Ymag[k+5]
- l6 = Ymag[k+6]
- l7 = Ymag[k+7]
- l8 = Ymag[k+8]
- l9 = Ymag[k+9]
- l10 = Ymag[k+10]
- l11 = Ymag[k+11]
- l12 = Ymag[k+12]
- l13 = Ymag[k+13]
- l14 = Ymag[k+14]
- l15 = Ymag[k+15]
- l16 = Ymag[k+16]
- l17 = Ymag[k+17]
- l18 = Ymag[k+18]
-
-
- return np.array([l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12, l13,l14,l15,l16,l17,l18])
-
-
-def Jeuclid_fun(mass, age, metals):
- '''''''''''''''
- This function calculates the magnitude on Euclid-J of stars from the synthetic CMD:
- Parameters
- -------
- mass: numpy array.
- Mass of the particle.
- age: numpy array.
- Age of the particle
- metals: numpy array.
- '''''''''''''''
- Isoc=np.genfromtxt('./Isochrones/new_CMDs/Isoc_new_euclid.txt',comments='#')
- MH,logAge,Mini,Te,logL, Jmag = Isoc[:,0],Isoc[:,1],Isoc[:,2],Isoc[:,3],Isoc[:,4], Isoc[:,6]
- # Difererentes edades de las estrellas del cmd
-
- logAge_iter=[0]
- logAge_iter[0]=logAge[0]
- j=0
- for i in range(0,len(logAge)-1):
- if (logAge_iter[j] != logAge[i]) & (logAge_iter[j] <= logAge[i]):
- j=j+1
- logAge_iter.append(logAge[i])
-
- # Difererentes metalicidades de las estrellas del cmd
- MH_iter=[0]
- MH_iter[0]=MH[0]
- j=0
- for i in range(0,len(MH)-1):
- if MH_iter[j] != MH[i]:
- j=j+1
- MH_iter.append(MH[i])
-
- met_l = np.unique(MH)
- age_l = np.unique(logAge)
- Mass_l = np.unique(Mini)
- met_len=len(met_l)-1
- age_len=len(age_l)-1
- mass_len=len(Mass_l)-1
-
- # yr: the following lines gives the wrong results !!!
- '''
- m=((age_len)*((age*1e9-10**np.min(age_l))/(10**np.max(age_l)-10**np.min(age_l)))).round(0).astype(int)
- m[m<0]=0
- m[m>=age_len]=age_len
-
- j=((met_len)*(metals-np.min(met_l))/(np.max(met_l)-np.min(met_l))).astype(int)
- j[j<0]=0
- j[j>=met_len]=met_len
-
- k=(j*(age_len+1)*(mass_len+1)+m*(mass_len+1))
- '''
-
- # yr
- get_age_idx = np.vectorize(lambda x:np.argmin( np.fabs( x*1e9 -10**age_l )))
- get_met_idx = np.vectorize(lambda x:np.argmin( np.fabs( x -met_l )))
-
- idx_age = get_age_idx(age)
- idx_met = get_met_idx(metals)
-
- k=(idx_met*(age_len+1)*(mass_len+1)+idx_age*(mass_len+1))
- k = k-1 # really ???
-
-
- l1 = Jmag[k+1]
- l2 = Jmag[k+2]
- l3 = Jmag[k+3]
- l4 = Jmag[k+4]
- l5 = Jmag[k+5]
- l6 = Jmag[k+6]
- l7 = Jmag[k+7]
- l8 = Jmag[k+8]
- l9 = Jmag[k+9]
- l10 = Jmag[k+10]
- l11 = Jmag[k+11]
- l12 = Jmag[k+12]
- l13 = Jmag[k+13]
- l14 = Jmag[k+14]
- l15 = Jmag[k+15]
- l16 = Jmag[k+16]
- l17 = Jmag[k+17]
- l18 = Jmag[k+18]
-
-
- return np.array([l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12, l13,l14,l15,l16,l17,l18])
-
-
-
-
-
-
-#####################################
-########## SLOAN FUNCTIONS
-#####################################
-
-
-def rsloan_fun(mass, age, metals):
- '''''''''''''''
- This function calculates the magnitude on sloan r of stars from the synthetic CMD:
- Parameters
- -------
- mass: numpy array.
- Mass of the particle.
- age: numpy array.
- Age of the particle
- metals: numpy array.
- '''''''''''''''
- Isoc=np.genfromtxt('./Isochrones/new_CMDs/Isoc_new_sloan.txt',comments='#')
- MH,logAge,Mini,Te,logL, rmag=Isoc[:,0],Isoc[:,1],Isoc[:,2],Isoc[:,3],Isoc[:,4], Isoc[:,5]
- # Difererentes edades de las estrellas del cmd
-
- logAge_iter=[0]
- logAge_iter[0]=logAge[0]
- j=0
- for i in range(0,len(logAge)-1):
- if (logAge_iter[j] != logAge[i]) & (logAge_iter[j] <= logAge[i]):
- j=j+1
- logAge_iter.append(logAge[i])
-
- # Difererentes metalicidades de las estrellas del cmd
- MH_iter=[0]
- MH_iter[0]=MH[0]
- j=0
- for i in range(0,len(MH)-1):
- if MH_iter[j] != MH[i]:
- j=j+1
- MH_iter.append(MH[i])
-
- met_l = np.unique(MH)
- age_l = np.unique(logAge)
- Mass_l = np.unique(Mini)
- met_len=len(met_l)-1
- age_len=len(age_l)-1
- mass_len=len(Mass_l)-1
-
-
- m=((age_len)*((age*1e9-10**np.min(age_l))/(10**np.max(age_l)-10**np.min(age_l)))).round(0).astype(int)
- m[m<0]=0
- m[m>=age_len]=age_len
-
-
- j=((met_len)*(metals-np.min(met_l))/(np.max(met_l)-np.min(met_l))).astype(int)
-
- j[j<0]=0
- j[j>=met_len]=met_len
-
- k=(j*(age_len+1)*(mass_len+1)+m*(mass_len+1))
-
-
- l1 = rmag[k+1]
- l2 = rmag[k+2]
- l3 = rmag[k+3]
- l4 = rmag[k+4]
- l5 = rmag[k+5]
- l6 = rmag[k+6]
- l7 = rmag[k+7]
- l8 = rmag[k+8]
- l9 = rmag[k+9]
- l10 = rmag[k+10]
- l11 = rmag[k+11]
- l12 = rmag[k+12]
- l13 = rmag[k+13]
- l14 = rmag[k+14]
- l15 = rmag[k+15]
- l16 = rmag[k+16]
- l17 = rmag[k+17]
- l18 = rmag[k+18]
-
-
- return np.array([l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12, l13,l14,l15,l16,l17,l18])
-
-
-def gsloan_fun(mass, age, metals):
- '''''''''''''''
- This function calculates the magnitude on sloan g of stars from the synthetic CMD:
- Parameters
- -------
- mass: numpy array.
- Mass of the particle.
- age: numpy array.
- Age of the particle
- metals: numpy array.
- '''''''''''''''
- Isoc=np.genfromtxt('./Isochrones/new_CMDs/Isoc_new_sloan.txt',comments='#')
- MH,logAge,Mini,Te,logL, gmag=Isoc[:,0],Isoc[:,1],Isoc[:,2],Isoc[:,3],Isoc[:,4], Isoc[:,6]
- # Difererentes edades de las estrellas del cmd
-
- logAge_iter=[0]
- logAge_iter[0]=logAge[0]
- j=0
- for i in range(0,len(logAge)-1):
- if (logAge_iter[j] != logAge[i]) & (logAge_iter[j] <= logAge[i]):
- j=j+1
- logAge_iter.append(logAge[i])
-
- # Difererentes metalicidades de las estrellas del cmd
- MH_iter=[0]
- MH_iter[0]=MH[0]
- j=0
- for i in range(0,len(MH)-1):
- if MH_iter[j] != MH[i]:
- j=j+1
- MH_iter.append(MH[i])
-
- met_l = np.unique(MH)
- age_l = np.unique(logAge)
- Mass_l = np.unique(Mini)
- met_len=len(met_l)-1
- age_len=len(age_l)-1
- mass_len=len(Mass_l)-1
-
-
- m=((age_len)*((age*1e9-10**np.min(age_l))/(10**np.max(age_l)-10**np.min(age_l)))).round(0).astype(int)
- m[m<0]=0
- m[m>=age_len]=age_len
-
-
- j=((met_len)*(metals-np.min(met_l))/(np.max(met_l)-np.min(met_l))).astype(int)
-
- j[j<0]=0
- j[j>=met_len]=met_len
-
- k=(j*(age_len+1)*(mass_len+1)+m*(mass_len+1))
-
-
- l1 = gmag[k+1]
- l2 = gmag[k+2]
- l3 = gmag[k+3]
- l4 = gmag[k+4]
- l5 = gmag[k+5]
- l6 = gmag[k+6]
- l7 = gmag[k+7]
- l8 = gmag[k+8]
- l9 = gmag[k+9]
- l10 = gmag[k+10]
- l11 = gmag[k+11]
- l12 = gmag[k+12]
- l13 = gmag[k+13]
- l14 = gmag[k+14]
- l15 = gmag[k+15]
- l16 = gmag[k+16]
- l17 = gmag[k+17]
- l18 = gmag[k+18]
-
-
- return np.array([l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12, l13,l14,l15,l16,l17,l18])
-
-
-def isloan_fun(mass, age, metals):
- '''''''''''''''
- This function calculates the magnitude on sloan g of stars from the synthetic CMD:
- Parameters
- -------
- mass: numpy array.
- Mass of the particle.
- age: numpy array.
- Age of the particle
- metals: numpy array.
- '''''''''''''''
- Isoc=np.genfromtxt('./Isochrones/new_CMDs/Isoc_new_sloan.txt',comments='#')
- MH,logAge,Mini,Te,logL, imag=Isoc[:,0],Isoc[:,1],Isoc[:,2],Isoc[:,3],Isoc[:,4], Isoc[:,7]
- # Difererentes edades de las estrellas del cmd
-
- logAge_iter=[0]
- logAge_iter[0]=logAge[0]
- j=0
- for i in range(0,len(logAge)-1):
- if (logAge_iter[j] != logAge[i]) & (logAge_iter[j] <= logAge[i]):
- j=j+1
- logAge_iter.append(logAge[i])
-
- # Difererentes metalicidades de las estrellas del cmd
- MH_iter=[0]
- MH_iter[0]=MH[0]
- j=0
- for i in range(0,len(MH)-1):
- if MH_iter[j] != MH[i]:
- j=j+1
- MH_iter.append(MH[i])
-
- met_l = np.unique(MH)
- age_l = np.unique(logAge)
- Mass_l = np.unique(Mini)
- met_len=len(met_l)-1
- age_len=len(age_l)-1
- mass_len=len(Mass_l)-1
-
-
- m=((age_len)*((age*1e9-10**np.min(age_l))/(10**np.max(age_l)-10**np.min(age_l)))).round(0).astype(int)
- m[m<0]=0
- m[m>=age_len]=age_len
-
-
- j=((met_len)*(metals-np.min(met_l))/(np.max(met_l)-np.min(met_l))).astype(int)
-
- j[j<0]=0
- j[j>=met_len]=met_len
-
- k=(j*(age_len+1)*(mass_len+1)+m*(mass_len+1))
-
-
- l1 = imag[k+1]
- l2 = imag[k+2]
- l3 = imag[k+3]
- l4 = imag[k+4]
- l5 = imag[k+5]
- l6 = imag[k+6]
- l7 = imag[k+7]
- l8 = imag[k+8]
- l9 = imag[k+9]
- l10 = imag[k+10]
- l11 = imag[k+11]
- l12 = imag[k+12]
- l13 = imag[k+13]
- l14 = imag[k+14]
- l15 = imag[k+15]
- l16 = imag[k+16]
- l17 = imag[k+17]
- l18 = imag[k+18]
-
-
- return np.array([l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12, l13,l14,l15,l16,l17,l18])
-
-
-#####################################
-########## GALEX FUNCTIONS
-#####################################
-
-def NUVmags_fun(mass, age, metals):
- '''''''''''''''
- This function calculates the magnitude on GALEX NUV of stars from the synthetic CMD:
- Parameters
- -------
- mass: numpy array.
- Mass of the particle.
- age: numpy array.
- Age of the particle
- metals: numpy array.
- '''''''''''''''
- Isoc=np.genfromtxt('./Isochrones/new_CMDs/Isoc_new_galex.txt',comments='#')
- MH,logAge,Mini,Te,logL, NUVmag = Isoc[:,0],Isoc[:,1],Isoc[:,2],Isoc[:,3],Isoc[:,4], Isoc[:,7]
- # Difererentes edades de las estrellas del cmd
-
- logAge_iter=[0]
- logAge_iter[0]=logAge[0]
- j=0
- for i in range(0,len(logAge)-1):
- if (logAge_iter[j] != logAge[i]) & (logAge_iter[j] <= logAge[i]):
- j=j+1
- logAge_iter.append(logAge[i])
-
- # Difererentes metalicidades de las estrellas del cmd
- MH_iter=[0]
- MH_iter[0]=MH[0]
- j=0
- for i in range(0,len(MH)-1):
- if MH_iter[j] != MH[i]:
- j=j+1
- MH_iter.append(MH[i])
-
- met_l = np.unique(MH)
- age_l = np.unique(logAge)
- Mass_l = np.unique(Mini)
- met_len=len(met_l)-1
- age_len=len(age_l)-1
- mass_len=len(Mass_l)-1
-
-
- m=((age_len)*((age*1e9-10**np.min(age_l))/(10**np.max(age_l)-10**np.min(age_l)))).round(0).astype(int)
- m[m<0]=0
- m[m>=age_len]=age_len
-
-
- j=((met_len)*(metals-np.min(met_l))/(np.max(met_l)-np.min(met_l))).astype(int)
-
- j[j<0]=0
- j[j>=met_len]=met_len
-
- k=(j*(age_len+1)*(mass_len+1)+m*(mass_len+1))
-
- l1 = NUVmag[k+1]
- l2 = NUVmag[k+2]
- l3 = NUVmag[k+3]
- l4 = NUVmag[k+4]
- l5 = NUVmag[k+5]
- l6 = NUVmag[k+6]
- l7 = NUVmag[k+7]
- l8 = NUVmag[k+8]
- l9 = NUVmag[k+9]
- l10 = NUVmag[k+10]
- l11 = NUVmag[k+11]
- l12 = NUVmag[k+12]
- l13 = NUVmag[k+13]
- l14 = NUVmag[k+14]
- l15 = NUVmag[k+15]
- l16 = NUVmag[k+16]
- l17 = NUVmag[k+17]
- l18 = NUVmag[k+18]
-
-
- return np.array([l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12, l13,l14,l15,l16,l17,l18])
-
-
-
-def FUVmags_fun(mass, age, metals):
- '''''''''''''''
- This function calculates the magnitude on GALEX FUV of stars from the synthetic CMD:
- Parameters
- -------
- mass: numpy array.
- Mass of the particle.
- age: numpy array.
- Age of the particle
- metals: numpy array.
- '''''''''''''''
- Isoc=np.genfromtxt('./Isochrones/new_CMDs/Isoc_new_galex.txt',comments='#')
- MH,logAge,Mini,Te,logL, FUVmag=Isoc[:,0],Isoc[:,1],Isoc[:,2],Isoc[:,3],Isoc[:,4], Isoc[:,6]
- # Difererentes edades de las estrellas del cmd
-
- logAge_iter=[0]
- logAge_iter[0]=logAge[0]
- j=0
- for i in range(0,len(logAge)-1):
- if (logAge_iter[j] != logAge[i]) & (logAge_iter[j] <= logAge[i]):
- j=j+1
- logAge_iter.append(logAge[i])
-
- # Difererentes metalicidades de las estrellas del cmd
- MH_iter=[0]
- MH_iter[0]=MH[0]
- j=0
- for i in range(0,len(MH)-1):
- if MH_iter[j] != MH[i]:
- j=j+1
- MH_iter.append(MH[i])
-
- met_l = np.unique(MH)
- age_l = np.unique(logAge)
- Mass_l = np.unique(Mini)
- met_len=len(met_l)-1
- age_len=len(age_l)-1
- mass_len=len(Mass_l)-1
-
-
- m=((age_len)*((age*1e9-10**np.min(age_l))/(10**np.max(age_l)-10**np.min(age_l)))).round(0).astype(int)
- m[m<0]=0
- m[m>=age_len]=age_len
-
-
- j=((met_len)*(metals-np.min(met_l))/(np.max(met_l)-np.min(met_l))).astype(int)
-
- j[j<0]=0
- j[j>=met_len]=met_len
-
- k=(j*(age_len+1)*(mass_len+1)+m*(mass_len+1))
-
- l1 = FUVmag[k+1]
- l2 = FUVmag[k+2]
- l3 = FUVmag[k+3]
- l4 = FUVmag[k+4]
- l5 = FUVmag[k+5]
- l6 = FUVmag[k+6]
- l7 = FUVmag[k+7]
- l8 = FUVmag[k+8]
- l9 = FUVmag[k+9]
- l10 = FUVmag[k+10]
- l11 = FUVmag[k+11]
- l12 = FUVmag[k+12]
- l13 = FUVmag[k+13]
- l14 = FUVmag[k+14]
- l15 = FUVmag[k+15]
- l16 = FUVmag[k+16]
- l17 = FUVmag[k+17]
- l18 = FUVmag[k+18]
-
-
- return np.array([l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12, l13,l14,l15,l16,l17,l18])
-
-
-
-#####################################
-########## LSST FUNCTIONS
-#####################################
-
-def ulsst_fun(mass, age, metals):
- '''''''''''''''
- This function calculates the magnitude on LSST-U of stars from the synthetic CMD:
- Parameters
- -------
- mass: numpy array.
- Mass of the particle.
- age: numpy array.
- Age of the particle
- metals: numpy array.
- '''''''''''''''
- Isoc=np.genfromtxt('./Isochrones/new_CMDs/Isoc_new_lsst.txt',comments='#')
- MH,logAge,Mini,Te,logL, umag=Isoc[:,0],Isoc[:,1],Isoc[:,2],Isoc[:,3],Isoc[:,4], Isoc[:,5]
- # Difererentes edades de las estrellas del cmd
-
- logAge_iter=[0]
- logAge_iter[0]=logAge[0]
- j=0
- for i in range(0,len(logAge)-1):
- if (logAge_iter[j] != logAge[i]) & (logAge_iter[j] <= logAge[i]):
- j=j+1
- logAge_iter.append(logAge[i])
-
- # Difererentes metalicidades de las estrellas del cmd
- MH_iter=[0]
- MH_iter[0]=MH[0]
- j=0
- for i in range(0,len(MH)-1):
- if MH_iter[j] != MH[i]:
- j=j+1
- MH_iter.append(MH[i])
-
- met_l = np.unique(MH)
- age_l = np.unique(logAge)
- Mass_l = np.unique(Mini)
- met_len=len(met_l)-1
- age_len=len(age_l)-1
- mass_len=len(Mass_l)-1
-
-
- m=((age_len)*((age*1e9-10**np.min(age_l))/(10**np.max(age_l)-10**np.min(age_l)))).round(0).astype(int)
- m[m<0]=0
- m[m>=age_len]=age_len
-
-
- j=((met_len)*(metals-np.min(met_l))/(np.max(met_l)-np.min(met_l))).astype(int)
-
- j[j<0]=0
- j[j>=met_len]=met_len
-
- k=(j*(age_len+1)*(mass_len+1)+m*(mass_len+1))
-
- l1 = umag[k+1]
- l2 = umag[k+2]
- l3 = umag[k+3]
- l4 = umag[k+4]
- l5 = umag[k+5]
- l6 = umag[k+6]
- l7 = umag[k+7]
- l8 = umag[k+8]
- l9 = umag[k+9]
- l10 = umag[k+10]
- l11 = umag[k+11]
- l12 = umag[k+12]
- l13 = umag[k+13]
- l14 = umag[k+14]
- l15 = umag[k+15]
- l16 = umag[k+16]
- l17 = umag[k+17]
- l18 = umag[k+18]
-
-
- return np.array([l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12, l13,l14,l15,l16,l17,l18])
-
-
-def glsst_fun(mass, age, metals):
- '''''''''''''''
- This function calculates the magnitude on LSST-G of stars from the synthetic CMD:
- Parameters
- -------
- mass: numpy array.
- Mass of the particle.
- age: numpy array.
- Age of the particle
- metals: numpy array.
- '''''''''''''''
- Isoc=np.genfromtxt('./Isochrones/new_CMDs/Isoc_new_lsst.txt',comments='#')
- MH,logAge,Mini,Te,logL, gmag=Isoc[:,0],Isoc[:,1],Isoc[:,2],Isoc[:,3],Isoc[:,4], Isoc[:,6]
- # Difererentes edades de las estrellas del cmd
-
- logAge_iter=[0]
- logAge_iter[0]=logAge[0]
- j=0
- for i in range(0,len(logAge)-1):
- if (logAge_iter[j] != logAge[i]) & (logAge_iter[j] <= logAge[i]):
- j=j+1
- logAge_iter.append(logAge[i])
-
- # Difererentes metalicidades de las estrellas del cmd
- MH_iter=[0]
- MH_iter[0]=MH[0]
- j=0
- for i in range(0,len(MH)-1):
- if MH_iter[j] != MH[i]:
- j=j+1
- MH_iter.append(MH[i])
-
- met_l = np.unique(MH)
- age_l = np.unique(logAge)
- Mass_l = np.unique(Mini)
- met_len=len(met_l)-1
- age_len=len(age_l)-1
- mass_len=len(Mass_l)-1
-
-
- m=((age_len)*((age*1e9-10**np.min(age_l))/(10**np.max(age_l)-10**np.min(age_l)))).round(0).astype(int)
- m[m<0]=0
- m[m>=age_len]=age_len
-
-
- j=((met_len)*(metals-np.min(met_l))/(np.max(met_l)-np.min(met_l))).astype(int)
-
- j[j<0]=0
- j[j>=met_len]=met_len
-
- k=(j*(age_len+1)*(mass_len+1)+m*(mass_len+1))
-
- l1 = gmag[k+1]
- l2 = gmag[k+2]
- l3 = gmag[k+3]
- l4 = gmag[k+4]
- l5 = gmag[k+5]
- l6 = gmag[k+6]
- l7 = gmag[k+7]
- l8 = gmag[k+8]
- l9 = gmag[k+9]
- l10 = gmag[k+10]
- l11 = gmag[k+11]
- l12 = gmag[k+12]
- l13 = gmag[k+13]
- l14 = gmag[k+14]
- l15 = gmag[k+15]
- l16 = gmag[k+16]
- l17 = gmag[k+17]
- l18 = gmag[k+18]
-
- return np.array([l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12, l13,l14,l15,l16,l17,l18])
-
-
-
-
-
-
-#####################################
-########## DECAM FUNCTIONS
-#####################################
-
-
-
-
-def g_fun(mass, age, metals):
- '''''''''''''''
- This function calculates the magnitude on DECAM-g of stars from the synthetic CMD:
- Parameters
- -------
- mass: numpy array.
- Mass of the particle.
- age: numpy array.
- Age of the particle
- metals: numpy array.
- '''''''''''''''
- Isoc=np.genfromtxt('./Isochrones/new_CMDs/Isoc_new_decam.txt',comments='#')
- MH,logAge,Mini,Te,logL, gmag = Isoc[:,0],Isoc[:,1],Isoc[:,2],Isoc[:,3],Isoc[:,4], Isoc[:,5]
- # Difererentes edades de las estrellas del cmd
-
- logAge_iter=[0]
- logAge_iter[0]=logAge[0]
- j=0
- for i in range(0,len(logAge)-1):
- if (logAge_iter[j] != logAge[i]) & (logAge_iter[j] <= logAge[i]):
- j=j+1
- logAge_iter.append(logAge[i])
-
- # Difererentes metalicidades de las estrellas del cmd
- MH_iter=[0]
- MH_iter[0]=MH[0]
- j=0
- for i in range(0,len(MH)-1):
- if MH_iter[j] != MH[i]:
- j=j+1
- MH_iter.append(MH[i])
-
- met_l = np.unique(MH)
- age_l = np.unique(logAge)
- Mass_l = np.unique(Mini)
- met_len=len(met_l)-1
- age_len=len(age_l)-1
- mass_len=len(Mass_l)-1
-
-
- m=((age_len)*((age*1e9-10**np.min(age_l))/(10**np.max(age_l)-10**np.min(age_l)))).round(0).astype(int)
- m[m<0]=0
- m[m>=age_len]=age_len
-
-
- j=((met_len)*(metals-np.min(met_l))/(np.max(met_l)-np.min(met_l))).astype(int)
-
- j[j<0]=0
- j[j>=met_len]=met_len
-
- k=(j*(age_len+1)*(mass_len+1)+m*(mass_len+1))
-
-
- l1 = gmag[k+1]
- l2 = gmag[k+2]
- l3 = gmag[k+3]
- l4 = gmag[k+4]
- l5 = gmag[k+5]
- l6 = gmag[k+6]
- l7 = gmag[k+7]
- l8 = gmag[k+8]
- l9 = gmag[k+9]
- l10 = gmag[k+10]
- l11 = gmag[k+11]
- l12 = gmag[k+12]
- l13 = gmag[k+13]
- l14 = gmag[k+14]
- l15 = gmag[k+15]
- l16 = gmag[k+16]
- l17 = gmag[k+17]
- l18 = gmag[k+18]
-
- return np.array([l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12, l13,l14,l15,l16,l17,l18])
-
-
-def r_fun(mass, age, metals):
- '''''''''''''''
- This function calculates the magnitude on DECAM-r of stars from the synthetic CMD:
- Parameters
- -------
- mass: numpy array.
- Mass of the particle.
- age: numpy array.
- Age of the particle
- metals: numpy array.
- '''''''''''''''
- Isoc=np.genfromtxt('./Isochrones/new_CMDs/Isoc_new_decam.txt',comments='#')
- MH,logAge,Mini,Te,logL, rmags = Isoc[:,0],Isoc[:,1],Isoc[:,2],Isoc[:,3],Isoc[:,4], Isoc[:,7]
- # Difererentes edades de las estrellas del cmd
-
- logAge_iter=[0]
- logAge_iter[0]=logAge[0]
- j=0
- for i in range(0,len(logAge)-1):
- if (logAge_iter[j] != logAge[i]) & (logAge_iter[j] <= logAge[i]):
- j=j+1
- logAge_iter.append(logAge[i])
-
- # Difererentes metalicidades de las estrellas del cmd
- MH_iter=[0]
- MH_iter[0]=MH[0]
- j=0
- for i in range(0,len(MH)-1):
- if MH_iter[j] != MH[i]:
- j=j+1
- MH_iter.append(MH[i])
-
- met_l = np.unique(MH)
- age_l = np.unique(logAge)
- Mass_l = np.unique(Mini)
- met_len=len(met_l)-1
- age_len=len(age_l)-1
- mass_len=len(Mass_l)-1
-
-
- m=((age_len)*((age*1e9-10**np.min(age_l))/(10**np.max(age_l)-10**np.min(age_l)))).round(0).astype(int)
- m[m<0]=0
- m[m>=age_len]=age_len
-
-
- j=((met_len)*(metals-np.min(met_l))/(np.max(met_l)-np.min(met_l))).astype(int)
-
- j[j<0]=0
- j[j>=met_len]=met_len
-
- k=(j*(age_len+1)*(mass_len+1)+m*(mass_len+1))
-
-
- l1 = rmags[k+1]
- l2 = rmags[k+2]
- l3 = rmags[k+3]
- l4 = rmags[k+4]
- l5 = rmags[k+5]
- l6 = rmags[k+6]
- l7 = rmags[k+7]
- l8 = rmags[k+8]
- l9 = rmags[k+9]
- l10 = rmags[k+10]
- l11 = rmags[k+11]
- l12 = rmags[k+12]
- l13 = rmags[k+13]
- l14 = rmags[k+14]
- l15 = rmags[k+15]
- l16 = rmags[k+16]
- l17 = rmags[k+17]
- l18 = rmags[k+18]
-
- return np.array([l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12, l13,l14,l15,l16,l17,l18])
-
-
-
-def z_fun(mass, age, metals):
- '''''''''''''''
- This function calculates the magnitude on DECAM-z of stars from the synthetic CMD:
- Parameters
- -------
- mass: numpy array.
- Mass of the particle.
- age: numpy array.
- Age of the particle
- metals: numpy array.
- '''''''''''''''
- Isoc=np.genfromtxt('./Isochrones/new_CMDs/Isoc_new_decam.txt',comments='#')
- MH,logAge,Mini,Te,logL, zmag = Isoc[:,0],Isoc[:,1],Isoc[:,2],Isoc[:,3],Isoc[:,4], Isoc[:,6]
- # Difererentes edades de las estrellas del cmd
-
- logAge_iter=[0]
- logAge_iter[0]=logAge[0]
- j=0
- for i in range(0,len(logAge)-1):
- if (logAge_iter[j] != logAge[i]) & (logAge_iter[j] <= logAge[i]):
- j=j+1
- logAge_iter.append(logAge[i])
-
- # Difererentes metalicidades de las estrellas del cmd
- MH_iter=[0]
- MH_iter[0]=MH[0]
- j=0
- for i in range(0,len(MH)-1):
- if MH_iter[j] != MH[i]:
- j=j+1
- MH_iter.append(MH[i])
-
- met_l = np.unique(MH)
- age_l = np.unique(logAge)
- Mass_l = np.unique(Mini)
- met_len=len(met_l)-1
- age_len=len(age_l)-1
- mass_len=len(Mass_l)-1
-
-
- m=((age_len)*((age*1e9-10**np.min(age_l))/(10**np.max(age_l)-10**np.min(age_l)))).round(0).astype(int)
- m[m<0]=0
- m[m>=age_len]=age_len
-
-
- j=((met_len)*(metals-np.min(met_l))/(np.max(met_l)-np.min(met_l))).astype(int)
-
- j[j<0]=0
- j[j>=met_len]=met_len
-
- k=(j*(age_len+1)*(mass_len+1)+m*(mass_len+1))
-
-
- l1 = zmag[k+1]
- l2 = zmag[k+2]
- l3 = zmag[k+3]
- l4 = zmag[k+4]
- l5 = zmag[k+5]
- l6 = zmag[k+6]
- l7 = zmag[k+7]
- l8 = zmag[k+8]
- l9 = zmag[k+9]
- l10 = zmag[k+10]
- l11 = zmag[k+11]
- l12 = zmag[k+12]
- l13 = zmag[k+13]
- l14 = zmag[k+14]
- l15 = zmag[k+15]
- l16 = zmag[k+16]
- l17 = zmag[k+17]
- l18 = zmag[k+18]
-
- return np.array([l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12, l13,l14,l15,l16,l17,l18])
-
-
-def i_fun(mass, age, metals):
- '''''''''''''''
- This function calculates the magnitude on DECAM-i of stars from the synthetic CMD:
- Parameters
- -------
- mass: numpy array.
- Mass of the particle.
- age: numpy array.
- Age of the particle
- metals: numpy array.
- '''''''''''''''
- Isoc=np.genfromtxt('./Isochrones/new_CMDs/Isoc_new_decam.txt',comments='#')
- MH,logAge,Mini,Te,logL, imag = Isoc[:,0],Isoc[:,1],Isoc[:,2],Isoc[:,3],Isoc[:,4], Isoc[:,8]
- # Difererentes edades de las estrellas del cmd
-
- logAge_iter=[0]
- logAge_iter[0]=logAge[0]
- j=0
- for i in range(0,len(logAge)-1):
- if (logAge_iter[j] != logAge[i]) & (logAge_iter[j] <= logAge[i]):
- j=j+1
- logAge_iter.append(logAge[i])
-
- # Difererentes metalicidades de las estrellas del cmd
- MH_iter=[0]
- MH_iter[0]=MH[0]
- j=0
- for i in range(0,len(MH)-1):
- if MH_iter[j] != MH[i]:
- j=j+1
- MH_iter.append(MH[i])
-
- met_l = np.unique(MH)
- age_l = np.unique(logAge)
- Mass_l = np.unique(Mini)
- met_len=len(met_l)-1
- age_len=len(age_l)-1
- mass_len=len(Mass_l)-1
-
-
- m=((age_len)*((age*1e9-10**np.min(age_l))/(10**np.max(age_l)-10**np.min(age_l)))).round(0).astype(int)
- m[m<0]=0
- m[m>=age_len]=age_len
-
-
- j=((met_len)*(metals-np.min(met_l))/(np.max(met_l)-np.min(met_l))).astype(int)
-
- j[j<0]=0
- j[j>=met_len]=met_len
-
- k=(j*(age_len+1)*(mass_len+1)+m*(mass_len+1))
-
-
- l1 = imag[k+1]
- l2 = imag[k+2]
- l3 = imag[k+3]
- l4 = imag[k+4]
- l5 = imag[k+5]
- l6 = imag[k+6]
- l7 = imag[k+7]
- l8 = imag[k+8]
- l9 = imag[k+9]
- l10 = imag[k+10]
- l11 = imag[k+11]
- l12 = imag[k+12]
- l13 = imag[k+13]
- l14 = imag[k+14]
- l15 = imag[k+15]
- l16 = imag[k+16]
- l17 = imag[k+17]
- l18 = imag[k+18]
-
- return np.array([l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12, l13,l14,l15,l16,l17,l18])
-
-
-
diff --git a/Workspace/CumNumOfSat/CDM_PS.dat b/Workspace/CumNumOfSat/CDM_PS.dat
new file mode 100644
index 0000000..076b2aa
--- /dev/null
+++ b/Workspace/CumNumOfSat/CDM_PS.dat
@@ -0,0 +1,1000 @@
+1.000000000000000861e-04 4.333703617098304335e+02
+1.018610170155976095e-04 4.411087405520467541e+02
+1.037566678745187380e-04 4.489851961947052246e+02
+1.056875971184805354e-04 4.570021778841570494e+02
+1.076544612842316064e-04 4.651621778259802795e+02
+1.096579291267811795e-04 4.734677319255845873e+02
+1.116986818467824455e-04 4.819214205412697538e+02
+1.137774133221491896e-04 4.905258692499635345e+02
+1.158948303439810988e-04 4.992837496258087526e+02
+1.180516528568806696e-04 5.081977800318397840e+02
+1.202486142037413250e-04 5.172707264249390846e+02
+1.224864613750931521e-04 5.265054031743093219e+02
+1.247659552630871270e-04 5.359046738936576730e+02
+1.270878709202059734e-04 5.454714522873283613e+02
+1.294529978227916035e-04 5.552087030106147267e+02
+1.318621401394750627e-04 5.651194425444625722e+02
+1.343161170046017466e-04 5.752067400848042098e+02
+1.368157627967472455e-04 5.854737184467752513e+02
+1.393619274224144823e-04 5.959235549840295789e+02
+1.419554766050102918e-04 6.065594825234007885e+02
+1.445972921792020548e-04 6.173847903151861374e+02
+1.472882723907502584e-04 6.284028249992576320e+02
+1.500293322019220137e-04 6.396169915872903857e+02
+1.528214036025870941e-04 6.510307544613559685e+02
+1.556654359271061883e-04 6.626476383891396154e+02
+1.585623961771139598e-04 6.744712295560549364e+02
+1.615132693503092110e-04 6.865051766145159036e+02
+1.645190587753662893e-04 6.987531917506590844e+02
+1.675807864530770238e-04 7.112190517687854481e+02
+1.706994934038409369e-04 7.239065991937819717e+02
+1.738762400216251611e-04 7.368197433918688830e+02
+1.771121064345090954e-04 7.499624617099018451e+02
+1.804081928719384839e-04 7.633388006335591172e+02
+1.837656200388172322e-04 7.769528769647105264e+02
+1.871855294965582301e-04 7.908088790182786170e+02
+1.906690840512254796e-04 8.049110678388761926e+02
+1.942174681489027010e-04 8.192637784375663159e+02
+1.978318882784164631e-04 8.338714210490485357e+02
+2.015135733815560275e-04 8.487384824096038756e+02
+2.052637752709253547e-04 8.638695231313245131e+02
+2.090837690555751266e-04 8.792691598837506035e+02
+2.129748535745523729e-04 8.949420796739739217e+02
+2.169383518385186761e-04 9.108930487399514959e+02
+2.209756114795902876e-04 9.271269138324581718e+02
+2.250880052095465228e-04 9.436486035067863440e+02
+2.292769312865651900e-04 9.604631294335150642e+02
+2.335438139906480075e-04 9.775755877286239865e+02
+2.378901041078893702e-04 9.949911603031565619e+02
+2.423172794237602574e-04 1.012715116232696801e+03
+2.468268452255693965e-04 1.030752813146909830e+03
+2.514203348142797913e-04 1.049109698639405451e+03
+2.560993100258462246e-04 1.067791311698177651e+03
+2.608653617622550707e-04 1.086803284156844256e+03
+2.657201105324506481e-04 1.106151342167013354e+03
+2.706652070033245408e-04 1.125841307691974407e+03
+2.757023325609586541e-04 1.145879100022000557e+03
+2.808331998823173216e-04 1.166270737311543371e+03
+2.860595535175747316e-04 1.187022338138577652e+03
+2.913831704832790630e-04 1.208140123086337780e+03
+2.968058608665604119e-04 1.229630416347771870e+03
+3.023294684405783178e-04 1.251499647352955435e+03
+3.079558712914229638e-04 1.273754352419731504e+03
+3.136869824566879215e-04 1.296401176427884593e+03
+3.195247505759218486e-04 1.319446874517128208e+03
+3.254711605531852500e-04 1.342898313809142564e+03
+3.315282342319427486e-04 1.366762475154029062e+03
+3.376980310825094958e-04 1.391046445663761688e+03
+3.439826489022927399e-04 1.415757351559884228e+03
+3.503842245290677811e-04 1.440902393142386927e+03
+3.569049345675231522e-04 1.466488882174533273e+03
+3.635469961293322509e-04 1.492524243610205986e+03
+3.703126675869930387e-04 1.519016017076260596e+03
+3.772042493417000807e-04 1.545971858367283858e+03
+3.842240846055063161e-04 1.573399540952767666e+03
+3.913745601980388872e-04 1.601306957496451105e+03
+3.986581073580443605e-04 1.629702121387878378e+03
+4.060772025700368844e-04 1.658593168285985939e+03
+4.136343684063280312e-04 1.687988357674616509e+03
+4.213321743847291069e-04 1.717896074429851978e+03
+4.291732378422162780e-04 1.748324830399054235e+03
+4.371602248248510872e-04 1.779283265991392454e+03
+4.452958509942659521e-04 1.810780151779837752e+03
+4.535828825510189823e-04 1.842824390114382823e+03
+4.620241371751315036e-04 1.875425016746341271e+03
+4.706224849841287249e-04 1.908591202463564741e+03
+4.793808495089111948e-04 1.942332254736416189e+03
+4.883022086877884327e-04 1.976657619374283058e+03
+4.973895958790070437e-04 2.011576882192439143e+03
+5.066461008921270374e-04 2.047099770689064599e+03
+5.160748710385913447e-04 2.083236155732197403e+03
+5.256791122018429022e-04 2.119996053256359119e+03
+5.354620899273611345e-04 2.157389625968711698e+03
+5.454271305329838572e-04 2.195427185064358582e+03
+5.555776222398884365e-04 2.234119181275381379e+03
+5.659170163246249026e-04 2.273476082212778238e+03
+5.764488282925884013e-04 2.313508406708811435e+03
+5.871766390733259601e-04 2.354226810096170084e+03
+5.981040962380946603e-04 2.395642086870392177e+03
+6.092349152400713952e-04 2.437765171695473327e+03
+6.205728806776507128e-04 2.480607140392911333e+03
+6.321218475812459938e-04 2.524179210913055158e+03
+6.438857427240423899e-04 2.568492744288098947e+03
+6.558685659571438778e-04 2.613559245565506899e+03
+6.680743915695623114e-04 2.659390364721175047e+03
+6.805073696735214036e-04 2.705997897551121696e+03
+6.931717276155412990e-04 2.753393786540892961e+03
+7.060717714137784056e-04 2.801590121711527900e+03
+7.192118872221195391e-04 2.850599141441119627e+03
+7.325965428215239130e-04 2.900433233260893758e+03
+7.462302891391122458e-04 2.951104934624667294e+03
+7.601177617955335968e-04 3.002626933650679803e+03
+7.742636826811274183e-04 3.055012069834565864e+03
+7.886728615614158793e-04 3.108273334732441981e+03
+8.033501977124743064e-04 3.162423872612795094e+03
+8.183006815867397343e-04 3.217476981076085849e+03
+8.335293965098201571e-04 3.273446111640842901e+03
+8.490415204088759635e-04 3.330344870294989050e+03
+8.648423275731729034e-04 3.388187018011110922e+03
+8.809371904474000772e-04 3.446986471224501202e+03
+8.973315814583535978e-04 3.506757302272569177e+03
+9.140310748756238666e-04 3.567513719529189075e+03
+9.310413487069080403e-04 3.629269678786681652e+03
+9.483681866285938698e-04 3.692038882592863501e+03
+9.660174799522655434e-04 3.755835119218848831e+03
+9.839952296278235786e-04 3.820672273902969209e+03
+1.002307548283866033e-03 3.886564326602419897e+03
+1.020960662306047905e-03 3.953525349630303936e+03
+1.039960913954120648e-03 4.021569505175448739e+03
+1.059314763518371142e-03 4.090711042702748273e+03
+1.079028791516185382e-03 4.160964296231358276e+03
+1.099109700929497844e-03 4.232343681488587208e+03
+1.119564319483879865e-03 4.304863692936839470e+03
+1.140399601970034206e-03 4.378538900671171177e+03
+1.161622632608502867e-03 4.453383947185248871e+03
+1.183240627458378991e-03 4.529413544003111383e+03
+1.205260936870844240e-03 4.606642468174271016e+03
+1.227691047988360836e-03 4.685085558629974003e+03
+1.250538587290391489e-03 4.764757712398189142e+03
+1.273811323186479659e-03 4.845673880674758948e+03
+1.297517168657588964e-03 4.927849064748728779e+03
+1.321664183946605732e-03 5.011298311779250071e+03
+1.346260579298911306e-03 5.096036710421941279e+03
+1.371314717753946985e-03 5.182079386302353669e+03
+1.396835117988740873e-03 5.269441497334512860e+03
+1.422830457214354196e-03 5.358138228882078693e+03
+1.449309574126218542e-03 5.448184788760153424e+03
+1.476281471909391416e-03 5.539596402075769220e+03
+1.503755321299738617e-03 5.632388285579809235e+03
+1.531740463702082342e-03 5.726574938494039998e+03
+1.560246414366370368e-03 5.822169901701432536e+03
+1.589282865622978699e-03 5.919186541539315840e+03
+1.618859690178199584e-03 6.017638093258353365e+03
+1.648986944471066314e-03 6.117537650499135452e+03
+1.679674872092654526e-03 6.218898154511505709e+03
+1.710933907269015977e-03 6.321732383116085657e+03
+1.742774678408921373e-03 6.426052939407598387e+03
+1.775208011717636317e-03 6.531872240199996668e+03
+1.808244934877953347e-03 6.639202504213422799e+03
+1.841896680799713897e-03 6.748055740003830579e+03
+1.876174691439122305e-03 6.858443733635162971e+03
+1.911090621689140326e-03 6.970378036096007236e+03
+1.946656343342265160e-03 7.083869950461193184e+03
+1.982883949127072897e-03 7.198930518800370919e+03
+2.019785756819879839e-03 7.315570508835099645e+03
+2.057374313432914440e-03 7.433800400346875904e+03
+2.095662399480435582e-03 7.553630371338466830e+03
+2.134663033324245458e-03 7.675070283951178681e+03
+2.174389475600081549e-03 7.798129670141868701e+03
+2.214855233726362865e-03 7.922817717122353315e+03
+2.256074066496862544e-03 8.049143252565781040e+03
+2.298059988758853738e-03 8.177114729584187444e+03
+2.340827276178296563e-03 8.306740211481390361e+03
+2.384390470093722316e-03 8.438027356286849681e+03
+2.428764382460454289e-03 8.570983401075651273e+03
+2.473964100886817067e-03 8.705615129020345194e+03
+2.520004993764095053e-03 8.841927532619070917e+03
+2.566902715491951956e-03 8.979922751753303601e+03
+2.614673211801094108e-03 9.119601984587736297e+03
+2.663332725174984757e-03 9.260965675842637211e+03
+2.712897800372468093e-03 9.404013492611060428e+03
+2.763385290053172599e-03 9.548744300006455887e+03
+2.814812360507583724e-03 9.695156136660250922e+03
+2.867196497493771680e-03 9.843246190090605523e+03
+2.920555512182749364e-03 9.993010771963394291e+03
+2.974907547214444056e-03 1.014444529326864722e+04
+3.030271082866399252e-03 1.029754423943616166e+04
+3.086664943337277030e-03 1.045230114541464354e+04
+3.144108303147269499e-03 1.060870857074076594e+04
+3.202620693657654526e-03 1.076675807462443845e+04
+3.262222009711670655e-03 1.092644019107848544e+04
+3.322932516398978062e-03 1.108774440412177319e+04
+3.384772855945985398e-03 1.125065912308524457e+04
+3.447764054734465955e-03 1.141517165805220611e+04
+3.511927530450732575e-03 1.158126819546502338e+04
+3.577285099367877134e-03 1.174893377393079754e+04
+3.643858983763547874e-03 1.191815226026031996e+04
+3.711671819475769515e-03 1.208890632577562246e+04
+3.780746663599354480e-03 1.226117742292136973e+04
+3.851107002325573642e-03 1.243494576221797070e+04
+3.922776758927723831e-03 1.261019028959384377e+04
+3.995780301895276998e-03 1.278688866413582218e+04
+4.070142453219441694e-03 1.296501722599777531e+04
+4.145888496832913703e-03 1.314454827322719029e+04
+4.223044187206681163e-03 1.332544620147147907e+04
+4.301635758106799393e-03 1.350767261079892887e+04
+4.381689931514194149e-03 1.369118714902128340e+04
+4.463233926710399868e-03 1.387594748355693991e+04
+4.546295469532405688e-03 1.406190927460734201e+04
+4.630902801799742161e-03 1.424902627064867738e+04
+4.717084690917022240e-03 1.443725477925279301e+04
+4.804870439655137097e-03 1.462655525512093482e+04
+4.894289896114534591e-03 1.481688701191223845e+04
+4.985373463873899770e-03 1.500820783496811055e+04
+5.078152112327680850e-03 1.520047397080434348e+04
+5.172657387216023778e-03 1.539364011775718245e+04
+5.268921421350675899e-03 1.558765858269837372e+04
+5.366976945540483449e-03 1.578246865568698558e+04
+5.466857299720187351e-03 1.597799915796666028e+04
+5.568596444286420463e-03 1.617417613388280006e+04
+5.672228971644548319e-03 1.637092301523249262e+04
+5.777790117970510626e-03 1.656816061418676691e+04
+5.885315775191453033e-03 1.676580711957567837e+04
+5.994842503189415708e-03 1.696378000376250566e+04
+6.106407542232048652e-03 1.716200648182360601e+04
+6.220048825634716567e-03 1.736041667846831479e+04
+6.335804992658258111e-03 1.755893900814112931e+04
+6.453715401646704236e-03 1.775750017843762907e+04
+6.573820143409593413e-03 1.795602520678583096e+04
+6.696160054853228343e-03 1.815443743759700737e+04
+6.820776732865690625e-03 1.835265130942168616e+04
+6.947712548460243352e-03 1.855055535824056642e+04
+7.077010661181898192e-03 1.874803024950344479e+04
+7.208715033782143837e-03 1.894495354627406414e+04
+7.342870447166771966e-03 1.914119975427771351e+04
+7.479522515621827086e-03 1.933664037375944099e+04
+7.618717702323002383e-03 1.953114402055968822e+04
+7.760503335133580802e-03 1.972458174855773541e+04
+7.904927622696428235e-03 1.991683138298491394e+04
+8.052039670825484122e-03 2.010776953919495281e+04
+8.201889499202216424e-03 2.029727078434846044e+04
+8.354528058382874878e-03 2.048520771953362419e+04
+8.510007247122256674e-03 2.067145106751423737e+04
+8.668379930019783769e-03 2.085586938301970804e+04
+8.829699955494098654e-03 2.103832104749578866e+04
+8.994022174092057564e-03 2.121865423736223602e+04
+9.161402457138523997e-03 2.139671473778082873e+04
+9.331897715733249166e-03 2.157234641509208086e+04
+9.505565920101200633e-03 2.174539136177112232e+04
+9.682466119303130558e-03 2.191569004955815763e+04
+9.862658461312834995e-03 2.208308028404523066e+04
+1.004620421346813508e-02 2.224738726803180907e+04
+1.023316578330246002e-02 2.240842857159281630e+04
+1.042360673976403147e-02 2.256602026158690569e+04
+1.061759183483000808e-02 2.271997718585898474e+04
+1.081518702552289671e-02 2.287011320851700657e+04
+1.101645949633657182e-02 2.301624145575425428e+04
+1.122147768207981504e-02 2.315817213646350865e+04
+1.143031129114480647e-02 2.329570390194356150e+04
+1.164303132920877643e-02 2.342863188843026001e+04
+1.185971012337671063e-02 2.355675122468910558e+04
+1.208042134677329155e-02 2.367985736491848729e+04
+1.230524004359262805e-02 2.379774643302150071e+04
+1.253424265461401677e-02 2.391021556569693712e+04
+1.276750704319266558e-02 2.401705954706054763e+04
+1.300511252173410306e-02 2.411806585018487385e+04
+1.324713987866119047e-02 2.421302257684461438e+04
+1.349367140588307763e-02 2.430172019443278987e+04
+1.374479092677539059e-02 2.438395197730606378e+04
+1.400058382468098370e-02 2.445951445753227017e+04
+1.426113707194130199e-02 2.452820760699559105e+04
+1.452653925946782720e-02 2.458982436246985526e+04
+1.479688062686397750e-02 2.464414736735040060e+04
+1.507225309310758141e-02 2.469096320072711751e+04
+1.535275028780423538e-02 2.473006395522025196e+04
+1.563846758302248410e-02 2.476124781155110759e+04
+1.592950212572124755e-02 2.478431961814612441e+04
+1.622595287078088672e-02 2.479909089917351230e+04
+1.652792061464896517e-02 2.480537289930122279e+04
+1.683550802961204795e-02 2.480297928254920407e+04
+1.714881969870541215e-02 2.479173261857727630e+04
+1.746796215127247379e-02 2.477146515500488385e+04
+1.779304389918578977e-02 2.474201944378153348e+04
+1.812417547374238838e-02 2.470324896018456275e+04
+1.846146946324550217e-02 2.465502011556489379e+04
+1.880504055128583846e-02 2.459722066326184358e+04
+1.915500555573529731e-02 2.452975467022331213e+04
+1.951148346846619600e-02 2.445253927917563487e+04
+1.987459549580984988e-02 2.436550518344370357e+04
+2.024446509976806502e-02 2.426859708850239622e+04
+2.062121803999144784e-02 2.416177414677781417e+04
+2.100498241653917311e-02 2.404500715315556226e+04
+2.139588871343425097e-02 2.391827138599072350e+04
+2.179406984302956901e-02 2.378155575077881440e+04
+2.219966119119957601e-02 2.363486547373489157e+04
+2.261280066337279654e-02 2.347822243779057681e+04
+2.303362873142133366e-02 2.331166547782948692e+04
+2.346228848142266343e-02 2.313525161175489120e+04
+2.389892566231051341e-02 2.294914695858997948e+04
+2.434368873543113487e-02 2.275369635227263643e+04
+2.479672892502162579e-02 2.254926995808065840e+04
+2.525820026962786666e-02 2.233624456368062602e+04
+2.572825967447936110e-02 2.211500257091784079e+04
+2.620706696483853654e-02 2.188593100145388962e+04
+2.669478494034323995e-02 2.164941023581589616e+04
+2.719157943036021319e-02 2.140558722563592528e+04
+2.769761935036893150e-02 2.115438694200072496e+04
+2.821307675939475207e-02 2.089574879732529735e+04
+2.873812691851067302e-02 2.062963798969500567e+04
+2.927294835042819343e-02 2.035604607783996471e+04
+2.981772290019675878e-02 2.007499148539652379e+04
+3.037263579703313940e-02 1.978668484718455875e+04
+3.093787571730141281e-02 1.949291892836035549e+04
+3.151363484866483156e-02 1.919626835504462360e+04
+3.210010895543174980e-02 1.889918081057079326e+04
+3.269749744511770556e-02 1.860396502182337645e+04
+3.330600343624590814e-02 1.831279150567835313e+04
+3.392583382740996939e-02 1.802769596954418375e+04
+3.455719936762143701e-02 1.775004111290409492e+04
+3.520031472796682909e-02 1.747853987060988220e+04
+3.585539857459819901e-02 1.721122443605816807e+04
+3.652267364308180858e-02 1.694624180015917227e+04
+3.720236681413071483e-02 1.668185043989615224e+04
+3.789470919074672262e-02 1.641641874540273420e+04
+3.859993617679770977e-02 1.614842708485146613e+04
+3.931828755705773365e-02 1.587717466676822914e+04
+4.005000757873616868e-02 1.560375403238120816e+04
+4.079534503452454663e-02 1.532946093220701005e+04
+4.155455334718879956e-02 1.505551516154353340e+04
+4.232789065573552834e-02 1.478306018474722623e+04
+4.311561990318231452e-02 1.451316366122852196e+04
+4.391800892596092742e-02 1.424683016338405469e+04
+4.473533054498469302e-02 1.398547634192740952e+04
+4.556786265841068773e-02 1.373106241564129050e+04
+4.641588833612785708e-02 1.348544736535283846e+04
+4.727969591600393595e-02 1.325035122194241376e+04
+4.815957910192357472e-02 1.302736894472895256e+04
+4.905583706365052032e-02 1.281798628907343482e+04
+4.996877453854889350e-02 1.262346062525019261e+04
+5.089870193519688973e-02 1.244299298256375005e+04
+5.184593543892915962e-02 1.227434419562453331e+04
+5.281079711934338200e-02 1.211536858244746873e+04
+5.379361503980704257e-02 1.196403663231935934e+04
+5.479472336900292201e-02 1.181842174537134451e+04
+5.581446249454970199e-02 1.167669019635669065e+04
+5.685317913873756679e-02 1.153715622336832894e+04
+5.791122647641765847e-02 1.139863319063948984e+04
+5.898896425508505514e-02 1.126016452940727686e+04
+6.008675891719692658e-02 1.112084107918726113e+04
+6.120498372476707027e-02 1.097980077203352448e+04
+6.234401888627867649e-02 1.083622962408028070e+04
+6.350425168595970338e-02 1.068936335267059985e+04
+6.468607661546334209e-02 1.053853581724418109e+04
+6.588989550799956296e-02 1.038329222447282700e+04
+6.711611767496290792e-02 1.022325683216497782e+04
+6.836516004510241606e-02 1.005809859179087289e+04
+6.963744730628231017e-02 9.887533236612220207e+03
+7.093341204988003190e-02 9.711325344550417867e+03
+7.225349491787219636e-02 9.529180100216450228e+03
+7.359814475265775979e-02 9.340480768061679555e+03
+7.496781874966887416e-02 9.144623303244039562e+03
+7.636298261282251088e-02 8.941111976356874948e+03
+7.778411071286497891e-02 8.729564973260385159e+03
+7.923168624866260001e-02 8.509786402613945029e+03
+8.070620141149512095e-02 8.282547343843300041e+03
+8.220815755240551415e-02 8.049222870894601328e+03
+8.373806535266499484e-02 7.811149210805581788e+03
+8.529644499741033392e-02 7.569602415134751027e+03
+8.688382635251198916e-02 7.325912465525872904e+03
+8.850074914473443632e-02 7.082451778561120591e+03
+9.014776314524929057e-02 6.841957850417563350e+03
+9.182542835656291869e-02 6.606844435142857037e+03
+9.353431520292394830e-02 6.379208363391284365e+03
+9.527500472427305467e-02 6.160979273079674385e+03
+9.704808877380310950e-02 5.954069280134292057e+03
+9.885417021919586100e-02 5.760135226918710941e+03
+1.006938631476028134e-01 5.580583549381938610e+03
+1.025677930744422761e-01 5.416245329687853882e+03
+1.044765971560805834e-01 5.266594109464555004e+03
+1.064209244064725085e-01 5.130895555820507070e+03
+1.084014359178332304e-01 5.008494130523924468e+03
+1.104188050854162384e-01 4.898439624678025211e+03
+1.124737178364752788e-01 4.799040978846579492e+03
+1.145668728634873235e-01 4.708645243183414095e+03
+1.166989818617147900e-01 4.625695368442065046e+03
+1.188707697711904598e-01 4.548074752333675860e+03
+1.210829750232041702e-01 4.473268118754032912e+03
+1.233363497913776835e-01 4.398905967376453191e+03
+1.256316602474122079e-01 4.322582848807149276e+03
+1.279696868215942085e-01 4.241643914900364507e+03
+1.303512244681510335e-01 4.153600790680841783e+03
+1.327770829355431614e-01 4.056610014998013412e+03
+1.352480870417876457e-01 3.950528580937374954e+03
+1.377650769549055576e-01 3.835693393546542211e+03
+1.403289084785874774e-01 3.712822216048548398e+03
+1.429404533431762603e-01 3.583727591913149354e+03
+1.456005995020651089e-01 3.450372500677370226e+03
+1.483102514336105404e-01 3.314982441094255591e+03
+1.510703304486656073e-01 3.180549996737486708e+03
+1.538817750038348198e-01 3.049810779230240314e+03
+1.567455410205596533e-01 2.925295365610905264e+03
+1.596626022101428066e-01 2.809350625196912915e+03
+1.626339504048193163e-01 2.703838105065211039e+03
+1.656605958949915747e-01 2.609752139270333373e+03
+1.687435677727377459e-01 2.527711968970045746e+03
+1.718839142817147336e-01 2.457166023450271496e+03
+1.750827031735726347e-01 2.396305806216598285e+03
+1.783410220710010818e-01 2.343122701146425698e+03
+1.816599788375329039e-01 2.294712315864971060e+03
+1.850407019542304188e-01 2.248167734336004287e+03
+1.884843409033797046e-01 2.200631590118419354e+03
+1.919920665593286002e-01 2.149475195768907270e+03
+1.955650715865951961e-01 2.093172202901665514e+03
+1.992045708453871744e-01 2.031022504868961050e+03
+2.029118018046680294e-01 1.963196395120252646e+03
+2.066880249629085842e-01 1.890582415018652682e+03
+2.105345242766707425e-01 1.814989134560793218e+03
+2.144526075971670553e-01 1.738861059612447889e+03
+2.184436071149429004e-01 1.664978831765859013e+03
+2.225088798128371514e-01 1.596035230142034152e+03
+2.266498079273696897e-01 1.533397089516501865e+03
+2.308677994187171012e-01 1.477755950976875056e+03
+2.351642884494351826e-01 1.429609286627704250e+03
+2.395407358720879898e-01 1.387924513140053705e+03
+2.439986297259552628e-01 1.350560573196762107e+03
+2.485394857429802651e-01 1.315569855585760934e+03
+2.531648478631357002e-01 1.281097467054431718e+03
+2.578762887593804565e-01 1.245333540781603006e+03
+2.626754103723841216e-01 1.206669829152846432e+03
+2.675638444552047579e-01 1.164518540098345511e+03
+2.725432531281032356e-01 1.120249324028904539e+03
+2.776153294436802255e-01 1.075352763516462346e+03
+2.827817979625344980e-01 1.031205741548980541e+03
+2.880444153396300999e-01 9.892899448795509443e+02
+2.934049709215789670e-01 9.509266405429600582e+02
+2.988652873550387556e-01 9.170193044673095528e+02
+3.044272212064303984e-01 8.868304229768906453e+02
+3.100926635931933184e-01 8.590506586586908497e+02
+3.158635408267821965e-01 8.325270806279116869e+02
+3.217418150676374378e-01 8.062836326031168710e+02
+3.277294849923384490e-01 7.794949018974457431e+02
+3.338285864731765362e-01 7.514759118756925318e+02
+3.400411932703710227e-01 7.224804784687000847e+02
+3.463694177371734462e-01 6.937347253442668489e+02
+3.528154115380888745e-01 6.663481672900741160e+02
+3.593813663804631409e-01 6.409417661244408464e+02
+3.660695147596904064e-01 6.173993000145464976e+02
+3.728821307182841327e-01 5.955364793374442343e+02
+3.798215306190739771e-01 5.750706379079458657e+02
+3.868900739327978400e-01 5.553435397240599514e+02
+3.940901640403456918e-01 5.356922667080149267e+02
+4.014242490499326799e-01 5.156686046333518334e+02
+4.088948226294864541e-01 4.956529263440326076e+02
+4.165044248545184957e-01 4.762637644992013861e+02
+4.242556430717783766e-01 4.579927807942695495e+02
+4.321511127789768314e-01 4.408403285614539300e+02
+4.401935185208876167e-01 4.245352217724005754e+02
+4.483855948021194804e-01 4.088392380449126335e+02
+4.567301270168750427e-01 3.936326638656724981e+02
+4.652299523960192196e-01 3.789034729237546912e+02
+4.738879609717662200e-01 3.646443816037000829e+02
+4.827070965603188490e-01 3.508476216973796795e+02
+4.916903577628031208e-01 3.375049942163613537e+02
+5.008407989848220332e-01 3.246079207953619061e+02
+5.101615314749841090e-01 3.121474926524777516e+02
+5.196557243827664152e-01 3.001145170874924020e+02
+5.293266058360562853e-01 2.884995615138879543e+02
+5.391774640387509976e-01 2.772929950332051590e+02
+5.492116483887793388e-01 2.664850275722658353e+02
+5.594325706169380741e-01 2.560657466143615011e+02
+5.698437059469149135e-01 2.460251515650570866e+02
+5.804485942768984330e-01 2.363531858016032743e+02
+5.912508413831880638e-01 2.270397664622699949e+02
+6.022541201461937277e-01 2.180748120382889965e+02
+6.134621717992514434e-01 2.094482678364118442e+02
+6.248788072006895566e-01 2.011501056938868146e+02
+6.365079081295583752e-01 1.931694142375353920e+02
+6.483534286054731810e-01 1.854942902404240215e+02
+6.604193962330309198e-01 1.781131932711449224e+02
+6.727099135712352185e-01 1.710150256758582259e+02
+6.852291595284072390e-01 1.641891148337662685e+02
+6.979813907830666464e-01 1.576251961659693848e+02
+7.109709432312437682e-01 1.513133968638649094e+02
+7.242022334607326473e-01 1.452442203048074134e+02
+7.376797602527740416e-01 1.394085311243024421e+02
+7.514081061116971716e-01 1.337975409154346096e+02
+7.653919388230161491e-01 1.284027945276286289e+02
+7.796360130405242117e-01 1.232161569381258772e+02
+7.941451719029344325e-01 1.182298006708148250e+02
+8.089243486805955952e-01 1.134361937382425509e+02
+8.239785684528527776e-01 1.088280880837425286e+02
+8.393129498166371771e-01 1.043985085016988705e+02
+8.549327066268397335e-01 1.001407420149794802e+02
+8.708431497690736212e-01 9.604832903135981326e+01
+8.870496889654414518e-01 9.211514445095116344e+01
+9.035578346138930517e-01 8.833542723353291137e+01
+9.203731996618237376e-01 8.470361546308565437e+01
+9.375015015145294894e-01 8.121432613727013461e+01
+9.549485639791970293e-01 7.786235058078615623e+01
+9.727203192450557534e-01 7.464264991575215902e+01
+9.908228099003807410e-01 7.155035059190528557e+01
+1.009262190987048280e+00 6.858073997916174847e+01
+1.028044732093311264e+00 6.572926202484387659e+01
+1.047176819485521548e+00 6.299151297763361157e+01
+1.066664958279539999e+00 6.036323718008893024e+01
+1.086515774652540234e+00 5.784032293135344815e+01
+1.106736018095975327e+00 5.541879842147507418e+01
+1.127332563710487623e+00 5.309482773855958015e+01
+1.148312414543511517e+00 5.086470694980314988e+01
+1.169682703970386983e+00 4.872486025726735903e+01
+1.191450698119776996e+00 4.667183622909886509e+01
+1.213623798344241500e+00 4.470230404705397831e+01
+1.236209543736770833e+00 4.281304139538133313e+01
+1.259215613694152580e+00 4.100092407620878987e+01
+1.282649830528061363e+00 3.926294012854496174e+01
+1.306520162124723550e+00 3.759618833370534929e+01
+1.330834724654076817e+00 3.599787447420692388e+01
+1.355601785329369591e+00 3.446530770345323447e+01
+1.380829765218095195e+00 3.299589702365886268e+01
+1.406527242105239051e+00 3.158714786948338826e+01
+1.432702953409832114e+00 3.023665879486837582e+01
+1.459365799155757148e+00 2.894211826060497117e+01
+1.486524844997858974e+00 2.770130152018122160e+01
+1.514189325304353684e+00 2.651206760149327479e+01
+1.542368646296628842e+00 2.537235638203244292e+01
+1.571072389247452961e+00 2.428018575519604383e+01
+1.600310313738702472e+00 2.323364888540054807e+01
+1.630092360979741750e+00 2.223091154971022831e+01
+1.660428657187532853e+00 2.127020956373159422e+01
+1.691329517029650065e+00 2.034984628842046561e+01
+1.722805447131395162e+00 1.946818977401754225e+01
+1.754867149648154490e+00 1.862366986894747001e+01
+1.787525525904237522e+00 1.781477705837402681e+01
+1.820791680099464349e+00 1.704006044064070835e+01
+1.854676923084699336e+00 1.629812558549454948e+01
+1.889192776207669233e+00 1.558763246417342785e+01
+1.924350975230332939e+00 1.490729344924630873e+01
+1.960163474319186250e+00 1.425587138214130611e+01
+1.996642450109797240e+00 1.363217770634706127e+01
+2.033800305846983569e+00 1.303507066431773787e+01
+2.071649675602070140e+00 1.246345355615941486e+01
+2.110203428568599104e+00 1.191627305822279759e+01
+2.149474673437982819e+00 1.139251759977179823e+01
+2.189476762856622738e+00 1.089121579594244338e+01
+2.230223297965942209e+00 1.041143493525238384e+01
+2.271728133026908569e+00 9.952279519964172039e+00
+2.314005380130654821e+00 9.512889857648271885e+00
+2.357069413996728091e+00 9.092440702292414301e+00
+2.400934876860655987e+00 8.690139831724637887e+00
+2.445616683452448203e+00 8.305226575773460240e+00
+2.491130026067789771e+00 7.936970929913821138e+00
+2.537490379733574830e+00 7.584672446553788028e+00
+2.584713507469566629e+00 7.247659092419762139e+00
+2.632815465648022268e+00 6.925286147492801803e+00
+2.681812609453019913e+00 6.616935144109787892e+00
+2.731721598441379850e+00 6.322012844882929805e+00
+2.782559402207126720e+00 6.039950258130324379e+00
+2.834343306151314579e+00 5.770201689550312096e+00
+2.887090917359239839e+00 5.512243828908816035e+00
+2.940820170587065352e+00 5.265574870546167574e+00
+2.995549334359819849e+00 5.029713666546412831e+00
+3.051297017182874161e+00 4.804198911446642128e+00
+3.108082173869066711e+00 4.588588357398133866e+00
+3.165924111983523304e+00 4.382458058725279493e+00
+3.224842498408446723e+00 4.185401644859933157e+00
+3.284857366030047743e+00 3.997029620661332938e+00
+3.345989120549975215e+00 3.816968660832534610e+00
+3.408258547423458129e+00 3.644860876576083264e+00
+3.471686818926565277e+00 3.480363308275051804e+00
+3.536295501355044557e+00 3.323147357951482306e+00
+3.602106562357077824e+00 3.172898209328790298e+00
+3.669142378402497684e+00 3.029314270258542496e+00
+3.737425742391067285e+00 2.892106636699705469e+00
+3.806979871402293547e+00 2.760998577465942017e+00
+3.877828414589462369e+00 2.635725038982423385e+00
+3.949995461220647819e+00 2.516032169319117884e+00
+4.023505548869293236e+00 2.401676860792685719e+00
+4.098383671757268587e+00 2.292426310452628346e+00
+4.174655289253141000e+00 2.188057597790991515e+00
+4.252346334528684046e+00 2.088357279037213132e+00
+4.331483223376407565e+00 1.993120997421965690e+00
+4.412092863191194425e+00 1.902153108814776283e+00
+4.494202662119145764e+00 1.815266322160828505e+00
+4.577840538376627855e+00 1.732281354162515274e+00
+4.663034929742737589e+00 1.653026593940350564e+00
+4.749814803228504800e+00 1.577337770978954890e+00
+4.838209664925965825e+00 1.505057665240990161e+00
+4.928249570040521554e+00 1.436035819660270496e+00
+5.019965133110086519e+00 1.370128257869219102e+00
+5.113387538414327693e+00 1.307197213272520031e+00
+5.208548550577670078e+00 1.247110869034312675e+00
+5.305480525369578260e+00 1.189743108559661922e+00
+5.404216420705918900e+00 1.134973276065996517e+00
+5.504789807854980843e+00 1.082685946855058035e+00
+5.607234882852039526e+00 1.032770706909873271e+00
+5.711586478126434940e+00 9.851219414549675646e-01
+5.817880074344945029e+00 9.396386321313821011e-01
+5.926151812475561442e+00 8.962241624506938065e-01
+6.036438506075872290e+00 8.547861312045984539e-01
+6.148777653810035382e+00 8.152361735186574032e-01
+6.263207452198697567e+00 7.774897892502017349e-01
+6.379766808606286865e+00 7.414661784415337298e-01
+6.498495354469892682e+00 7.070880762756229787e-01
+6.619433458774403256e+00 6.742815658919558697e-01
+6.742622241778349235e+00 6.429759692538004057e-01
+6.868103588995307263e+00 6.131037269298151848e-01
+6.995920165435385307e+00 5.846002635546453385e-01
+7.126115430111755522e+00 5.574038589000129829e-01
+7.258733650817255523e+00 5.314555243734631063e-01
+7.393819919175879996e+00 5.066988847232875015e-01
+7.531420165974381575e+00 4.830800647367779477e-01
+7.671581176779307398e+00 4.605475807273519129e-01
+7.814350607844559704e+00 4.390522366142187716e-01
+7.959777002314995187e+00 4.185470244059534273e-01
+8.107909806731694147e+00 3.989870289068166431e-01
+8.258799387844270257e+00 3.803293364719073089e-01
+8.412497049736131771e+00 3.625329476440693477e-01
+8.569055051268358980e+00 3.455586935121868208e-01
+8.728526623848381405e+00 3.293691556368432694e-01
+8.890965989529174607e+00 3.139285893955413020e-01
+9.056428379445300436e+00 2.992028510893340876e-01
+9.224970052592180281e+00 2.851593309298789403e-01
+9.396648314954711978e+00 2.717668830937388091e-01
+9.571521538991875744e+00 2.589957593721531337e-01
+9.749649183484095261e+00 2.468175477043588195e-01
+9.931091813749816311e+00 2.352051133629763646e-01
+1.011591112223831246e+01 2.241325426671404442e-01
+1.030416994950588894e+01 2.135750891177936039e-01
+1.049593230558227930e+01 2.035091218538486180e-01
+1.069126339173478080e+01 1.939120763319834850e-01
+1.089022962263731209e+01 1.847624071367943988e-01
+1.109289864895223410e+01 1.760395428317915179e-01
+1.129933938033224017e+01 1.677238427653876818e-01
+1.150962200885033404e+01 1.597965557494995248e-01
+1.172381803286599578e+01 1.522397805317387554e-01
+1.194200028133534275e+01 1.450364279854214900e-01
+1.216424293857369676e+01 1.381701849446975994e-01
+1.239062156947917082e+01 1.316254796150851947e-01
+1.262121314522549653e+01 1.253874478480146992e-01
+1.285609606943297401e+01 1.194418956703084539e-01
+1.309535020482668344e+01 1.137752730436333293e-01
+1.333905690039061653e+01 1.083746492763011521e-01
+1.358729901902711923e+01 1.032276851924129740e-01
+1.384016096573132870e+01 9.832260647344127913e-02
+1.409772871628967295e+01 9.364817818128176596e-02
+1.436008984651262743e+01 8.919368041138950320e-02
+1.462733356201131762e+01 8.494888502681272047e-02
+1.489955072852855444e+01 8.090403342602268955e-02
+1.517683390283407974e+01 7.704981529946015872e-02
+1.545927736419479537e+01 7.337734833163375714e-02
+1.574697714643087387e+01 6.987815880744842334e-02
+1.604003107056823296e+01 6.654416308322366747e-02
+1.633853877809863420e+01 6.336764988454078595e-02
+1.664260176485904807e+01 6.034126339468626893e-02
+1.695232341554123678e+01 5.745798709901980134e-02
+1.726780903884358409e+01 5.471112835207671277e-02
+1.758916590327734752e+01 5.209430376380049660e-02
+1.791650327363901596e+01 4.960142671171319240e-02
+1.824993244816155524e+01 4.722669305554948876e-02
+1.858956679635689113e+01 4.496456688163544962e-02
+1.893552179756295928e+01 4.280976826644838223e-02
+1.928791508020781720e+01 4.075726161997322156e-02
+1.964686646180448193e+01 3.880224455042172865e-02
+2.001249798969038451e+01 3.694013722747722245e-02
+2.038493398252466804e+01 3.516657222221043072e-02
+2.076430107255777457e+01 3.347738480273906858e-02
+2.115072824868796886e+01 3.186860366560331087e-02
+2.154434690031888167e+01 3.033644208369100717e-02
+2.194529086203317192e+01 2.887728945236604783e-02
+2.235369645909797498e+01 2.748770321624172466e-02
+2.276970255381680630e+01 2.616440115980252570e-02
+2.319345059274431975e+01 2.490425404579435162e-02
+2.362508465477949571e+01 2.370427858600391430e-02
+2.406475150015425868e+01 2.256163072970703357e-02
+2.451260062033342990e+01 2.147359915838761499e-02
+2.496878428884329537e+01 2.043759746631705967e-02
+2.543345761304651020e+01 1.945115890712689755e-02
+2.590677858688012947e+01 1.851193260314223585e-02
+2.638890814457514367e+01 1.761767821220882810e-02
+2.688001021537608537e+01 1.676626077660613515e-02
+2.738025177927863041e+01 1.595564580983258041e-02
+2.788980292380444936e+01 1.518389461037950548e-02
+2.840883690183306243e+01 1.444915979210272330e-02
+2.893753019050951991e+01 1.374968102127490689e-02
+2.947606255124862074e+01 1.308378095084855412e-02
+3.002461709085552499e+01 1.244986134289114560e-02
+3.058338032378434690e+01 1.184639937056304951e-02
+3.115254223555492885e+01 1.127194409140227886e-02
+3.173229634734980920e+01 1.072511308405332819e-02
+3.232283978181381912e+01 1.020458924093449113e-02
+3.292437333007774924e+01 9.709117709681072336e-03
+3.353710152002934564e+01 9.237502976526340559e-03
+3.416123268585530326e+01 8.788606091527682157e-03
+3.479697903887699795e+01 8.361342183347053592e-03
+3.544455673970439591e+01 7.954677908227293995e-03
+3.610418597173340771e+01 7.567628830105403541e-03
+3.677609101601034070e+01 7.199257118534379066e-03
+3.746050032748998859e+01 6.848669364209858390e-03
+3.815764661271253289e+01 6.515014495799688159e-03
+3.886776690892668285e+01 6.197481793431388643e-03
+3.959110266468466222e+01 5.895298994404163384e-03
+4.032789982193712319e+01 5.607730486891612104e-03
+4.107840889965648756e+01 5.334075587594014865e-03
+4.184288507901589327e+01 5.073666899482590954e-03
+4.262158829015329076e+01 4.825868745952818263e-03
+4.341478330055096535e+01 4.590075677871203498e-03
+4.422273980505908497e+01 4.365711050160309484e-03
+4.504573251759464370e+01 4.152225664718840574e-03
+4.588404126454762633e+01 3.949096476619344716e-03
+4.673795107992464182e+01 3.755825360666084634e-03
+4.760775230226376209e+01 3.571937929461263886e-03
+4.849374067335241278e+01 3.396982165266512494e-03
+4.939621743878323201e+01 3.230527323585466980e-03
+5.031548945038062470e+01 3.072163282598996872e-03
+5.125186927053337627e+01 2.921499586065025647e-03
+5.220567527846979772e+01 2.778164505056745625e-03
+5.317723177850979965e+01 2.641804144294649780e-03
+5.416686911033158935e+01 2.512081590958321984e-03
+5.517492376129129639e+01 2.388676103964137813e-03
+5.620173848083198465e+01 2.271282341790477333e-03
+5.724766239702188386e+01 2.159609627022701824e-03
+5.831305113526227757e+01 2.053381245876584240e-03
+5.939826693920358736e+01 1.952333781041740287e-03
+6.050367879391230730e+01 1.856216476264606905e-03
+6.162966255132947424e+01 1.764790631165705443e-03
+6.277660105806504731e+01 1.677829024856991071e-03
+6.394488428556952186e+01 1.595115366993131879e-03
+6.513490946272810334e+01 1.516443774955176984e-03
+6.634708121092350552e+01 1.441618274988239407e-03
+6.758181168161121377e+01 1.370452261040900786e-03
+6.883952069645506811e+01 1.302768015452462598e-03
+7.012063589007186692e+01 1.238396397942935013e-03
+7.142559285543141812e+01 1.177176443817071899e-03
+7.275483529196239374e+01 1.118954969881654285e-03
+7.410881515641575845e+01 1.063586199349990987e-03
+7.548799281653450066e+01 1.010931404817155994e-03
+7.689283720758322715e+01 9.608585684338117206e-04
+7.832382599179204874e+01 9.132420584487209968e-04
+7.978144572076628549e+01 8.679623213303811488e-04
+8.126619200091958817e+01 8.249055887162606545e-04
+8.277856966198484656e+01 7.839635984746931314e-04
+8.431909292866262717e+01 7.450333291988725688e-04
+8.588828559546266206e+01 7.080167474855640110e-04
+8.748668120479921129e+01 6.728205673822430484e-04
+8.911482322840208781e+01 6.393560214162807452e-04
+9.077326525210244768e+01 6.075386426481524903e-04
+9.246257116405753607e+01 5.772880567999228579e-04
+9.418331534647961689e+01 5.485277223215671849e-04
+9.593608287093162801e+01 5.211846931927308123e-04
+9.772146969725740462e+01 4.951895732692369228e-04
+9.954008287621532247e+01 4.704763592965249320e-04
+1.013925407558815550e+02 4.469822744109376686e-04
+1.032794731918953488e+02 4.246476098825447505e-04
+1.052015217616159930e+02 4.034155746862435926e-04
+1.071593399822671842e+02 3.832321525088971731e-04
+1.091535935331393574e+02 3.640459658202900789e-04
+1.111849604819272201e+02 3.458081466546025448e-04
+1.132541315152812587e+02 3.284722137670162499e-04
+1.153618101736480384e+02 3.119939558471759248e-04
+1.175087130904809243e+02 2.963313204873111611e-04
+1.196955702359044409e+02 2.814443086181322409e-04
+1.219231251649113119e+02 2.672948741401959434e-04
+1.241921352701785679e+02 2.538468284921347145e-04
+1.265033720395904595e+02 2.410657499102601339e-04
+1.288576213185518782e+02 2.289188970820020725e-04
+1.312556835771845556e+02 2.173750981072510133e-04
+1.336983741824948027e+02 2.064046357391993865e-04
+1.361865236756082709e+02 1.959792477181417504e-04
+1.387209780541623161e+02 1.860720668673969175e-04
+1.413025990599535646e+02 1.766575515066999406e-04
+1.439322644719408402e+02 1.677114194010011184e-04
+1.466108684046987207e+02 1.592105850606642106e-04
+1.493393216124254366e+02 1.511331002188681617e-04
+1.521185517986105822e+02 1.434580973213375743e-04
+1.549495039314635108e+02 1.361657358723311910e-04
+1.578331405652119770e+02 1.292371514891101927e-04
+1.607704421673825266e+02 1.226544075249713509e-04
+1.637624074521688726e+02 1.164004491283663034e-04
+1.668100537200061524e+02 1.104590596126276943e-04
+1.699144172034628184e+02 1.048148190174804392e-04
+1.730765534195726048e+02 9.945306474977135209e-05
+1.762975375287208806e+02 9.435985419680802241e-05
+1.795784647002097927e+02 8.952192920855120764e-05
+1.829204504846294697e+02 8.492667272172432075e-05
+1.863246311931563923e+02 8.056205856273910919e-05
+1.897921642839103242e+02 7.641665090049467137e-05
+1.933242287555046914e+02 7.247958123170163884e-05
+1.969220255479176558e+02 6.874051984067146780e-05
+2.005867779508236595e+02 6.518964873159618153e-05
+2.043197320195272937e+02 6.181763595483590610e-05
+2.081221569986339546e+02 5.861561125308422055e-05
+2.119953457536074666e+02 5.557514295734600950e-05
+2.159406152103568672e+02 5.268821606652842601e-05
+2.199593068030075642e+02 4.994721144806798640e-05
+2.240527869300022701e+02 4.734488610045143599e-05
+2.282224474186900522e+02 4.487435442171324145e-05
+2.324697059985649616e+02 4.252907043103751333e-05
+2.367960067833082007e+02 4.030281089348114796e-05
+2.412028207618010072e+02 3.818965930053756162e-05
+2.456916462982792950e+02 3.618399066182235996e-05
+2.502640096417923701e+02 3.428045706558934631e-05
+2.549214654451427293e+02 3.247397272822551535e-05
+2.596655972934873944e+02 3.075969766742900412e-05
+2.644980182427721047e+02 2.913302996452392488e-05
+2.694203713681887393e+02 2.758959527339008936e-05
+2.744343303228367859e+02 2.612523549037220572e-05
+2.795415999067858479e+02 2.473599800076241726e-05
+2.847439166467251539e+02 2.341812547154779913e-05
+2.900430493863995025e+02 2.216804616177011074e-05
+2.954407998880383275e+02 2.098236472340118285e-05
+3.009390034449726272e+02 1.985785346711069105e-05
+3.065395295056531495e+02 1.879144406869205595e-05
+3.122442823092858930e+02 1.778021969321972437e-05
+3.180552015332926317e+02 1.682140751525032179e-05
+3.239742629528201405e+02 1.591237161454764243e-05
+3.300034791125287938e+02 1.505060622791089519e-05
+3.361449000108773362e+02 1.423372933873105052e-05
+3.424006137971429666e+02 1.345947658687946757e-05
+3.487727474814181505e+02 1.272569548246130717e-05
+3.552634676578142603e+02 1.203034401071951131e-05
+3.618749812411286371e+02 1.137150054221203516e-05
+3.686095362172163163e+02 1.074734058602769718e-05
+3.754694224073338091e+02 1.015612525054799639e-05
+3.824569722467006727e+02 9.596197553203868587e-06
+3.895745615775508099e+02 9.065978873751504588e-06
+3.968246104569484487e+02 8.563965543143032234e-06
+4.042095839796315317e+02 8.088725563831895444e-06
+4.117319931161683826e+02 7.638895457419601245e-06
+4.193943955667190835e+02 7.213177235621834346e-06
+4.271993966306787911e+02 6.810335490607975295e-06
+4.351496500925056239e+02 6.429194600841052998e-06
+4.432478591240401897e+02 6.068636048624194793e-06
+4.514967772036102929e+02 5.727595845638640056e-06
+4.598992090522447143e+02 5.405062062837895953e-06
+4.684580115873053501e+02 5.100072461144495815e-06
+4.771760948938748470e+02 4.811712219476783399e-06
+4.860564232142144760e+02 4.539111756716844999e-06
+4.951020159556356361e+02 4.281446847433301819e-06
+5.043159487171363367e+02 4.037947575048476769e-06
+5.137013543351351927e+02 3.807884915019726144e-06
+5.232614239486669021e+02 3.590563018245509404e-06
+5.329994080844094242e+02 3.385318042670479967e-06
+5.429186177618953479e+02 3.191517012653694865e-06
+5.530224256192909706e+02 3.008556691611093616e-06
+5.633142670601361033e+02 2.835862470410448288e-06
+5.737976414214136867e+02 2.672887273710023418e-06
+5.844761131633644027e+02 2.519110486162614523e-06
+5.953533130814375909e+02 2.374036900154288824e-06
+6.064329395408067285e+02 2.237195686512131118e-06
+6.177187597338503338e+02 2.108139389396410397e-06
+6.292146109610353051e+02 1.986442946389012042e-06
+6.409244019356458466e+02 1.871702734602360469e-06
+6.528521141127858982e+02 1.763535643459684303e-06
+6.650018030431130001e+02 1.661578174638226118e-06
+6.773775997517755059e+02 1.565485569520800899e-06
+6.899837121430033449e+02 1.474930484074874425e-06
+7.028244264308359561e+02 1.389598945333144504e-06
+7.159041085964894364e+02 1.309192442618450733e-06
+7.292272058728318598e+02 1.233429234009828839e-06
+7.427982482564929114e+02 1.162043441743144975e-06
+7.566218500481064666e+02 1.094784180147399068e-06
+7.707027114212304468e+02 1.031414729887670357e-06
+7.850456200204523611e+02 9.717117561753377535e-07
+7.996554525892358924e+02 9.154645687157180317e-07
+8.145371766280749171e+02 8.624744212685296303e-07
+8.296958520834924684e+02 8.125538487975063377e-07
+8.451366330684729746e+02 7.655260402816138197e-07
+8.608647696149251942e+02 7.212242453531034077e-07
+8.768856094587448524e+02 6.794912130157791762e-07
+8.932045998580980495e+02 6.401786607815602804e-07
+9.098272894455585629e+02 6.031467726441428685e-07
+9.267593301146883960e+02 5.682637243861123890e-07
+9.440064789417618840e+02 5.354052347894061434e-07
+9.615746001432127059e+02 5.044541221563111601e-07
+9.794696670695399234e+02 4.752997271466950322e-07
+9.976977642363222003e+02 4.478376623865987622e-07
+1.016265089392997879e+03 4.219695892395076224e-07
+1.035177955630176939e+03 3.976028711269712964e-07
+1.054442793526171045e+03 3.746502446809726357e-07
+1.074066153333432794e+03 3.530295096940514890e-07
+1.094054707205743625e+03 3.326632368061512741e-07
+1.114415251466790096e+03 3.134784919263055471e-07
+1.135154708920998701e+03 2.954065764426363796e-07
+1.156280131207377053e+03 2.783827823269558446e-07
+1.177798701197121773e+03 2.623461612900246772e-07
+1.199717735435884606e+03 2.472393071904647382e-07
+1.222044686631489640e+03 2.330081509449002516e-07
+1.244787146187909229e+03 2.196017672290142420e-07
+1.267952846786434520e+03 2.069721922987867068e-07
+1.291549665014885477e+03 1.950742522989509924e-07
+1.315585624045707618e+03 1.838654014610996542e-07
+1.340068896363950444e+03 1.733055684165943068e-07
+1.365007806546015900e+03 1.633569972653195850e-07
+1.390410834090074104e+03 1.539841207394077990e-07
+1.416286616299199068e+03 1.451534464874024574e-07
+1.442643951218160055e+03 1.368334362962667786e-07
+1.469491800624820826e+03 1.289943920134236882e-07
+1.496839293077256343e+03 1.216083481164866753e-07
+1.524695727017576473e+03 1.146489705449515971e-07
+1.553070573933464402e+03 1.080914614303068088e-07
+1.581973481578601422e+03 1.019124693819923645e-07
+1.611414277253022419e+03 9.609000500641328393e-08
+1.641402971144471849e+03 9.060336135485638659e-08
+1.671949759731990525e+03 8.543303901371477760e-08
+1.703065029252847580e+03 8.056067556699039651e-08
+1.734759359233930809e+03 7.596897917669602276e-08
+1.767043526088947829e+03 7.164166604143164381e-08
+1.799928506782480554e+03 6.756340150736124058e-08
+1.833425482562289517e+03 6.371974461883442490e-08
+1.867545842761077893e+03 6.009709558611960106e-08
+1.902301188668948953e+03 5.668264083379869584e-08
+1.937703337477988271e+03 5.346430885089075922e-08
+1.973764326300258062e+03 5.043073288210340412e-08
+2.010496416260503111e+03 4.757120977040181040e-08
+2.047912096665085528e+03 4.487566099339434616e-08
+2.086024089248506243e+03 4.233459599729388045e-08
+2.124845352498887678e+03 3.993907769257995609e-08
+2.164389086064021285e+03 3.768068998353011816e-08
+2.204668735239411944e+03 3.555150721136790484e-08
+2.245697995539780095e+03 3.354406539790043376e-08
+2.287490817355703712e+03 3.165133518320451884e-08
+2.330061410696927851e+03 2.986669635723709286e-08
+2.373424250023873356e+03 2.818391389117349661e-08
+2.417594079169130964e+03 2.659711537984980774e-08
+2.462585916350551088e+03 2.510076981193351001e-08
+2.508415059277547243e+03 2.368966758939724751e-08
+2.555097090352508076e+03 2.235890172249329277e-08
+2.602647881969010086e+03 2.110385010216322796e-08
+2.651083601908546370e+03 1.992015807531788159e-08
+2.700420718837774984e+03 1.880372288143083436e-08
+2.750676007908071369e+03 1.775067988297553456e-08
+2.801866556459194271e+03 1.675738867909107997e-08
+2.854009769829240668e+03 1.582041998501096478e-08
+2.907123377272583639e+03 1.493654328475213476e-08
+2.961225437988034173e+03 1.410271521120889866e-08
+3.016334347259198694e+03 1.331606861053643337e-08
+3.072468842709010005e+03 1.257390225027679290e-08
+3.129648010670751319e+03 1.187367113309144513e-08
+3.187891292677648835e+03 1.121297738023885067e-08
+3.247218492073136986e+03 1.058956165107044873e-08
+3.307649780744241070e+03 1.000129506682317475e-08
+3.369205705980271432e+03 9.446171608876196348e-09
+3.431907197459052441e+03 8.922300963413879675e-09
+3.495775574363275155e+03 8.427901786104210651e-09
+3.560832552629283782e+03 7.961295361971753539e-09
+3.627100252330656076e+03 7.520899617249385320e-09
+3.694601205199303422e+03 7.105222659040670105e-09
+3.763358362286539887e+03 6.712857398759245125e-09
+3.833395101766611333e+03 6.342477861792603559e-09
+3.904735236885562699e+03 5.992834538379505859e-09
+3.977403024058041865e+03 5.662749914865251706e-09
+4.051423171114658999e+03 5.351114269531735473e-09
+4.126820845702955921e+03 5.056881717137372979e-09
+4.203621683844720792e+03 4.779066487266686716e-09
+4.281851798652424804e+03 4.516739422494206964e-09
+4.361537789208006870e+03 4.269024683212498981e-09
+4.442706749606892117e+03 4.035096646773060505e-09
+4.525386278170182777e+03 3.814176989335891208e-09
+4.609604486828437075e+03 3.605531939523441413e-09
+4.695390010680069281e+03 3.408469693635391772e-09
+4.782772017727482307e+03 3.222337982798852412e-09
+4.871780218794636312e+03 3.046521783007485202e-09
+4.962444877628927316e+03 2.880441159550798979e-09
+5.054796821191239360e+03 2.723549235060834764e-09
+5.148867450137499873e+03 2.575330068085192832e-09
+5.244688749495129741e+03 2.435296765942465208e-09
+5.342293299538352585e+03 2.302990178070911518e-09
+5.441714286865897520e+03 2.177977325385966956e-09
+5.542985515684682468e+03 2.059849883726137183e-09
+5.646141419303669863e+03 1.948222756660166470e-09
+5.751217071841620054e+03 1.842732732300897034e-09
+5.858248200152552272e+03 1.743037219097250476e-09
+5.967271195973315116e+03 1.648813055881487582e-09
+6.078323128297239236e+03 1.559755391736643918e-09
+6.191441755977860339e+03 1.475576631518414988e-09
+6.306665540567406424e+03 1.396005443117930114e-09
+6.424033659394202914e+03 1.320785822789743272e-09
+6.543586018883252109e+03 1.249676215091681146e-09
+6.665363268124917340e+03 1.182448684191778388e-09
+6.789406812696120141e+03 1.118888133493887237e-09
+6.915758828738544253e+03 1.058791570717497689e-09
+7.044462277299043308e+03 1.001967415219905726e-09
+7.175560918936939743e+03 9.482347613684324424e-10
+7.309099328602934293e+03 8.974226959939707260e-10
+7.445122910795144890e+03 8.493699054894687471e-10
+7.583677914997205335e+03 8.039241490255158193e-10
+7.724811451403399587e+03 7.609417381360241323e-10
+7.868571506936856167e+03 7.202870467796211546e-10
+8.015006961565422898e+03 6.818320500538355446e-10
+8.164167604921466591e+03 6.454558898500902181e-10
+8.316104153230970041e+03 6.110444658423611633e-10
+8.470868266557425159e+03 5.784900503002826411e-10
+8.628512566366893225e+03 5.476909253091798295e-10
+8.789090653419965747e+03 5.185510410658649367e-10
+8.952657125996418472e+03 4.909796939997672892e-10
+9.119267598459298824e+03 4.648912235447581697e-10
+9.288978720164512197e+03 4.402047264580647481e-10
+9.461848194722024346e+03 4.168437876495783955e-10
+9.637934799615788506e+03 3.947362265471795142e-10
+9.817298406188851004e+03 3.738138580826186610e-10
+1.000000000000000909e+04 3.540122674375591545e-10
diff --git a/Workspace/CumNumOfSat/CDM_pk.dat b/Workspace/CumNumOfSat/CDM_pk.dat
new file mode 100644
index 0000000..1add843
--- /dev/null
+++ b/Workspace/CumNumOfSat/CDM_pk.dat
@@ -0,0 +1,500 @@
+1.000000000000000021e-03 3.792523789367871359e+03
+1.024762693681054897e-03 3.879744803861932724e+03
+1.050138578360451701e-03 3.968852514485568008e+03
+1.076142838299049085e-03 4.059881206557357018e+03
+1.102791033760909534e-03 4.152864527489572538e+03
+1.130099110324144862e-03 4.247836171313635532e+03
+1.158083408422334436e-03 4.344830064171609592e+03
+1.186760673122207524e-03 4.443880350539137908e+03
+1.216148064143455533e-03 4.545021378687279139e+03
+1.246263166126647870e-03 4.648287685364999561e+03
+1.277123999155423779e-03 4.753713979684302103e+03
+1.308749029539232065e-03 4.861335126190447227e+03
+1.341157180863090069e-03 4.971186087313255484e+03
+1.374367845310950180e-03 5.083301420705155579e+03
+1.408400895269476798e-03 5.197715365334062881e+03
+1.443276695219156830e-03 5.314462145672398037e+03
+1.479016113919874283e-03 5.433575952924306876e+03
+1.515640536898216380e-03 5.555090918358480849e+03
+1.553171879244016678e-03 5.679041085584363827e+03
+1.591632598723764737e-03 5.805460381757193318e+03
+1.631045709218741264e-03 5.934382587698710267e+03
+1.671434794495923982e-03 6.065841301631775423e+03
+1.712824022319883515e-03 6.199869084712106087e+03
+1.755238158914141505e-03 6.336496435193671459e+03
+1.798702583780631371e-03 6.475753122966820229e+03
+1.843243304886113369e-03 6.617668344687844183e+03
+1.888886974224663609e-03 6.762270675043644587e+03
+1.935660903765523645e-03 6.909588016608714497e+03
+1.983593081795861392e-03 7.059647548299796654e+03
+2.032712189668232396e-03 7.212475672436953573e+03
+2.083047618962733261e-03 7.368097960421902826e+03
+2.134629489074158209e-03 7.526538843697173434e+03
+2.187488665234646468e-03 7.687819961105844413e+03
+2.241656776982631737e-03 7.851960967195835110e+03
+2.297166237089113758e-03 8.018980196677766799e+03
+2.354050260952613143e-03 8.188894595499231400e+03
+2.412342886474387865e-03 8.361719647603316844e+03
+2.472078994425825054e-03 8.537469300367230971e+03
+2.533294329320162023e-03 8.716155888779783709e+03
+2.596025520801071174e-03 8.897790058421272988e+03
+2.660310105560866403e-03 9.082380643295384289e+03
+2.726186549801485389e-03 9.269932890794036211e+03
+2.793694272251631607e-03 9.460447679234432144e+03
+2.862873667753916551e-03 9.653923383006338554e+03
+2.933766131436065135e-03 9.850355921077931271e+03
+3.006414083480667045e-03 1.004973866113433724e+04
+3.080860994508308540e-03 1.025206232321231255e+04
+3.157151411589228379e-03 1.045731488298382465e+04
+3.235330984899119529e-03 1.066548147485207664e+04
+3.315446495035002245e-03 1.087654429503030406e+04
+3.397545881007481457e-03 1.109048150780357901e+04
+3.481678268926199655e-03 1.130726385004703297e+04
+3.567894001395604826e-03 1.152685730801071441e+04
+3.656244667638633948e-03 1.174922403854446020e+04
+3.746783134366360544e-03 1.197432225981854208e+04
+3.839563577412017769e-03 1.220210614373637327e+04
+3.934641514148407015e-03 1.243252571035125948e+04
+4.032073836708022045e-03 1.266552672460821123e+04
+4.131918846025818895e-03 1.290105059574257939e+04
+4.234236286724935190e-03 1.313903401388955172e+04
+4.339087382866311723e-03 1.337940461302507538e+04
+4.446534874583561205e-03 1.362208128113070597e+04
+4.556643055624997642e-03 1.386697744353197595e+04
+4.669477811825345666e-03 1.411400107356268745e+04
+4.785106660530059376e-03 1.436305460324164233e+04
+4.903598790995936617e-03 1.461403484052687600e+04
+5.025025105792160426e-03 1.486683289367034558e+04
+5.149458263226502214e-03 1.512133410320370058e+04
+5.276972720822157605e-03 1.537741797297116864e+04
+5.407644779871160351e-03 1.563495469962909738e+04
+5.541552631091060423e-03 1.589379965610788531e+04
+5.678776401412212460e-03 1.615380011550860036e+04
+5.819398201923587158e-03 1.641479648389342401e+04
+5.963502177005896784e-03 1.667662228368426804e+04
+6.111174554681398502e-03 1.693910415137732707e+04
+6.262503698210431305e-03 1.720206185029399057e+04
+6.417580158965690423e-03 1.746530829908052328e+04
+6.576496730615773861e-03 1.772864961665323062e+04
+6.739348504650471625e-03 1.799188324294463382e+04
+6.906232927281000245e-03 1.825478258545430799e+04
+7.077249857749275987e-03 1.851710432077914083e+04
+7.252501628081010551e-03 1.877859699684180669e+04
+7.432093104318525899e-03 1.903900126175190235e+04
+7.616131749269846631e-03 1.929805004745085535e+04
+7.804727686811573778e-03 1.955546878219532664e+04
+7.997993767784136732e-03 1.981097563266972429e+04
+8.196045637518762500e-03 2.006428177644302559e+04
+8.399001805036578755e-03 2.031509146036214224e+04
+8.606983713961326166e-03 2.056308783066531396e+04
+8.820115815187979519e-03 2.080792430391797825e+04
+9.038525641350899850e-03 2.104924496064583582e+04
+9.262343883136032324e-03 2.128668695397004194e+04
+9.491704467482724519e-03 2.151988106326019624e+04
+9.726744637722099796e-03 2.174845229420541000e+04
+9.967605035699857174e-03 2.197202052542212550e+04
+1.021442978593262857e-02 2.219020120150757430e+04
+1.046736658184831657e-02 2.240260607222382168e+04
+1.072656677416193756e-02 2.260883472938946579e+04
+1.099218546143988610e-02 2.280843707953672856e+04
+1.126438158290686900e-02 2.300094486042305289e+04
+1.154331801355090205e-02 2.318588731907258261e+04
+1.182916166158346806e-02 2.336279243395841331e+04
+1.212208356831293195e-02 2.353118819748768146e+04
+1.242225901049121527e-02 2.369060396200230753e+04
+1.272986760519472828e-02 2.384057184631271957e+04
+1.304509341730255081e-02 2.398062819925338044e+04
+1.336812506963595305e-02 2.411031308725764029e+04
+1.369915585582538037e-02 2.422912870120060325e+04
+1.403838385597221475e-02 2.433654092743888032e+04
+1.438601205517471560e-02 2.443202305376191362e+04
+1.474224846498897040e-02 2.451505975779714572e+04
+1.510730624789748816e-02 2.458514932464125377e+04
+1.548140384486006160e-02 2.464180591404795996e+04
+1.586476510602303006e-02 2.468456186676041034e+04
+1.625761942466536977e-02 2.471297003867167950e+04
+1.666020187446151657e-02 2.472660614452316076e+04
+1.707275335014334788e-02 2.472506177738357292e+04
+1.749552071164514264e-02 2.470792796640082088e+04
+1.792875693181816485e-02 2.467482057263395473e+04
+1.837272124780285967e-02 2.462538813263879638e+04
+1.882767931614961338e-02 2.455931436873851271e+04
+1.929390337178054846e-02 2.447632063452962029e+04
+1.977167239088782613e-02 2.437616827669887061e+04
+2.026127225786554173e-02 2.425866089381778147e+04
+2.076299593637552510e-02 2.412364647252751092e+04
+2.127714364464897145e-02 2.397102771891002340e+04
+2.180402303512921774e-02 2.380084650717460318e+04
+2.234394937856278018e-02 2.361324747775357537e+04
+2.289724575264912715e-02 2.340842156293748121e+04
+2.346424323536181605e-02 2.318660523443267448e+04
+2.404528110305683558e-02 2.294808040214665016e+04
+2.464070703348669039e-02 2.269317410451554315e+04
+2.525087731384152712e-02 2.242225798690947340e+04
+2.587615705394208376e-02 2.213574756598410386e+04
+2.651692040471170797e-02 2.183410373900615377e+04
+2.717355078205850247e-02 2.151807475357123622e+04
+2.784644109630119574e-02 2.118888065294314947e+04
+2.853599398727644024e-02 2.084778213684280490e+04
+2.924262206526778013e-02 2.049602438926496325e+04
+2.996674815790086738e-02 2.013483172742850002e+04
+3.070880556315226662e-02 1.976540272099283902e+04
+3.146923830862368571e-02 1.938890578762458244e+04
+3.224850141723623748e-02 1.900647526599961566e+04
+3.304706117950432370e-02 1.861920796273387532e+04
+3.386539543255145945e-02 1.822829272339994714e+04
+3.470399384603552878e-02 1.783561302505007552e+04
+3.556335821515410611e-02 1.744319194013155720e+04
+3.644400276090559859e-02 1.705290509601600570e+04
+3.734645443778540630e-02 1.666648102297539299e+04
+3.827125324910176513e-02 1.628550370543383542e+04
+3.921895257009935104e-02 1.591141674087669890e+04
+4.019011947908452537e-02 1.554552887654076949e+04
+4.118533509675009752e-02 1.518902070680036741e+04
+4.220519493390249843e-02 1.484295827138491040e+04
+4.325030924779994096e-02 1.450831505244914842e+04
+4.432130340731408463e-02 1.418596345126571396e+04
+4.541881826713450171e-02 1.387667992621130543e+04
+4.654351055123903680e-02 1.358115512825275800e+04
+4.769605324586032036e-02 1.330000429533682473e+04
+4.887713600218282495e-02 1.303361454918998061e+04
+5.008746554901213899e-02 1.278144264487975670e+04
+5.132776611566269853e-02 1.254267761706032798e+04
+5.259877986531768385e-02 1.231656172876347591e+04
+5.390126733911976276e-02 1.210221655183972325e+04
+5.523600791125903714e-02 1.189800925542995901e+04
+5.660380025532985027e-02 1.170217022710384117e+04
+5.800546282223620342e-02 1.151288709101981112e+04
+5.944183432993103283e-02 1.132772174443070253e+04
+6.091377426528313266e-02 1.114415577240531275e+04
+6.242216339837123457e-02 1.095951355103262358e+04
+6.396790430951386497e-02 1.077092041272837196e+04
+6.555192192934940210e-02 1.057566688350500954e+04
+6.717516409229026819e-02 1.037122088150000673e+04
+6.883860210368225596e-02 1.015536000090658490e+04
+7.054323132100773219e-02 9.926270564713133354e+03
+7.229007174948165471e-02 9.682449597061662644e+03
+7.408016865239551441e-02 9.422762284557824387e+03
+7.591459317657567318e-02 9.147192310426013137e+03
+7.779444299332909096e-02 8.856720217762596803e+03
+7.972084295526118969e-02 8.553093013629035340e+03
+8.169494576935777685e-02 8.238654065699362036e+03
+8.371793268673477506e-02 7.916449045550020855e+03
+8.579101420946752543e-02 7.590813715643744217e+03
+8.791543081492360356e-02 7.266412266197537974e+03
+9.009245369803149661e-02 6.947399779653454971e+03
+9.232338553193047970e-02 6.638745570964948456e+03
+9.460956124745557860e-02 6.345254340046889411e+03
+9.695234883192532793e-02 6.070497365156473279e+03
+9.935315014770902675e-02 5.817728713007830265e+03
+1.018134017710646128e-01 5.589289171985990833e+03
+1.043345758517476712e-01 5.386148036406832944e+03
+1.069181809939071803e-01 5.208057929291123401e+03
+1.095657631587949044e-01 5.053369877700852157e+03
+1.122789065898271571e-01 4.919155949902810789e+03
+1.150592347605548377e-01 4.801449001404114824e+03
+1.179084113461070504e-01 4.695028574705698702e+03
+1.208281412186903991e-01 4.593957285297209637e+03
+1.238201714677400894e-01 4.492068562295751690e+03
+1.268862924453314500e-01 4.383362181700494148e+03
+1.300283388374799398e-01 4.263171418068622188e+03
+1.332481907619687544e-01 4.128291857734719997e+03
+1.365477748933621727e-01 3.977149702677044843e+03
+1.399290656158761470e-01 3.810974069042316842e+03
+1.433940862047983211e-01 3.633402260825447684e+03
+1.469449100371623962e-01 3.449847220437295618e+03
+1.505836618324028209e-01 3.266833311867088923e+03
+1.543125189237301853e-01 3.091288119636292777e+03
+1.581337125609905137e-01 2.929409482752674194e+03
+1.620495292457861669e-01 2.785799159464434979e+03
+1.660623120996587154e-01 2.662836486368212718e+03
+1.701744622661503226e-01 2.560477014289061117e+03
+1.743884403475852440e-01 2.475983726613689214e+03
+1.787067678774292567e-01 2.404453496936186639e+03
+1.831320288291094223e-01 2.339820444301672978e+03
+1.876668711621947983e-01 2.275474864501462434e+03
+1.923140084068662437e-01 2.205101173028528137e+03
+1.970762212876213115e-01 2.124161918401426192e+03
+2.019563593871862850e-01 2.031830103869559935e+03
+2.069573428516322255e-01 1.931016703750269699e+03
+2.120821641377122757e-01 1.827003812682281477e+03
+2.173338898034696542e-01 1.725876612379154722e+03
+2.227156623431849058e-01 1.633023416548022169e+03
+2.282307020677624698e-01 1.552006811751796477e+03
+2.338823090316785869e-01 1.484011577297773329e+03
+2.396738650076478960e-01 1.427587736261647024e+03
+2.456088355101865572e-01 1.378545668239194583e+03
+2.516907718692859008e-01 1.331480344621095355e+03
+2.579233133554333368e-01 1.281739528732168765e+03
+2.643101893572566974e-01 1.226851489366212718e+03
+2.708552216130918344e-01 1.167037330836015599e+03
+2.775623264978110405e-01 1.105168644748739098e+03
+2.844355173662773129e-01 1.045433401655905755e+03
+2.914789069548308631e-01 9.916379137599899423e+02
+2.986967098422417810e-01 9.452879238462395506e+02
+3.060932449716041726e-01 9.052959322710456718e+02
+3.136729382346761241e-01 8.689166797216422538e+02
+3.214403251202178624e-01 8.329694993302102830e+02
+3.294000534279085679e-01 7.952274128075491717e+02
+3.375568860494666534e-01 7.557581216368723744e+02
+3.459157038186403965e-01 7.164061834175571448e+02
+3.544815084317678999e-01 6.793838038310047978e+02
+3.632594254406620871e-01 6.461229974824561850e+02
+3.722547073196048606e-01 6.164326972224391739e+02
+3.814727366082910076e-01 5.887450109936763738e+02
+3.909190291325959077e-01 5.614791868806836419e+02
+4.005992373051017741e-01 5.340124700400776874e+02
+4.105191535073518527e-01 5.067659285145102217e+02
+4.206847135558604012e-01 4.809060524300018074e+02
+4.311020002539465157e-01 4.570040949646699460e+02
+4.417772470315250999e-01 4.349256207802362155e+02
+4.527168416750260715e-01 4.139805912478821597e+02
+4.639273301496794066e-01 3.935720500312503418e+02
+4.754154205164455860e-01 3.735865306053407835e+02
+4.871879869459442292e-01 3.544709037175168760e+02
+4.992520738317759998e-01 3.365330375884490763e+02
+5.116149000057036433e-01 3.197669265043355722e+02
+5.242838630572085323e-01 3.037202168088824124e+02
+5.372665437600143701e-01 2.882329714727278542e+02
+5.505707106082227131e-01 2.734120350588542010e+02
+5.642043244647743094e-01 2.593547940654892727e+02
+5.781755433250220788e-01 2.460909731383661381e+02
+5.924927271982571853e-01 2.334721460559719333e+02
+6.071644431101205219e-01 2.213854865441191748e+02
+6.221994702288841106e-01 2.098737864333952530e+02
+6.376068051186766228e-01 1.989681029978113713e+02
+6.533956671227865165e-01 1.886131957255447560e+02
+6.695755038802766457e-01 1.787497389584209486e+02
+6.861559969792012659e-01 1.693599114245127168e+02
+7.031470677498161681e-01 1.604401274187887907e+02
+7.205588832012368439e-01 1.519768427246841895e+02
+7.384018621051121611e-01 1.439432165067353822e+02
+7.566866812299408718e-01 1.363131778268778476e+02
+7.754242817297720691e-01 1.290651234193809671e+02
+7.946258756910984378e-01 1.221823004332425313e+02
+8.143029528418772589e-01 1.156487639426404286e+02
+8.344672874266783058e-01 1.094489544232457803e+02
+8.551309452520859944e-01 1.035671184233988384e+02
+8.763062909065544304e-01 9.798781883180888030e+01
+8.980059951590548817e-01 9.269631425914082001e+01
+9.202430425409295900e-01 8.767853335415605898e+01
+9.430307391154916230e-01 8.292106345573209580e+01
+9.663827204400274873e-01 7.841115057432959645e+01
+9.903129597249484828e-01 7.413662562965537006e+01
+1.014835776194996431e+00 7.008587132915117479e+01
+1.039965843657487676e+00 6.624780008801285192e+01
+1.065718199282737810e+00 6.261183264940588344e+01
+1.092108252601901919e+00 5.916787697519519895e+01
+1.119151794727635041e+00 5.590630392722065523e+01
+1.146865007803077097e+00 5.281793075654027803e+01
+1.175264474684825533e+00 4.989400591593022227e+01
+1.204367188865671956e+00 4.712619084675512227e+01
+1.234190564643065757e+00 4.450654235189499985e+01
+1.264752447539368996e+00 4.202749560469906243e+01
+1.296071124980151090e+00 3.968184777828177090e+01
+1.328165337236894894e+00 3.746274228011970564e+01
+1.361054288640687115e+00 3.536365397205619843e+01
+1.394757659073581291e+00 3.337837508285651467e+01
+1.429295615744525572e+00 3.150100009878662277e+01
+1.464688825256882154e+00 2.972591210708542775e+01
+1.500958465974782552e+00 2.804776985756919316e+01
+1.538126240695702363e+00 2.646149532978929741e+01
+1.576214389636841018e+00 2.496226179071599205e+01
+1.615245703743089178e+00 2.354548232805679575e+01
+1.655243538324519426e+00 2.220679884447865859e+01
+1.696231827031595252e+00 2.094207048686194383e+01
+1.738235096176433014e+00 1.974735741002979239e+01
+1.781278479408709092e+00 1.861891684445336637e+01
+1.825387732754962578e+00 1.755319747124634944e+01
+1.870589250030329165e+00 1.654683019088044205e+01
+1.916910078631902437e+00 1.559661928428773869e+01
+1.964377935723191415e+00 1.469953397115660110e+01
+2.013021224819327770e+00 1.385270034948444362e+01
+2.062869052782990931e+00 1.305339370097345864e+01
+2.113951247241182330e+00 1.229903118641597359e+01
+2.166298374433299756e+00 1.158716646071580669e+01
+2.219941757501158630e+00 1.091548311762401546e+01
+2.274913495231942751e+00 1.028178582934778085e+01
+2.331246481265267345e+00 9.683994202078462621e+00
+2.388974423775876321e+00 9.120137094037998438e+00
+2.448131865643713212e+00 8.588347192523379192e+00
+2.508754205123478354e+00 8.086855839546773339e+00
+2.570877717026009535e+00 7.613988095997906491e+00
+2.634539574424171970e+00 7.168158034578469895e+00
+2.699777870896254317e+00 6.747863887253823911e+00
+2.766631643320149436e+00 6.351682675634034325e+00
+2.835140895232000080e+00 5.978267620433150853e+00
+2.905346620763258780e+00 5.626344698615158180e+00
+2.977290829170507802e+00 5.294708875067508203e+00
+3.051016569972671455e+00 4.982220519004603609e+00
+3.126567958710727790e+00 4.687801996724296316e+00
+3.203990203345279397e+00 4.410434432657267756e+00
+3.283329631307819518e+00 4.149154630978863167e+00
+3.364633717221826359e+00 3.903052150345458493e+00
+3.447951111310339822e+00 3.671266524271561860e+00
+3.533331668506967560e+00 3.452984621371824936e+00
+3.620826478287776151e+00 3.247438138585649003e+00
+3.710487895241869616e+00 3.053901220418500095e+00
+3.802369570399006360e+00 2.871688198674210213e+00
+3.896526483332957813e+00 2.700151446974948577e+00
+3.993014975059850258e+00 2.538679344596879606e+00
+4.091892781751123032e+00 2.386694344388058386e+00
+4.193219069281346023e+00 2.243651139434943431e+00
+4.297054468631518631e+00 2.109034741460215301e+00
+4.403461112169044789e+00 1.982358596492260316e+00
+4.512502670826123996e+00 1.863163516426733501e+00
+4.624244392198733955e+00 1.751016264000423428e+00
+4.738753139589087837e+00 1.645508125343956740e+00
+4.856097432014864879e+00 1.546253558560075403e+00
+4.976347485209206667e+00 1.452888914434084189e+00
+5.099575253635930672e+00 1.365071225573021518e+00
+5.225854473545205714e+00 1.282477060451095552e+00
+5.355260707095371053e+00 1.204801465631485602e+00
+5.487871387567363257e+00 1.131757146258389080e+00
+5.623765865698720390e+00 1.063073323824699212e+00
+5.763025457164991039e+00 9.984946730937257486e-01
+5.905733491236882848e+00 9.377804650130164843e-01
+6.051975360642329882e+00 8.807037568412225959e-01
+6.201838572663207927e+00 8.270506255483156544e-01
+6.355412801497418052e+00 7.766194422871625092e-01
+6.512789941917547232e+00 7.292201858394434799e-01
+6.674064164258307841e+00 6.846737916892643439e-01
+6.839331970765542223e+00 6.428114474202145656e-01
+7.008692253340655931e+00 6.034739828538916440e-01
+7.182246352714913407e+00 5.665114821373087306e-01
+7.360098119089059310e+00 5.317827713601842587e-01
+7.542353974274570660e+00 4.991549193436613518e-01
+7.729122975373620363e+00 4.685027662492189382e-01
+7.920516880036001517e+00 4.397084785014190866e-01
+8.116650213331949359e+00 4.126611285969881138e-01
+8.317640336280957669e+00 3.872562984475159120e-01
+8.523607516077470692e+00 3.633957063601233606e-01
+8.734674998055634632e+00 3.409868590838657787e-01
+8.950969079436047693e+00 3.199427117656900021e-01
+9.172619184898717748e+00 3.001813507322514396e-01
+9.399757944027332002e+00 2.816256969365291130e-01
+9.632521270671343672e+00 2.642032261529120296e-01
+9.871048444273215594e+00 2.478457049983534832e-01
+1.011548219320960662e+01 2.324889419084505415e-01
+1.036596878019622281e+01 2.180725522437348129e-01
+1.062265808980760085e+01 2.045397372339071151e-01
+1.088570371816408766e+01 1.918370859308195786e-01
+1.115526306483970664e+01 1.799143751576519346e-01
+1.143149742704589578e+01 1.687243705729758736e-01
+1.171457209614760053e+01 1.582226517279954892e-01
+1.200465645656913871e+01 1.483674476986301671e-01
+1.230192408714945884e+01 1.391194820949905597e-01
+1.260655286500713324e+01 1.304418269283280640e-01
+1.291872507197733100e+01 1.222997648433618301e-01
+1.323862750368447117e+01 1.146606592477950326e-01
+1.356645158131579798e+01 1.074938230270752471e-01
+1.390239346616278659e+01 1.007703871411979590e-01
+1.424665417699884529e+01 9.446322031759944726e-02
+1.459943971036379118e+01 8.854683172468305608e-02
+1.496096116382656049e+01 8.299727306105733615e-02
+1.533143486230055608e+01 7.779204640692093109e-02
+1.571108248748675251e+01 7.291001750367039069e-02
+1.610013121052217500e+01 6.833133414682594775e-02
+1.649881382791312845e+01 6.403734939533578530e-02
+1.690736890083449495e+01 6.001054993062009124e-02
+1.732604089787842128e+01 5.623449427341536966e-02
+1.775508034133801516e+01 5.269374447036950793e-02
+1.819474395711309000e+01 4.937380085670604879e-02
+1.864529482832830709e+01 4.626104579152487406e-02
+1.910700255275515858e+01 4.334269079380981965e-02
+1.958014340413216914e+01 4.060672679313531014e-02
+2.006500049747982573e+01 3.804187731515315529e-02
+2.056186395850913229e+01 3.563755443209509766e-02
+2.107103109722521950e+01 3.338381729696466432e-02
+2.159280658582974866e+01 3.127133057803828387e-02
+2.212750264102891862e+01 2.929132620067401160e-02
+2.267543921085545122e+01 2.743557426919359180e-02
+2.323694416611724733e+01 2.569635100066858940e-02
+2.381235349658658862e+01 2.406640793309292037e-02
+2.440201151204755803e+01 2.253894298558277789e-02
+2.500627104832197034e+01 2.110757326056718688e-02
+2.562549367839700309e+01 1.976630948438608606e-02
+2.626004992878090505e+01 1.850953198879023986e-02
+2.691031950121651661e+01 1.733196804892951637e-02
+2.757669149988446122e+01 1.622867020783512471e-02
+2.825956466423305358e+01 1.519499685524771000e-02
+2.895934760757342019e+01 1.422659376407666744e-02
+2.967645906158295332e+01 1.331937647137507869e-02
+3.041132812686329956e+01 1.246951372776108034e-02
+3.116439452970286794e+01 1.167341195195372404e-02
+3.193610888519738111e+01 1.092770063002920962e-02
+3.272693296688634490e+01 1.022921860259229897e-02
+3.353733998306577035e+01 9.575001185478059645e-03
+3.436781485994382734e+01 8.962268044974708650e-03
+3.521885453180782122e+01 8.388411843493513015e-03
+3.609096823837661816e+01 7.850987618237046869e-03
+3.698467782951622240e+01 7.347702767455738075e-03
+3.790051807750103308e+01 6.876407645665983531e-03
+3.883903699700748291e+01 6.435086733694331436e-03
+3.980079617303145767e+01 6.021850348773130635e-03
+4.078637109692634510e+01 5.634926861993832387e-03
+4.179635151076136168e+01 5.272655392383395964e-03
+4.283134176020804773e+01 4.933478577678587079e-03
+4.389196115616465477e+01 4.615935223690709015e-03
+4.497884434533552422e+01 4.318655660854548405e-03
+4.609264168998692668e+01 4.040356405855364229e-03
+4.723401965710669259e+01 3.779834764236723096e-03
+4.840366121720045811e+01 3.535963769895351504e-03
+4.960226625296355252e+01 3.307687440473815101e-03
+5.083055197807182424e+01 3.094016328969348504e-03
+5.208925336634376180e+01 2.894023353102423077e-03
+5.337912359152939246e+01 2.706839861503414994e-03
+5.470093447798961250e+01 2.531651651771988591e-03
+5.605547696253552203e+01 2.367695711574161962e-03
+5.744356156770422928e+01 2.214257297343321697e-03
+5.886601888675411232e+01 2.070666897760807621e-03
+6.032370008066987310e+01 1.936297380565778995e-03
+6.181747738747533560e+01 1.810561319174121189e-03
+6.334824464415692802e+01 1.692908487758741512e-03
+6.491691782151272605e+01 1.582823514162005419e-03
+6.652443557224506776e+01 1.479823680191737255e-03
+6.817175979262565022e+01 1.383456725266362297e-03
+6.985987619806888915e+01 1.293298782881241622e-03
+7.158979491295809794e+01 1.208952907980765561e-03
+7.336255107507707862e+01 1.130047416377437429e-03
+7.517920545500996354e+01 1.056234279003779794e-03
+7.704084509087746824e+01 9.871876184811725734e-04
+7.894858393879248126e+01 9.226023014482117842e-04
+8.090356353942185308e+01 8.621926205152353464e-04
+8.290695370105433426e+01 8.056910601079030109e-04
+8.495995319958294090e+01 7.528470658229559831e-04
+8.706379049582098162e+01 7.034254715509413421e-04
+8.921972447058035982e+01 6.572059500757416106e-04
+9.142904517795346919e+01 6.139823783875471026e-04
+9.369307461724646657e+01 5.735619156369959042e-04
+9.601316752402956922e+01 5.357641397858091100e-04
+9.839071218077494052e+01 5.004202412563110540e-04
+1.008271312475683033e+02 4.673722697372398923e-04
+1.033238826133913761e+02 4.364724305687456198e-04
+1.058824602684840670e+02 4.075824314286831179e-04
+1.085043951983090125e+02 3.805730662224639173e-04
+1.111912562996526503e+02 3.553236661260388224e-04
+1.139446513194126140e+02 3.317212365836592837e-04
+1.167662278166298506e+02 3.096599489378297335e-04
+1.196576741483453361e+02 2.890406901787142126e-04
+1.226207204798683108e+02 2.697706408189473994e-04
+1.256571398200615448e+02 2.517628791407535696e-04
+1.287687490822632412e+02 2.349360101717087325e-04
+1.319574101714799497e+02 2.192138178480766459e-04
+1.352250310985013471e+02 2.045246387788357165e-04
+1.385735671216046683e+02 1.908000789249415091e-04
+1.420050219165280794e+02 1.779760535092869450e-04
+1.455214487754185768e+02 1.659929337033137818e-04
+1.491249518354676127e+02 1.547952157448175166e-04
+1.528176873379713641e+02 1.443312162297287406e-04
+1.566018649185687934e+02 1.345527914696838137e-04
+1.604797489294292632e+02 1.254150788998991241e-04
+1.644536597941813341e+02 1.168762586998709163e-04
+1.685259753963927096e+02 1.088974201514990932e-04
+1.726991325024345940e+02 1.014439138394071521e-04
+1.769756282195763220e+02 9.448450825070801179e-05
+1.813580214901899694e+02 8.798948485643471955e-05
+1.858489346229537205e+02 8.193054666246069723e-05
+1.904510548619723238e+02 7.628079169069566139e-05
+1.951671359947531528e+02 7.101468169606593738e-05
+2.000000000000000284e+02 6.610800689791198129e-05
diff --git a/Workspace/CumNumOfSat/HaloDistributionFunction/CDM_pk.dat b/Workspace/CumNumOfSat/HaloDistributionFunction/CDM_pk.dat
new file mode 100644
index 0000000..1add843
--- /dev/null
+++ b/Workspace/CumNumOfSat/HaloDistributionFunction/CDM_pk.dat
@@ -0,0 +1,500 @@
+1.000000000000000021e-03 3.792523789367871359e+03
+1.024762693681054897e-03 3.879744803861932724e+03
+1.050138578360451701e-03 3.968852514485568008e+03
+1.076142838299049085e-03 4.059881206557357018e+03
+1.102791033760909534e-03 4.152864527489572538e+03
+1.130099110324144862e-03 4.247836171313635532e+03
+1.158083408422334436e-03 4.344830064171609592e+03
+1.186760673122207524e-03 4.443880350539137908e+03
+1.216148064143455533e-03 4.545021378687279139e+03
+1.246263166126647870e-03 4.648287685364999561e+03
+1.277123999155423779e-03 4.753713979684302103e+03
+1.308749029539232065e-03 4.861335126190447227e+03
+1.341157180863090069e-03 4.971186087313255484e+03
+1.374367845310950180e-03 5.083301420705155579e+03
+1.408400895269476798e-03 5.197715365334062881e+03
+1.443276695219156830e-03 5.314462145672398037e+03
+1.479016113919874283e-03 5.433575952924306876e+03
+1.515640536898216380e-03 5.555090918358480849e+03
+1.553171879244016678e-03 5.679041085584363827e+03
+1.591632598723764737e-03 5.805460381757193318e+03
+1.631045709218741264e-03 5.934382587698710267e+03
+1.671434794495923982e-03 6.065841301631775423e+03
+1.712824022319883515e-03 6.199869084712106087e+03
+1.755238158914141505e-03 6.336496435193671459e+03
+1.798702583780631371e-03 6.475753122966820229e+03
+1.843243304886113369e-03 6.617668344687844183e+03
+1.888886974224663609e-03 6.762270675043644587e+03
+1.935660903765523645e-03 6.909588016608714497e+03
+1.983593081795861392e-03 7.059647548299796654e+03
+2.032712189668232396e-03 7.212475672436953573e+03
+2.083047618962733261e-03 7.368097960421902826e+03
+2.134629489074158209e-03 7.526538843697173434e+03
+2.187488665234646468e-03 7.687819961105844413e+03
+2.241656776982631737e-03 7.851960967195835110e+03
+2.297166237089113758e-03 8.018980196677766799e+03
+2.354050260952613143e-03 8.188894595499231400e+03
+2.412342886474387865e-03 8.361719647603316844e+03
+2.472078994425825054e-03 8.537469300367230971e+03
+2.533294329320162023e-03 8.716155888779783709e+03
+2.596025520801071174e-03 8.897790058421272988e+03
+2.660310105560866403e-03 9.082380643295384289e+03
+2.726186549801485389e-03 9.269932890794036211e+03
+2.793694272251631607e-03 9.460447679234432144e+03
+2.862873667753916551e-03 9.653923383006338554e+03
+2.933766131436065135e-03 9.850355921077931271e+03
+3.006414083480667045e-03 1.004973866113433724e+04
+3.080860994508308540e-03 1.025206232321231255e+04
+3.157151411589228379e-03 1.045731488298382465e+04
+3.235330984899119529e-03 1.066548147485207664e+04
+3.315446495035002245e-03 1.087654429503030406e+04
+3.397545881007481457e-03 1.109048150780357901e+04
+3.481678268926199655e-03 1.130726385004703297e+04
+3.567894001395604826e-03 1.152685730801071441e+04
+3.656244667638633948e-03 1.174922403854446020e+04
+3.746783134366360544e-03 1.197432225981854208e+04
+3.839563577412017769e-03 1.220210614373637327e+04
+3.934641514148407015e-03 1.243252571035125948e+04
+4.032073836708022045e-03 1.266552672460821123e+04
+4.131918846025818895e-03 1.290105059574257939e+04
+4.234236286724935190e-03 1.313903401388955172e+04
+4.339087382866311723e-03 1.337940461302507538e+04
+4.446534874583561205e-03 1.362208128113070597e+04
+4.556643055624997642e-03 1.386697744353197595e+04
+4.669477811825345666e-03 1.411400107356268745e+04
+4.785106660530059376e-03 1.436305460324164233e+04
+4.903598790995936617e-03 1.461403484052687600e+04
+5.025025105792160426e-03 1.486683289367034558e+04
+5.149458263226502214e-03 1.512133410320370058e+04
+5.276972720822157605e-03 1.537741797297116864e+04
+5.407644779871160351e-03 1.563495469962909738e+04
+5.541552631091060423e-03 1.589379965610788531e+04
+5.678776401412212460e-03 1.615380011550860036e+04
+5.819398201923587158e-03 1.641479648389342401e+04
+5.963502177005896784e-03 1.667662228368426804e+04
+6.111174554681398502e-03 1.693910415137732707e+04
+6.262503698210431305e-03 1.720206185029399057e+04
+6.417580158965690423e-03 1.746530829908052328e+04
+6.576496730615773861e-03 1.772864961665323062e+04
+6.739348504650471625e-03 1.799188324294463382e+04
+6.906232927281000245e-03 1.825478258545430799e+04
+7.077249857749275987e-03 1.851710432077914083e+04
+7.252501628081010551e-03 1.877859699684180669e+04
+7.432093104318525899e-03 1.903900126175190235e+04
+7.616131749269846631e-03 1.929805004745085535e+04
+7.804727686811573778e-03 1.955546878219532664e+04
+7.997993767784136732e-03 1.981097563266972429e+04
+8.196045637518762500e-03 2.006428177644302559e+04
+8.399001805036578755e-03 2.031509146036214224e+04
+8.606983713961326166e-03 2.056308783066531396e+04
+8.820115815187979519e-03 2.080792430391797825e+04
+9.038525641350899850e-03 2.104924496064583582e+04
+9.262343883136032324e-03 2.128668695397004194e+04
+9.491704467482724519e-03 2.151988106326019624e+04
+9.726744637722099796e-03 2.174845229420541000e+04
+9.967605035699857174e-03 2.197202052542212550e+04
+1.021442978593262857e-02 2.219020120150757430e+04
+1.046736658184831657e-02 2.240260607222382168e+04
+1.072656677416193756e-02 2.260883472938946579e+04
+1.099218546143988610e-02 2.280843707953672856e+04
+1.126438158290686900e-02 2.300094486042305289e+04
+1.154331801355090205e-02 2.318588731907258261e+04
+1.182916166158346806e-02 2.336279243395841331e+04
+1.212208356831293195e-02 2.353118819748768146e+04
+1.242225901049121527e-02 2.369060396200230753e+04
+1.272986760519472828e-02 2.384057184631271957e+04
+1.304509341730255081e-02 2.398062819925338044e+04
+1.336812506963595305e-02 2.411031308725764029e+04
+1.369915585582538037e-02 2.422912870120060325e+04
+1.403838385597221475e-02 2.433654092743888032e+04
+1.438601205517471560e-02 2.443202305376191362e+04
+1.474224846498897040e-02 2.451505975779714572e+04
+1.510730624789748816e-02 2.458514932464125377e+04
+1.548140384486006160e-02 2.464180591404795996e+04
+1.586476510602303006e-02 2.468456186676041034e+04
+1.625761942466536977e-02 2.471297003867167950e+04
+1.666020187446151657e-02 2.472660614452316076e+04
+1.707275335014334788e-02 2.472506177738357292e+04
+1.749552071164514264e-02 2.470792796640082088e+04
+1.792875693181816485e-02 2.467482057263395473e+04
+1.837272124780285967e-02 2.462538813263879638e+04
+1.882767931614961338e-02 2.455931436873851271e+04
+1.929390337178054846e-02 2.447632063452962029e+04
+1.977167239088782613e-02 2.437616827669887061e+04
+2.026127225786554173e-02 2.425866089381778147e+04
+2.076299593637552510e-02 2.412364647252751092e+04
+2.127714364464897145e-02 2.397102771891002340e+04
+2.180402303512921774e-02 2.380084650717460318e+04
+2.234394937856278018e-02 2.361324747775357537e+04
+2.289724575264912715e-02 2.340842156293748121e+04
+2.346424323536181605e-02 2.318660523443267448e+04
+2.404528110305683558e-02 2.294808040214665016e+04
+2.464070703348669039e-02 2.269317410451554315e+04
+2.525087731384152712e-02 2.242225798690947340e+04
+2.587615705394208376e-02 2.213574756598410386e+04
+2.651692040471170797e-02 2.183410373900615377e+04
+2.717355078205850247e-02 2.151807475357123622e+04
+2.784644109630119574e-02 2.118888065294314947e+04
+2.853599398727644024e-02 2.084778213684280490e+04
+2.924262206526778013e-02 2.049602438926496325e+04
+2.996674815790086738e-02 2.013483172742850002e+04
+3.070880556315226662e-02 1.976540272099283902e+04
+3.146923830862368571e-02 1.938890578762458244e+04
+3.224850141723623748e-02 1.900647526599961566e+04
+3.304706117950432370e-02 1.861920796273387532e+04
+3.386539543255145945e-02 1.822829272339994714e+04
+3.470399384603552878e-02 1.783561302505007552e+04
+3.556335821515410611e-02 1.744319194013155720e+04
+3.644400276090559859e-02 1.705290509601600570e+04
+3.734645443778540630e-02 1.666648102297539299e+04
+3.827125324910176513e-02 1.628550370543383542e+04
+3.921895257009935104e-02 1.591141674087669890e+04
+4.019011947908452537e-02 1.554552887654076949e+04
+4.118533509675009752e-02 1.518902070680036741e+04
+4.220519493390249843e-02 1.484295827138491040e+04
+4.325030924779994096e-02 1.450831505244914842e+04
+4.432130340731408463e-02 1.418596345126571396e+04
+4.541881826713450171e-02 1.387667992621130543e+04
+4.654351055123903680e-02 1.358115512825275800e+04
+4.769605324586032036e-02 1.330000429533682473e+04
+4.887713600218282495e-02 1.303361454918998061e+04
+5.008746554901213899e-02 1.278144264487975670e+04
+5.132776611566269853e-02 1.254267761706032798e+04
+5.259877986531768385e-02 1.231656172876347591e+04
+5.390126733911976276e-02 1.210221655183972325e+04
+5.523600791125903714e-02 1.189800925542995901e+04
+5.660380025532985027e-02 1.170217022710384117e+04
+5.800546282223620342e-02 1.151288709101981112e+04
+5.944183432993103283e-02 1.132772174443070253e+04
+6.091377426528313266e-02 1.114415577240531275e+04
+6.242216339837123457e-02 1.095951355103262358e+04
+6.396790430951386497e-02 1.077092041272837196e+04
+6.555192192934940210e-02 1.057566688350500954e+04
+6.717516409229026819e-02 1.037122088150000673e+04
+6.883860210368225596e-02 1.015536000090658490e+04
+7.054323132100773219e-02 9.926270564713133354e+03
+7.229007174948165471e-02 9.682449597061662644e+03
+7.408016865239551441e-02 9.422762284557824387e+03
+7.591459317657567318e-02 9.147192310426013137e+03
+7.779444299332909096e-02 8.856720217762596803e+03
+7.972084295526118969e-02 8.553093013629035340e+03
+8.169494576935777685e-02 8.238654065699362036e+03
+8.371793268673477506e-02 7.916449045550020855e+03
+8.579101420946752543e-02 7.590813715643744217e+03
+8.791543081492360356e-02 7.266412266197537974e+03
+9.009245369803149661e-02 6.947399779653454971e+03
+9.232338553193047970e-02 6.638745570964948456e+03
+9.460956124745557860e-02 6.345254340046889411e+03
+9.695234883192532793e-02 6.070497365156473279e+03
+9.935315014770902675e-02 5.817728713007830265e+03
+1.018134017710646128e-01 5.589289171985990833e+03
+1.043345758517476712e-01 5.386148036406832944e+03
+1.069181809939071803e-01 5.208057929291123401e+03
+1.095657631587949044e-01 5.053369877700852157e+03
+1.122789065898271571e-01 4.919155949902810789e+03
+1.150592347605548377e-01 4.801449001404114824e+03
+1.179084113461070504e-01 4.695028574705698702e+03
+1.208281412186903991e-01 4.593957285297209637e+03
+1.238201714677400894e-01 4.492068562295751690e+03
+1.268862924453314500e-01 4.383362181700494148e+03
+1.300283388374799398e-01 4.263171418068622188e+03
+1.332481907619687544e-01 4.128291857734719997e+03
+1.365477748933621727e-01 3.977149702677044843e+03
+1.399290656158761470e-01 3.810974069042316842e+03
+1.433940862047983211e-01 3.633402260825447684e+03
+1.469449100371623962e-01 3.449847220437295618e+03
+1.505836618324028209e-01 3.266833311867088923e+03
+1.543125189237301853e-01 3.091288119636292777e+03
+1.581337125609905137e-01 2.929409482752674194e+03
+1.620495292457861669e-01 2.785799159464434979e+03
+1.660623120996587154e-01 2.662836486368212718e+03
+1.701744622661503226e-01 2.560477014289061117e+03
+1.743884403475852440e-01 2.475983726613689214e+03
+1.787067678774292567e-01 2.404453496936186639e+03
+1.831320288291094223e-01 2.339820444301672978e+03
+1.876668711621947983e-01 2.275474864501462434e+03
+1.923140084068662437e-01 2.205101173028528137e+03
+1.970762212876213115e-01 2.124161918401426192e+03
+2.019563593871862850e-01 2.031830103869559935e+03
+2.069573428516322255e-01 1.931016703750269699e+03
+2.120821641377122757e-01 1.827003812682281477e+03
+2.173338898034696542e-01 1.725876612379154722e+03
+2.227156623431849058e-01 1.633023416548022169e+03
+2.282307020677624698e-01 1.552006811751796477e+03
+2.338823090316785869e-01 1.484011577297773329e+03
+2.396738650076478960e-01 1.427587736261647024e+03
+2.456088355101865572e-01 1.378545668239194583e+03
+2.516907718692859008e-01 1.331480344621095355e+03
+2.579233133554333368e-01 1.281739528732168765e+03
+2.643101893572566974e-01 1.226851489366212718e+03
+2.708552216130918344e-01 1.167037330836015599e+03
+2.775623264978110405e-01 1.105168644748739098e+03
+2.844355173662773129e-01 1.045433401655905755e+03
+2.914789069548308631e-01 9.916379137599899423e+02
+2.986967098422417810e-01 9.452879238462395506e+02
+3.060932449716041726e-01 9.052959322710456718e+02
+3.136729382346761241e-01 8.689166797216422538e+02
+3.214403251202178624e-01 8.329694993302102830e+02
+3.294000534279085679e-01 7.952274128075491717e+02
+3.375568860494666534e-01 7.557581216368723744e+02
+3.459157038186403965e-01 7.164061834175571448e+02
+3.544815084317678999e-01 6.793838038310047978e+02
+3.632594254406620871e-01 6.461229974824561850e+02
+3.722547073196048606e-01 6.164326972224391739e+02
+3.814727366082910076e-01 5.887450109936763738e+02
+3.909190291325959077e-01 5.614791868806836419e+02
+4.005992373051017741e-01 5.340124700400776874e+02
+4.105191535073518527e-01 5.067659285145102217e+02
+4.206847135558604012e-01 4.809060524300018074e+02
+4.311020002539465157e-01 4.570040949646699460e+02
+4.417772470315250999e-01 4.349256207802362155e+02
+4.527168416750260715e-01 4.139805912478821597e+02
+4.639273301496794066e-01 3.935720500312503418e+02
+4.754154205164455860e-01 3.735865306053407835e+02
+4.871879869459442292e-01 3.544709037175168760e+02
+4.992520738317759998e-01 3.365330375884490763e+02
+5.116149000057036433e-01 3.197669265043355722e+02
+5.242838630572085323e-01 3.037202168088824124e+02
+5.372665437600143701e-01 2.882329714727278542e+02
+5.505707106082227131e-01 2.734120350588542010e+02
+5.642043244647743094e-01 2.593547940654892727e+02
+5.781755433250220788e-01 2.460909731383661381e+02
+5.924927271982571853e-01 2.334721460559719333e+02
+6.071644431101205219e-01 2.213854865441191748e+02
+6.221994702288841106e-01 2.098737864333952530e+02
+6.376068051186766228e-01 1.989681029978113713e+02
+6.533956671227865165e-01 1.886131957255447560e+02
+6.695755038802766457e-01 1.787497389584209486e+02
+6.861559969792012659e-01 1.693599114245127168e+02
+7.031470677498161681e-01 1.604401274187887907e+02
+7.205588832012368439e-01 1.519768427246841895e+02
+7.384018621051121611e-01 1.439432165067353822e+02
+7.566866812299408718e-01 1.363131778268778476e+02
+7.754242817297720691e-01 1.290651234193809671e+02
+7.946258756910984378e-01 1.221823004332425313e+02
+8.143029528418772589e-01 1.156487639426404286e+02
+8.344672874266783058e-01 1.094489544232457803e+02
+8.551309452520859944e-01 1.035671184233988384e+02
+8.763062909065544304e-01 9.798781883180888030e+01
+8.980059951590548817e-01 9.269631425914082001e+01
+9.202430425409295900e-01 8.767853335415605898e+01
+9.430307391154916230e-01 8.292106345573209580e+01
+9.663827204400274873e-01 7.841115057432959645e+01
+9.903129597249484828e-01 7.413662562965537006e+01
+1.014835776194996431e+00 7.008587132915117479e+01
+1.039965843657487676e+00 6.624780008801285192e+01
+1.065718199282737810e+00 6.261183264940588344e+01
+1.092108252601901919e+00 5.916787697519519895e+01
+1.119151794727635041e+00 5.590630392722065523e+01
+1.146865007803077097e+00 5.281793075654027803e+01
+1.175264474684825533e+00 4.989400591593022227e+01
+1.204367188865671956e+00 4.712619084675512227e+01
+1.234190564643065757e+00 4.450654235189499985e+01
+1.264752447539368996e+00 4.202749560469906243e+01
+1.296071124980151090e+00 3.968184777828177090e+01
+1.328165337236894894e+00 3.746274228011970564e+01
+1.361054288640687115e+00 3.536365397205619843e+01
+1.394757659073581291e+00 3.337837508285651467e+01
+1.429295615744525572e+00 3.150100009878662277e+01
+1.464688825256882154e+00 2.972591210708542775e+01
+1.500958465974782552e+00 2.804776985756919316e+01
+1.538126240695702363e+00 2.646149532978929741e+01
+1.576214389636841018e+00 2.496226179071599205e+01
+1.615245703743089178e+00 2.354548232805679575e+01
+1.655243538324519426e+00 2.220679884447865859e+01
+1.696231827031595252e+00 2.094207048686194383e+01
+1.738235096176433014e+00 1.974735741002979239e+01
+1.781278479408709092e+00 1.861891684445336637e+01
+1.825387732754962578e+00 1.755319747124634944e+01
+1.870589250030329165e+00 1.654683019088044205e+01
+1.916910078631902437e+00 1.559661928428773869e+01
+1.964377935723191415e+00 1.469953397115660110e+01
+2.013021224819327770e+00 1.385270034948444362e+01
+2.062869052782990931e+00 1.305339370097345864e+01
+2.113951247241182330e+00 1.229903118641597359e+01
+2.166298374433299756e+00 1.158716646071580669e+01
+2.219941757501158630e+00 1.091548311762401546e+01
+2.274913495231942751e+00 1.028178582934778085e+01
+2.331246481265267345e+00 9.683994202078462621e+00
+2.388974423775876321e+00 9.120137094037998438e+00
+2.448131865643713212e+00 8.588347192523379192e+00
+2.508754205123478354e+00 8.086855839546773339e+00
+2.570877717026009535e+00 7.613988095997906491e+00
+2.634539574424171970e+00 7.168158034578469895e+00
+2.699777870896254317e+00 6.747863887253823911e+00
+2.766631643320149436e+00 6.351682675634034325e+00
+2.835140895232000080e+00 5.978267620433150853e+00
+2.905346620763258780e+00 5.626344698615158180e+00
+2.977290829170507802e+00 5.294708875067508203e+00
+3.051016569972671455e+00 4.982220519004603609e+00
+3.126567958710727790e+00 4.687801996724296316e+00
+3.203990203345279397e+00 4.410434432657267756e+00
+3.283329631307819518e+00 4.149154630978863167e+00
+3.364633717221826359e+00 3.903052150345458493e+00
+3.447951111310339822e+00 3.671266524271561860e+00
+3.533331668506967560e+00 3.452984621371824936e+00
+3.620826478287776151e+00 3.247438138585649003e+00
+3.710487895241869616e+00 3.053901220418500095e+00
+3.802369570399006360e+00 2.871688198674210213e+00
+3.896526483332957813e+00 2.700151446974948577e+00
+3.993014975059850258e+00 2.538679344596879606e+00
+4.091892781751123032e+00 2.386694344388058386e+00
+4.193219069281346023e+00 2.243651139434943431e+00
+4.297054468631518631e+00 2.109034741460215301e+00
+4.403461112169044789e+00 1.982358596492260316e+00
+4.512502670826123996e+00 1.863163516426733501e+00
+4.624244392198733955e+00 1.751016264000423428e+00
+4.738753139589087837e+00 1.645508125343956740e+00
+4.856097432014864879e+00 1.546253558560075403e+00
+4.976347485209206667e+00 1.452888914434084189e+00
+5.099575253635930672e+00 1.365071225573021518e+00
+5.225854473545205714e+00 1.282477060451095552e+00
+5.355260707095371053e+00 1.204801465631485602e+00
+5.487871387567363257e+00 1.131757146258389080e+00
+5.623765865698720390e+00 1.063073323824699212e+00
+5.763025457164991039e+00 9.984946730937257486e-01
+5.905733491236882848e+00 9.377804650130164843e-01
+6.051975360642329882e+00 8.807037568412225959e-01
+6.201838572663207927e+00 8.270506255483156544e-01
+6.355412801497418052e+00 7.766194422871625092e-01
+6.512789941917547232e+00 7.292201858394434799e-01
+6.674064164258307841e+00 6.846737916892643439e-01
+6.839331970765542223e+00 6.428114474202145656e-01
+7.008692253340655931e+00 6.034739828538916440e-01
+7.182246352714913407e+00 5.665114821373087306e-01
+7.360098119089059310e+00 5.317827713601842587e-01
+7.542353974274570660e+00 4.991549193436613518e-01
+7.729122975373620363e+00 4.685027662492189382e-01
+7.920516880036001517e+00 4.397084785014190866e-01
+8.116650213331949359e+00 4.126611285969881138e-01
+8.317640336280957669e+00 3.872562984475159120e-01
+8.523607516077470692e+00 3.633957063601233606e-01
+8.734674998055634632e+00 3.409868590838657787e-01
+8.950969079436047693e+00 3.199427117656900021e-01
+9.172619184898717748e+00 3.001813507322514396e-01
+9.399757944027332002e+00 2.816256969365291130e-01
+9.632521270671343672e+00 2.642032261529120296e-01
+9.871048444273215594e+00 2.478457049983534832e-01
+1.011548219320960662e+01 2.324889419084505415e-01
+1.036596878019622281e+01 2.180725522437348129e-01
+1.062265808980760085e+01 2.045397372339071151e-01
+1.088570371816408766e+01 1.918370859308195786e-01
+1.115526306483970664e+01 1.799143751576519346e-01
+1.143149742704589578e+01 1.687243705729758736e-01
+1.171457209614760053e+01 1.582226517279954892e-01
+1.200465645656913871e+01 1.483674476986301671e-01
+1.230192408714945884e+01 1.391194820949905597e-01
+1.260655286500713324e+01 1.304418269283280640e-01
+1.291872507197733100e+01 1.222997648433618301e-01
+1.323862750368447117e+01 1.146606592477950326e-01
+1.356645158131579798e+01 1.074938230270752471e-01
+1.390239346616278659e+01 1.007703871411979590e-01
+1.424665417699884529e+01 9.446322031759944726e-02
+1.459943971036379118e+01 8.854683172468305608e-02
+1.496096116382656049e+01 8.299727306105733615e-02
+1.533143486230055608e+01 7.779204640692093109e-02
+1.571108248748675251e+01 7.291001750367039069e-02
+1.610013121052217500e+01 6.833133414682594775e-02
+1.649881382791312845e+01 6.403734939533578530e-02
+1.690736890083449495e+01 6.001054993062009124e-02
+1.732604089787842128e+01 5.623449427341536966e-02
+1.775508034133801516e+01 5.269374447036950793e-02
+1.819474395711309000e+01 4.937380085670604879e-02
+1.864529482832830709e+01 4.626104579152487406e-02
+1.910700255275515858e+01 4.334269079380981965e-02
+1.958014340413216914e+01 4.060672679313531014e-02
+2.006500049747982573e+01 3.804187731515315529e-02
+2.056186395850913229e+01 3.563755443209509766e-02
+2.107103109722521950e+01 3.338381729696466432e-02
+2.159280658582974866e+01 3.127133057803828387e-02
+2.212750264102891862e+01 2.929132620067401160e-02
+2.267543921085545122e+01 2.743557426919359180e-02
+2.323694416611724733e+01 2.569635100066858940e-02
+2.381235349658658862e+01 2.406640793309292037e-02
+2.440201151204755803e+01 2.253894298558277789e-02
+2.500627104832197034e+01 2.110757326056718688e-02
+2.562549367839700309e+01 1.976630948438608606e-02
+2.626004992878090505e+01 1.850953198879023986e-02
+2.691031950121651661e+01 1.733196804892951637e-02
+2.757669149988446122e+01 1.622867020783512471e-02
+2.825956466423305358e+01 1.519499685524771000e-02
+2.895934760757342019e+01 1.422659376407666744e-02
+2.967645906158295332e+01 1.331937647137507869e-02
+3.041132812686329956e+01 1.246951372776108034e-02
+3.116439452970286794e+01 1.167341195195372404e-02
+3.193610888519738111e+01 1.092770063002920962e-02
+3.272693296688634490e+01 1.022921860259229897e-02
+3.353733998306577035e+01 9.575001185478059645e-03
+3.436781485994382734e+01 8.962268044974708650e-03
+3.521885453180782122e+01 8.388411843493513015e-03
+3.609096823837661816e+01 7.850987618237046869e-03
+3.698467782951622240e+01 7.347702767455738075e-03
+3.790051807750103308e+01 6.876407645665983531e-03
+3.883903699700748291e+01 6.435086733694331436e-03
+3.980079617303145767e+01 6.021850348773130635e-03
+4.078637109692634510e+01 5.634926861993832387e-03
+4.179635151076136168e+01 5.272655392383395964e-03
+4.283134176020804773e+01 4.933478577678587079e-03
+4.389196115616465477e+01 4.615935223690709015e-03
+4.497884434533552422e+01 4.318655660854548405e-03
+4.609264168998692668e+01 4.040356405855364229e-03
+4.723401965710669259e+01 3.779834764236723096e-03
+4.840366121720045811e+01 3.535963769895351504e-03
+4.960226625296355252e+01 3.307687440473815101e-03
+5.083055197807182424e+01 3.094016328969348504e-03
+5.208925336634376180e+01 2.894023353102423077e-03
+5.337912359152939246e+01 2.706839861503414994e-03
+5.470093447798961250e+01 2.531651651771988591e-03
+5.605547696253552203e+01 2.367695711574161962e-03
+5.744356156770422928e+01 2.214257297343321697e-03
+5.886601888675411232e+01 2.070666897760807621e-03
+6.032370008066987310e+01 1.936297380565778995e-03
+6.181747738747533560e+01 1.810561319174121189e-03
+6.334824464415692802e+01 1.692908487758741512e-03
+6.491691782151272605e+01 1.582823514162005419e-03
+6.652443557224506776e+01 1.479823680191737255e-03
+6.817175979262565022e+01 1.383456725266362297e-03
+6.985987619806888915e+01 1.293298782881241622e-03
+7.158979491295809794e+01 1.208952907980765561e-03
+7.336255107507707862e+01 1.130047416377437429e-03
+7.517920545500996354e+01 1.056234279003779794e-03
+7.704084509087746824e+01 9.871876184811725734e-04
+7.894858393879248126e+01 9.226023014482117842e-04
+8.090356353942185308e+01 8.621926205152353464e-04
+8.290695370105433426e+01 8.056910601079030109e-04
+8.495995319958294090e+01 7.528470658229559831e-04
+8.706379049582098162e+01 7.034254715509413421e-04
+8.921972447058035982e+01 6.572059500757416106e-04
+9.142904517795346919e+01 6.139823783875471026e-04
+9.369307461724646657e+01 5.735619156369959042e-04
+9.601316752402956922e+01 5.357641397858091100e-04
+9.839071218077494052e+01 5.004202412563110540e-04
+1.008271312475683033e+02 4.673722697372398923e-04
+1.033238826133913761e+02 4.364724305687456198e-04
+1.058824602684840670e+02 4.075824314286831179e-04
+1.085043951983090125e+02 3.805730662224639173e-04
+1.111912562996526503e+02 3.553236661260388224e-04
+1.139446513194126140e+02 3.317212365836592837e-04
+1.167662278166298506e+02 3.096599489378297335e-04
+1.196576741483453361e+02 2.890406901787142126e-04
+1.226207204798683108e+02 2.697706408189473994e-04
+1.256571398200615448e+02 2.517628791407535696e-04
+1.287687490822632412e+02 2.349360101717087325e-04
+1.319574101714799497e+02 2.192138178480766459e-04
+1.352250310985013471e+02 2.045246387788357165e-04
+1.385735671216046683e+02 1.908000789249415091e-04
+1.420050219165280794e+02 1.779760535092869450e-04
+1.455214487754185768e+02 1.659929337033137818e-04
+1.491249518354676127e+02 1.547952157448175166e-04
+1.528176873379713641e+02 1.443312162297287406e-04
+1.566018649185687934e+02 1.345527914696838137e-04
+1.604797489294292632e+02 1.254150788998991241e-04
+1.644536597941813341e+02 1.168762586998709163e-04
+1.685259753963927096e+02 1.088974201514990932e-04
+1.726991325024345940e+02 1.014439138394071521e-04
+1.769756282195763220e+02 9.448450825070801179e-05
+1.813580214901899694e+02 8.798948485643471955e-05
+1.858489346229537205e+02 8.193054666246069723e-05
+1.904510548619723238e+02 7.628079169069566139e-05
+1.951671359947531528e+02 7.101468169606593738e-05
+2.000000000000000284e+02 6.610800689791198129e-05
diff --git a/Workspace/CumNumOfSat/HaloDistributionFunction/MDM_pk.dat b/Workspace/CumNumOfSat/HaloDistributionFunction/MDM_pk.dat
new file mode 100644
index 0000000..4744067
--- /dev/null
+++ b/Workspace/CumNumOfSat/HaloDistributionFunction/MDM_pk.dat
@@ -0,0 +1,500 @@
+1.000000000000000021e-03 3.792308054249089309e+03
+1.024762693681054897e-03 3.879520048259759278e+03
+1.050138578360451701e-03 3.968617809129505076e+03
+1.076142838299049085e-03 4.059635557678147052e+03
+1.102791033760909534e-03 4.152607110037180064e+03
+1.130099110324144862e-03 4.247566398647238202e+03
+1.158083408422334436e-03 4.344547612082437809e+03
+1.186760673122207524e-03 4.443585182589531541e+03
+1.216148064143455533e-03 4.544713772910992702e+03
+1.246263166126647870e-03 4.647968262374661208e+03
+1.277123999155423779e-03 4.753383732232199691e+03
+1.308749029539232065e-03 4.860995450229229391e+03
+1.341157180863090069e-03 4.970838786377900760e+03
+1.374367845310950180e-03 5.082948368488138840e+03
+1.408400895269476798e-03 5.197358244793285849e+03
+1.443276695219156830e-03 5.314102420067868479e+03
+1.479016113919874283e-03 5.433214840347592144e+03
+1.515640536898216380e-03 5.554729364850565617e+03
+1.553171879244016678e-03 5.678679736798109843e+03
+1.591632598723764737e-03 5.805099553120892779e+03
+1.631045709218741264e-03 5.934022233037333535e+03
+1.671434794495923982e-03 6.065480981150834850e+03
+1.712824022319883515e-03 6.199508078727340944e+03
+1.755238158914141505e-03 6.336134034068833898e+03
+1.798702583780631371e-03 6.475388670032179107e+03
+1.843243304886113369e-03 6.617301243255794361e+03
+1.888886974224663609e-03 6.761900395812412171e+03
+1.935660903765523645e-03 6.909214105464095155e+03
+1.983593081795861392e-03 7.059269634524741377e+03
+2.032712189668232396e-03 7.212093477338438788e+03
+2.083047618962733261e-03 7.367711306384159798e+03
+2.134629489074158209e-03 7.526147651327947642e+03
+2.187488665234646468e-03 7.687424169093452292e+03
+2.241656776982631737e-03 7.851560494833899611e+03
+2.297166237089113758e-03 8.018574942123620531e+03
+2.354050260952613143e-03 8.188484434107912421e+03
+2.412342886474387865e-03 8.361304430192782092e+03
+2.472078994425825054e-03 8.537048851414501769e+03
+2.533294329320162023e-03 8.715730004547454882e+03
+2.596025520801071174e-03 8.897358505014450202e+03
+2.660310105560866403e-03 9.081943155071876390e+03
+2.726186549801485389e-03 9.269489185008817003e+03
+2.793694272251631607e-03 9.459997477363107464e+03
+2.862873667753916551e-03 9.653466413288018884e+03
+2.933766131436065135e-03 9.849891919737419812e+03
+3.006414083480667045e-03 1.004926737366637099e+04
+3.080860994508308540e-03 1.025158350572814925e+04
+3.157151411589228379e-03 1.045682830362055756e+04
+3.235330984899119529e-03 1.066498691524495553e+04
+3.315446495035002245e-03 1.087604155184815136e+04
+3.397545881007481457e-03 1.108997039035596936e+04
+3.481678268926199655e-03 1.130674416474344980e+04
+3.567894001395604826e-03 1.152632885398088547e+04
+3.656244667638633948e-03 1.174868660738954532e+04
+3.746783134366360544e-03 1.197377563536215712e+04
+3.839563577412017769e-03 1.220155010177634176e+04
+3.934641514148407015e-03 1.243196001841265752e+04
+4.032073836708022045e-03 1.266495114169855333e+04
+4.131918846025818895e-03 1.290046487211016210e+04
+4.234236286724935190e-03 1.313843789133175596e+04
+4.339087382866311723e-03 1.337879783391549790e+04
+4.446534874583561205e-03 1.362146359662749637e+04
+4.556643055624997642e-03 1.386634861487420858e+04
+4.669477811825345666e-03 1.411336087318592399e+04
+4.785106660530059376e-03 1.436240281592868268e+04
+4.903598790995936617e-03 1.461337126459271894e+04
+5.025025105792160426e-03 1.486615734217920181e+04
+5.149458263226502214e-03 1.512064640521650654e+04
+5.276972720822157605e-03 1.537671797479985435e+04
+5.407644779871160351e-03 1.563424225809749259e+04
+5.541552631091060423e-03 1.589307461899388545e+04
+5.678776401412212460e-03 1.615306231785468481e+04
+5.819398201923587158e-03 1.641404574727925137e+04
+5.963502177005896784e-03 1.667585841550035184e+04
+6.111174554681398502e-03 1.693832694410302429e+04
+6.262503698210431305e-03 1.720127108078372839e+04
+6.417580158965690423e-03 1.746450372786169100e+04
+6.576496730615773861e-03 1.772783098723931107e+04
+6.739348504650471625e-03 1.799105028408604994e+04
+6.906232927281000245e-03 1.825393503660317947e+04
+7.077249857749275987e-03 1.851624194676616389e+04
+7.252501628081010551e-03 1.877771958984838420e+04
+7.432093104318525899e-03 1.903810864318625681e+04
+7.616131749269846631e-03 1.929714206983149052e+04
+7.804727686811573778e-03 1.955454533103514041e+04
+7.997993767784136732e-03 1.981003662835196519e+04
+8.196045637518762500e-03 2.006332717608204257e+04
+8.399001805036578755e-03 2.031412125942891726e+04
+8.606983713961326166e-03 2.056210205206144019e+04
+8.820115815187979519e-03 2.080692297924808372e+04
+9.038525641350899850e-03 2.104822812871661154e+04
+9.262343883136032324e-03 2.128565466093794385e+04
+9.491704467482724519e-03 2.151883336278534989e+04
+9.726744637722099796e-03 2.174738924761292583e+04
+9.967605035699857174e-03 2.197094220187142491e+04
+1.021442978593262857e-02 2.218910767817142550e+04
+1.046736658184831657e-02 2.240149743447783840e+04
+1.072656677416193756e-02 2.260771107105397823e+04
+1.099218546143988610e-02 2.280729850329735200e+04
+1.126438158290686900e-02 2.299979147817591729e+04
+1.154331801355090205e-02 2.318471925224677034e+04
+1.182916166158346806e-02 2.336160981386079948e+04
+1.212208356831293195e-02 2.352999116567134115e+04
+1.242225901049121527e-02 2.368939267065939566e+04
+1.272986760519472828e-02 2.383934645869327142e+04
+1.304509341730255081e-02 2.397938889010994899e+04
+1.336812506963595305e-02 2.410906004383117761e+04
+1.369915585582538037e-02 2.422786213516180214e+04
+1.403838385597221475e-02 2.433526108691743866e+04
+1.438601205517471560e-02 2.443073022482122542e+04
+1.474224846498897040e-02 2.451375426536504165e+04
+1.510730624789748816e-02 2.458383153334734743e+04
+1.548140384486006160e-02 2.464047622895545283e+04
+1.586476510602303006e-02 2.468322073398284556e+04
+1.625761942466536977e-02 2.471161794586387623e+04
+1.666020187446151657e-02 2.472524362123052197e+04
+1.707275335014334788e-02 2.472368938831621563e+04
+1.749552071164514264e-02 2.470654629061786909e+04
+1.792875693181816485e-02 2.467343019974830895e+04
+1.837272124780285967e-02 2.462398966299643507e+04
+1.882767931614961338e-02 2.455790841363537402e+04
+1.929390337178054846e-02 2.447490781646471078e+04
+1.977167239088782613e-02 2.437474922966065787e+04
+2.026127225786554173e-02 2.425723626359857735e+04
+2.076299593637552510e-02 2.412221691706212368e+04
+2.127714364464897145e-02 2.396959390516943313e+04
+2.180402303512921774e-02 2.379940907375534880e+04
+2.234394937856278018e-02 2.361180701303487876e+04
+2.289724575264912715e-02 2.340697860712417241e+04
+2.346424323536181605e-02 2.318516028237054707e+04
+2.404528110305683558e-02 2.294663390653293027e+04
+2.464070703348669039e-02 2.269172647947520818e+04
+2.525087731384152712e-02 2.242080961190399466e+04
+2.587615705394208376e-02 2.213429879001521476e+04
+2.651692040471170797e-02 2.183265488650602856e+04
+2.717355078205850247e-02 2.151662627223309391e+04
+2.784644109630119574e-02 2.118743336882634685e+04
+2.853599398727644024e-02 2.084633725752843384e+04
+2.924262206526778013e-02 2.049458347528328522e+04
+2.996674815790086738e-02 2.013339666194760866e+04
+3.070880556315226662e-02 1.976397567823517966e+04
+3.146923830862368571e-02 1.938748920045813065e+04
+3.224850141723623748e-02 1.900507179312556400e+04
+3.304706117950432370e-02 1.861782045586208187e+04
+3.386539543255145945e-02 1.822692402890489393e+04
+3.470399384603552878e-02 1.783426502951862494e+04
+3.556335821515410611e-02 1.744186530759882226e+04
+3.644400276090559859e-02 1.705159936341064531e+04
+3.734645443778540630e-02 1.666519469545979518e+04
+3.827125324910176513e-02 1.628423434910290052e+04
+3.921895257009935104e-02 1.591016107101486159e+04
+4.019011947908452537e-02 1.554428283991988974e+04
+4.118533509675009752e-02 1.518777955681891581e+04
+4.220519493390249843e-02 1.484171718746313491e+04
+4.325030924779994096e-02 1.450707101191030415e+04
+4.432130340731408463e-02 1.418471545906468054e+04
+4.541881826713450171e-02 1.387542882907312196e+04
+4.654351055123903680e-02 1.357990344606280269e+04
+4.769605324586032036e-02 1.329875607159456558e+04
+4.887713600218282495e-02 1.303237573829642861e+04
+5.008746554901213899e-02 1.278022374033659071e+04
+5.132776611566269853e-02 1.254149425165777393e+04
+5.259877986531768385e-02 1.231543432673521784e+04
+5.390126733911976276e-02 1.210115956387029109e+04
+5.523600791125903714e-02 1.189698161853001329e+04
+5.660380025532985027e-02 1.170106411677424876e+04
+5.800546282223620342e-02 1.151156961452774885e+04
+5.944183432993103283e-02 1.132621652881884074e+04
+6.091377426528313266e-02 1.114268127405481391e+04
+6.242216339837123457e-02 1.095827397327935432e+04
+6.396790430951386497e-02 1.076987132834926706e+04
+6.555192192934940210e-02 1.057463221903118756e+04
+6.717516409229026819e-02 1.037014356408954518e+04
+6.883860210368225596e-02 1.015428529655467537e+04
+7.054323132100773219e-02 9.925252380552368777e+03
+7.229007174948165471e-02 9.681468217926874786e+03
+7.408016865239551441e-02 9.421644976678298917e+03
+7.591459317657567318e-02 9.145930435989741454e+03
+7.779444299332909096e-02 8.855604725132076055e+03
+7.972084295526118969e-02 8.552163276393785054e+03
+8.169494576935777685e-02 8.237734040054032448e+03
+8.371793268673477506e-02 7.915496547250600997e+03
+8.579101420946752543e-02 7.589869667681575265e+03
+8.791543081492360356e-02 7.265520940400212567e+03
+9.009245369803149661e-02 6.946545061486397572e+03
+9.232338553193047970e-02 6.637907748084793639e+03
+9.460956124745557860e-02 6.344433607149925592e+03
+9.695234883192532793e-02 6.069688127391710623e+03
+9.935315014770902675e-02 5.816934532162824325e+03
+1.018134017710646128e-01 5.588516413014829595e+03
+1.043345758517476712e-01 5.385388564889142799e+03
+1.069181809939071803e-01 5.207304908249767323e+03
+1.095657631587949044e-01 5.052623521705735584e+03
+1.122789065898271571e-01 4.918418873034974240e+03
+1.150592347605548377e-01 4.800714766985121059e+03
+1.179084113461070504e-01 4.694294451798481532e+03
+1.208281412186903991e-01 4.593225777298807770e+03
+1.238201714677400894e-01 4.491340005415850101e+03
+1.268862924453314500e-01 4.382634171463697385e+03
+1.300283388374799398e-01 4.262448018711949771e+03
+1.332481907619687544e-01 4.127576967153093392e+03
+1.365477748933621727e-01 3.976435286977814940e+03
+1.399290656158761470e-01 3.810270201634861223e+03
+1.433940862047983211e-01 3.632717798804099402e+03
+1.469449100371623962e-01 3.449173641669375229e+03
+1.505836618324028209e-01 3.266158358556661824e+03
+1.543125189237301853e-01 3.090629162740473021e+03
+1.581337125609905137e-01 2.928773125423788315e+03
+1.620495292457861669e-01 2.785167355094309187e+03
+1.660623120996587154e-01 2.662208965913064276e+03
+1.701744622661503226e-01 2.559854738838052072e+03
+1.743884403475852440e-01 2.475361649406434935e+03
+1.787067678774292567e-01 2.403830246252539382e+03
+1.831320288291094223e-01 2.339211158414050715e+03
+1.876668711621947983e-01 2.274861085850400741e+03
+1.923140084068662437e-01 2.204464752972797669e+03
+1.970762212876213115e-01 2.123528298274294684e+03
+2.019563593871862850e-01 2.031234869686084721e+03
+2.069573428516322255e-01 1.930433725632793994e+03
+2.120821641377122757e-01 1.826399024748490774e+03
+2.173338898034696542e-01 1.725267431481927815e+03
+2.227156623431849058e-01 1.632422106644383348e+03
+2.282307020677624698e-01 1.551411416934657836e+03
+2.338823090316785869e-01 1.483416157769865322e+03
+2.396738650076478960e-01 1.426991331576544098e+03
+2.456088355101865572e-01 1.377947327347987766e+03
+2.516907718692859008e-01 1.330878109979840247e+03
+2.579233133554333368e-01 1.281129247883037351e+03
+2.643101893572566974e-01 1.226237036510354528e+03
+2.708552216130918344e-01 1.166457651423406787e+03
+2.775623264978110405e-01 1.104598954976466075e+03
+2.844355173662773129e-01 1.044826560184409800e+03
+2.914789069548308631e-01 9.910281389661004141e+02
+2.986967098422417810e-01 9.446945244605230982e+02
+3.060932449716041726e-01 9.046964783836331208e+02
+3.136729382346761241e-01 8.682836566000194125e+02
+3.214403251202178624e-01 8.323259292799355080e+02
+3.294000534279085679e-01 7.946180156135593506e+02
+3.375568860494666534e-01 7.551681496313482285e+02
+3.459157038186403965e-01 7.157814773898707017e+02
+3.544815084317678999e-01 6.787571571750735302e+02
+3.632594254406620871e-01 6.454982570691437331e+02
+3.722547073196048606e-01 6.158039606376983102e+02
+3.814727366082910076e-01 5.881376362021399018e+02
+3.909190291325959077e-01 5.608578549957956056e+02
+4.005992373051017741e-01 5.333616971426558848e+02
+4.105191535073518527e-01 5.061149270416209447e+02
+4.206847135558604012e-01 4.802609793567607994e+02
+4.311020002539465157e-01 4.563595377302048064e+02
+4.417772470315250999e-01 4.342778719361527919e+02
+4.527168416750260715e-01 4.133330520108280552e+02
+4.639273301496794066e-01 3.929268653343950177e+02
+4.754154205164455860e-01 3.729389903892772509e+02
+4.871879869459442292e-01 3.538097515702735905e+02
+4.992520738317759998e-01 3.358672453315331836e+02
+5.116149000057036433e-01 3.191152474636414809e+02
+5.242838630572085323e-01 3.030702305555403768e+02
+5.372665437600143701e-01 2.875699644129786066e+02
+5.505707106082227131e-01 2.727418411305293375e+02
+5.642043244647743094e-01 2.586847079858471830e+02
+5.781755433250220788e-01 2.454225512448594770e+02
+5.924927271982571853e-01 2.328010749697011761e+02
+6.071644431101205219e-01 2.207056340175064122e+02
+6.221994702288841106e-01 2.091861710952450721e+02
+6.376068051186766228e-01 1.982784973995662483e+02
+6.533956671227865165e-01 1.879231867380665051e+02
+6.695755038802766457e-01 1.780565415287624091e+02
+6.861559969792012659e-01 1.686615725703424573e+02
+7.031470677498161681e-01 1.597372067139585852e+02
+7.205588832012368439e-01 1.512709979201731301e+02
+7.384018621051121611e-01 1.432353846612080304e+02
+7.566866812299408718e-01 1.356035603169529793e+02
+7.754242817297720691e-01 1.283535829332709568e+02
+7.946258756910984378e-01 1.214687907414391788e+02
+8.143029528418772589e-01 1.149333484589449483e+02
+8.344672874266783058e-01 1.087317851484098696e+02
+8.551309452520859944e-01 1.028483768103640017e+02
+8.763062909065544304e-01 9.726769317088478317e+01
+8.980059951590548817e-01 9.197500384282011510e+01
+9.202430425409295900e-01 8.695625170631193157e+01
+9.430307391154916230e-01 8.219801673752122895e+01
+9.663827204400274873e-01 7.768747623661649016e+01
+9.903129597249484828e-01 7.341240047087364928e+01
+1.014835776194996431e+00 6.936113108509820790e+01
+1.039965843657487676e+00 6.552255586148159239e+01
+1.065718199282737810e+00 6.188608453627107764e+01
+1.092108252601901919e+00 5.844162697239725190e+01
+1.119151794727635041e+00 5.517958473511476569e+01
+1.146865007803077097e+00 5.209082071346528409e+01
+1.175264474684825533e+00 4.916662753627018390e+01
+1.204367188865671956e+00 4.639870860251591012e+01
+1.234190564643065757e+00 4.377916007217694272e+01
+1.264752447539368996e+00 4.130045358067948058e+01
+1.296071124980151090e+00 3.895541965089315539e+01
+1.328165337236894894e+00 3.673723173822153143e+01
+1.361054288640687115e+00 3.463936984589766155e+01
+1.394757659073581291e+00 3.265557856500302591e+01
+1.429295615744525572e+00 3.077990964041569200e+01
+1.464688825256882154e+00 2.900671646041775276e+01
+1.500958465974782552e+00 2.733063885646412672e+01
+1.538126240695702363e+00 2.574658868355357555e+01
+1.576214389636841018e+00 2.424973613953547869e+01
+1.615245703743089178e+00 2.283549678401169558e+01
+1.655243538324519426e+00 2.149951921968716562e+01
+1.696231827031595252e+00 2.023767325292103081e+01
+1.738235096176433014e+00 1.904603790486983428e+01
+1.781278479408709092e+00 1.792089173118687384e+01
+1.825387732754962578e+00 1.685870336049517348e+01
+1.870589250030329165e+00 1.585612195073864683e+01
+1.916910078631902437e+00 1.490996812692643125e+01
+1.964377935723191415e+00 1.401722537791864553e+01
+2.013021224819327770e+00 1.317503188818308146e+01
+2.062869052782990931e+00 1.238067278177313035e+01
+2.113951247241182330e+00 1.163157249975617979e+01
+2.166298374433299756e+00 1.092527715273994282e+01
+2.219941757501158630e+00 1.025944720367302132e+01
+2.274913495231942751e+00 9.631867586608263920e+00
+2.331246481265267345e+00 9.040442092015583242e+00
+2.388974423775876321e+00 8.483186876037997592e+00
+2.448131865643713212e+00 7.958224343198959438e+00
+2.508754205123478354e+00 7.463777379660178291e+00
+2.570877717026009535e+00 6.998163915611985253e+00
+2.634539574424171970e+00 6.559791796759892435e+00
+2.699777870896254317e+00 6.147158731443487234e+00
+2.766631643320149436e+00 5.758861869128191202e+00
+2.835140895232000080e+00 5.393573715694674142e+00
+2.905346620763258780e+00 5.050032341299014682e+00
+2.977290829170507802e+00 4.727038556147868498e+00
+3.051016569972671455e+00 4.423453184333415500e+00
+3.126567958710727790e+00 4.138194433349970502e+00
+3.203990203345279397e+00 3.870235357211933458e+00
+3.283329631307819518e+00 3.618601411063074202e+00
+3.364633717221826359e+00 3.382368279129816191e+00
+3.447951111310339822e+00 3.160662560090071516e+00
+3.533331668506967560e+00 2.952658191035924418e+00
+3.620826478287776151e+00 2.757571247935705294e+00
+3.710487895241869616e+00 2.574658048184356396e+00
+3.802369570399006360e+00 2.403213414659808755e+00
+3.896526483332957813e+00 2.242568991327568817e+00
+3.993014975059850258e+00 2.092091610588556971e+00
+4.091892781751123032e+00 1.951181712399849388e+00
+4.193219069281346023e+00 1.819271822812629891e+00
+4.297054468631518631e+00 1.695829354670702616e+00
+4.403461112169044789e+00 1.580360456513786538e+00
+4.512502670826123996e+00 1.472396821667238509e+00
+4.624244392198733955e+00 1.371492890292795419e+00
+4.738753139589087837e+00 1.277225213300063000e+00
+4.856097432014864879e+00 1.189191784400779106e+00
+4.976347485209206667e+00 1.107011347172907945e+00
+5.099575253635930672e+00 1.030322683400573647e+00
+5.225854473545205714e+00 9.587838883784655097e-01
+5.355260707095371053e+00 8.920711541500386810e-01
+5.487871387567363257e+00 8.298743371716241768e-01
+5.623765865698720390e+00 7.718994878801272996e-01
+5.763025457164991039e+00 7.178707312980929789e-01
+5.905733491236882848e+00 6.675292697605965664e-01
+6.051975360642329882e+00 6.206324067435984304e-01
+6.201838572663207927e+00 5.769526197615784113e-01
+6.355412801497418052e+00 5.362766804227575568e-01
+6.512789941917547232e+00 4.984048197575048356e-01
+6.674064164258307841e+00 4.631499960848604047e-01
+6.839331970765542223e+00 4.303410476093312842e-01
+7.008692253340655931e+00 3.998230050079749076e-01
+7.182246352714913407e+00 3.714492883657322109e-01
+7.360098119089059310e+00 3.450808629086826174e-01
+7.542353974274570660e+00 3.205860795179029110e-01
+7.729122975373620363e+00 2.978404871183548130e-01
+7.920516880036001517e+00 2.767266220651982134e-01
+8.116650213331949359e+00 2.571337791667912542e-01
+8.317640336280957669e+00 2.389577685188820355e-01
+8.523607516077470692e+00 2.221000328913706190e-01
+8.734674998055634632e+00 2.064649820471991526e-01
+8.950969079436047693e+00 1.919627888122606707e-01
+9.172619184898717748e+00 1.785102349802326627e-01
+9.399757944027332002e+00 1.660302304611389890e-01
+9.632521270671343672e+00 1.544513657342047597e-01
+9.871048444273215594e+00 1.437074963315910781e-01
+1.011548219320960662e+01 1.337373571408249917e-01
+1.036596878019622281e+01 1.244842044577974816e-01
+1.062265808980760085e+01 1.158953462882841567e-01
+1.088570371816408766e+01 1.079187947942977233e-01
+1.115526306483970664e+01 1.005039313750604596e-01
+1.143149742704589578e+01 9.360494257718904310e-02
+1.171457209614760053e+01 8.718046325153702703e-02
+1.200465645656913871e+01 8.119309877053815239e-02
+1.230192408714945884e+01 7.560900226658186229e-02
+1.260655286500713324e+01 7.039750000525392404e-02
+1.291872507197733100e+01 6.553075893319323941e-02
+1.323862750368447117e+01 6.098349153544940782e-02
+1.356645158131579798e+01 5.673375093304264954e-02
+1.390239346616278659e+01 5.276455069832800687e-02
+1.424665417699884529e+01 4.906019951708913418e-02
+1.459943971036379118e+01 4.560552705935010803e-02
+1.496096116382656049e+01 4.238591240048774494e-02
+1.533143486230055608e+01 3.938730495537599158e-02
+1.571108248748675251e+01 3.659623870206263341e-02
+1.610013121052217500e+01 3.399984043770078179e-02
+1.649881382791312845e+01 3.158583277122983812e-02
+1.690736890083449495e+01 2.934248809432402419e-02
+1.732604089787842128e+01 2.725817984912254008e-02
+1.775508034133801516e+01 2.532170447063062171e-02
+1.819474395711309000e+01 2.352263382272804654e-02
+1.864529482832830709e+01 2.185126834838599721e-02
+1.910700255275515858e+01 2.029858688243834502e-02
+1.958014340413216914e+01 1.885619985449167937e-02
+2.006500049747982573e+01 1.751630565891339544e-02
+2.056186395850913229e+01 1.627164998300307391e-02
+2.107103109722521950e+01 1.511548747189839399e-02
+2.159280658582974866e+01 1.404149503319768698e-02
+2.212750264102891862e+01 1.304370981008314348e-02
+2.267543921085545122e+01 1.211660833920183075e-02
+2.323694416611724733e+01 1.125508436800653871e-02
+2.381235349658658862e+01 1.045441564126710528e-02
+2.440201151204755803e+01 9.710233479114808997e-03
+2.500627104832197034e+01 9.018494899660270056e-03
+2.562549367839700309e+01 8.375457062143249962e-03
+2.626004992878090505e+01 7.777653827265041883e-03
+2.691031950121651661e+01 7.221878767483004384e-03
+2.757669149988446122e+01 6.705187906918940594e-03
+2.825956466423305358e+01 6.224856274596378587e-03
+2.895934760757342019e+01 5.778348928162695131e-03
+2.967645906158295332e+01 5.363307544862233774e-03
+3.041132812686329956e+01 4.977538012013026092e-03
+3.116439452970286794e+01 4.618998903965370467e-03
+3.193610888519738111e+01 4.285790780756781534e-03
+3.272693296688634490e+01 3.976146248540031285e-03
+3.353733998306577035e+01 3.688421445001081878e-03
+3.436781485994382734e+01 3.421110230808670997e-03
+3.521885453180782122e+01 3.172833092340554811e-03
+3.609096823837661816e+01 2.942297204915466074e-03
+3.698467782951622240e+01 2.728289992879703429e-03
+3.790051807750103308e+01 2.529674968987990959e-03
+3.883903699700748291e+01 2.345387702502576503e-03
+3.980079617303145767e+01 2.174431922006704165e-03
+4.078637109692634510e+01 2.015875757410415074e-03
+4.179635151076136168e+01 1.868848124264294594e-03
+4.283134176020804773e+01 1.732527549861979715e-03
+4.389196115616465477e+01 1.606120420239029933e-03
+4.497884434533552422e+01 1.488887512302076348e-03
+4.609264168998692668e+01 1.380147538421473826e-03
+4.723401965710669259e+01 1.279272317234739264e-03
+4.840366121720045811e+01 1.185682372150541255e-03
+4.960226625296355252e+01 1.098842917526855973e-03
+5.083055197807182424e+01 1.018260196438284691e-03
+5.208925336634376180e+01 9.434781374813510464e-04
+5.337912359152939246e+01 8.740760237537572057e-04
+5.470093447798961250e+01 8.096752347381477996e-04
+5.605547696253552203e+01 7.499308591173605831e-04
+5.744356156770422928e+01 6.945201902400059430e-04
+5.886601888675411232e+01 6.431412550469686393e-04
+6.032370008066987310e+01 5.955116549837057927e-04
+6.181747738747533560e+01 5.513674539149487951e-04
+6.334824464415692802e+01 5.104621130382881950e-04
+6.491691782151272605e+01 4.725654725348504815e-04
+6.652443557224506776e+01 4.374627740432453595e-04
+6.817175979262565022e+01 4.049522549645871304e-04
+6.985987619806888915e+01 3.748429070518319870e-04
+7.158979491295809794e+01 3.469573767327247741e-04
+7.336255107507707862e+01 3.211314958129586681e-04
+7.517920545500996354e+01 2.972132887321537477e-04
+7.704084509087746824e+01 2.750620559056077426e-04
+7.894858393879248126e+01 2.545475271933086352e-04
+8.090356353942185308e+01 2.355490800157240177e-04
+8.290695370105433426e+01 2.179550170744521591e-04
+8.495995319958294090e+01 2.016619051929004322e-04
+8.706379049582098162e+01 1.865739982656943277e-04
+8.921972447058035982e+01 1.726026278341120360e-04
+9.142904517795346919e+01 1.596656509946884099e-04
+9.369307461724646657e+01 1.476869670299088761e-04
+9.601316752402956922e+01 1.365960704308423696e-04
+9.839071218077494052e+01 1.263276373557870426e-04
+1.008271312475683033e+02 1.168211429841449489e-04
+1.033238826133913761e+02 1.080205074215414429e-04
+1.058824602684840670e+02 9.987376989010683691e-05
+1.085043951983090125e+02 9.233287712109466462e-05
+1.111912562996526503e+02 8.535340942640806759e-05
+1.139446513194126140e+02 7.889416734315541269e-05
+1.167662278166298506e+02 7.291693025179899043e-05
+1.196576741483453361e+02 6.738624425777821011e-05
+1.226207204798683108e+02 6.226922494255461018e-05
+1.256571398200615448e+02 5.753537395842760969e-05
+1.287687490822632412e+02 5.315640851105662404e-05
+1.319574101714799497e+02 4.910610283856238685e-05
+1.352250310985013471e+02 4.536007116048401921e-05
+1.385735671216046683e+02 4.189540942468889261e-05
+1.420050219165280794e+02 3.869088448545138253e-05
+1.455214487754185768e+02 3.572690850114209010e-05
+1.491249518354676127e+02 3.298540583797889486e-05
+1.528176873379713641e+02 3.044969127477257826e-05
+1.566018649185687934e+02 2.810435852053555278e-05
+1.604797489294292632e+02 2.593517812733079543e-05
+1.644536597941813341e+02 2.392900396627138695e-05
+1.685259753963927096e+02 2.207370472698986862e-05
+1.726991325024345940e+02 2.035839193882118484e-05
+1.769756282195763220e+02 1.877320331191982181e-05
+1.813580214901899694e+02 1.730889164862794933e-05
+1.858489346229537205e+02 1.595678493415214833e-05
+1.904510548619723238e+02 1.470876040885126647e-05
+1.951671359947531528e+02 1.355721860598793352e-05
+2.000000000000000284e+02 1.249505754012294826e-05
diff --git a/Workspace/CumNumOfSat/HaloDistributionFunction/WDM_pk.dat b/Workspace/CumNumOfSat/HaloDistributionFunction/WDM_pk.dat
new file mode 100644
index 0000000..cbacc0f
--- /dev/null
+++ b/Workspace/CumNumOfSat/HaloDistributionFunction/WDM_pk.dat
@@ -0,0 +1,500 @@
+1.000000000000000021e-03 3.791689912985469618e+03
+1.024762693681054897e-03 3.878887417691075370e+03
+1.050138578360451701e-03 3.967970356315822301e+03
+1.076142838299049085e-03 4.058972942062439415e+03
+1.102791033760909534e-03 4.151928984213780495e+03
+1.130099110324144862e-03 4.246872408475219345e+03
+1.158083408422334436e-03 4.343837396613510464e+03
+1.186760673122207524e-03 4.442858373997913077e+03
+1.216148064143455533e-03 4.543969996425458703e+03
+1.246263166126647870e-03 4.647207136212617115e+03
+1.277123999155423779e-03 4.752604867536260826e+03
+1.308749029539232065e-03 4.860198451006379400e+03
+1.341157180863090069e-03 4.970023249390011188e+03
+1.374367845310950180e-03 5.082113882521495725e+03
+1.408400895269476798e-03 5.196504390067957502e+03
+1.443276695219156830e-03 5.313228768068649515e+03
+1.479016113919874283e-03 5.432320953662006104e+03
+1.515640536898216380e-03 5.553814797004716638e+03
+1.553171879244016678e-03 5.677744032090698056e+03
+1.591632598723764737e-03 5.804142246455226996e+03
+1.631045709218741264e-03 5.933042849751635913e+03
+1.671434794495923982e-03 6.064479036850346347e+03
+1.712824022319883515e-03 6.198483079681243908e+03
+1.755238158914141505e-03 6.335085478289880484e+03
+1.798702583780631371e-03 6.474316047412992702e+03
+1.843243304886113369e-03 6.616204035572669454e+03
+1.888886974224663609e-03 6.760778076736694857e+03
+1.935660903765523645e-03 6.908066140581191576e+03
+1.983593081795861392e-03 7.058095481361254315e+03
+2.032712189668232396e-03 7.210892585397676157e+03
+2.083047618962733261e-03 7.366483117190517987e+03
+2.134629489074158209e-03 7.524891598381073891e+03
+2.187488665234646468e-03 7.686139677207350360e+03
+2.241656776982631737e-03 7.850246979827108589e+03
+2.297166237089113758e-03 8.017231810804141787e+03
+2.354050260952613143e-03 8.187111084265890895e+03
+2.412342886474387865e-03 8.359900250600474465e+03
+2.472078994425825054e-03 8.535613221833813441e+03
+2.533294329320162023e-03 8.714262295745238589e+03
+2.596025520801071174e-03 8.895858078786193801e+03
+2.660310105560866403e-03 9.080409364264431133e+03
+2.726186549801485389e-03 9.267921373178103750e+03
+2.793694272251631607e-03 9.458394978288722996e+03
+2.862873667753916551e-03 9.651828550929845733e+03
+2.933766131436065135e-03 9.848218008232413922e+03
+3.006414083480667045e-03 1.004755671733438066e+04
+3.080860994508308540e-03 1.024983539908700004e+04
+3.157151411589228379e-03 1.045504203141157268e+04
+3.235330984899119529e-03 1.066316175246913372e+04
+3.315446495035002245e-03 1.087417676381385172e+04
+3.397545881007481457e-03 1.108806523398502395e+04
+3.481678268926199655e-03 1.130479789401741618e+04
+3.567894001395604826e-03 1.152434072194042164e+04
+3.656244667638633948e-03 1.174665586688011717e+04
+3.746783134366360544e-03 1.197170153981535441e+04
+3.839563577412017769e-03 1.219943190602741925e+04
+3.934641514148407015e-03 1.242979697955456504e+04
+4.032073836708022045e-03 1.266274251997246211e+04
+4.131918846025818895e-03 1.289820993183284372e+04
+4.234236286724935190e-03 1.313613590153346377e+04
+4.339087382866311723e-03 1.337644806381394483e+04
+4.446534874583561205e-03 1.361906531163897307e+04
+4.556643055624997642e-03 1.386390107679880202e+04
+4.669477811825345666e-03 1.411086334054411418e+04
+4.785106660530059376e-03 1.435985454432118604e+04
+4.903598790995936617e-03 1.461077150708392946e+04
+5.025025105792160426e-03 1.486350534970638910e+04
+5.149458263226502214e-03 1.511794142702503450e+04
+5.276972720822157605e-03 1.537395925892073319e+04
+5.407644779871160351e-03 1.563142905711646017e+04
+5.541552631091060423e-03 1.589020620428929215e+04
+5.678776401412212460e-03 1.615013798348761156e+04
+5.819398201923587158e-03 1.641106481199151312e+04
+5.963502177005896784e-03 1.667282022476102065e+04
+6.111174554681398502e-03 1.693523087220031084e+04
+6.262503698210431305e-03 1.719811653295924043e+04
+6.417580158965690423e-03 1.746129014248338717e+04
+6.576496730615773861e-03 1.772455783800982681e+04
+6.739348504650471625e-03 1.798771708075079732e+04
+6.906232927281000245e-03 1.825054131353178309e+04
+7.077249857749275987e-03 1.851278725728404970e+04
+7.252501628081010551e-03 1.877420350729464189e+04
+7.432093104318525899e-03 1.903453076206435799e+04
+7.616131749269846631e-03 1.929350200699537163e+04
+7.804727686811573778e-03 1.955084272691165097e+04
+7.997993767784136732e-03 1.980627114820065981e+04
+8.196045637518762500e-03 2.005949851129204399e+04
+8.399001805036578755e-03 2.031022912896734124e+04
+8.606983713961326166e-03 2.055814621069052737e+04
+8.820115815187979519e-03 2.080290323002191872e+04
+9.038525641350899850e-03 2.104414432630879310e+04
+9.262343883136032324e-03 2.128150671410957875e+04
+9.491704467482724519e-03 2.151462123686706036e+04
+9.726744637722099796e-03 2.174311296699428567e+04
+9.967605035699857174e-03 2.196660185249155984e+04
+1.021442978593262857e-02 2.218470341000324333e+04
+1.046736658184831657e-02 2.239702946399767825e+04
+1.072656677416193756e-02 2.260317968508057675e+04
+1.099218546143988610e-02 2.280270406865590849e+04
+1.126438158290686900e-02 2.299513444689935932e+04
+1.154331801355090205e-02 2.318000016456462617e+04
+1.182916166158346806e-02 2.335682930111917813e+04
+1.212208356831293195e-02 2.352514995317008652e+04
+1.242225901049121527e-02 2.368449158039218310e+04
+1.272986760519472828e-02 2.383438641197290781e+04
+1.304509341730255081e-02 2.397437091006397895e+04
+1.336812506963595305e-02 2.410398525899404922e+04
+1.369915585582538037e-02 2.422273180943593616e+04
+1.403838385597221475e-02 2.433007664966793163e+04
+1.438601205517471560e-02 2.442549327512417221e+04
+1.474224846498897040e-02 2.450846657465513272e+04
+1.510730624789748816e-02 2.457849504754002191e+04
+1.548140384486006160e-02 2.463509307000175613e+04
+1.586476510602303006e-02 2.467779320081424885e+04
+1.625761942466536977e-02 2.470614851468607230e+04
+1.666020187446151657e-02 2.471973494508526346e+04
+1.707275335014334788e-02 2.471814423064476432e+04
+1.749552071164514264e-02 2.470096732679950583e+04
+1.792875693181816485e-02 2.466781997941631926e+04
+1.837272124780285967e-02 2.461835061051252706e+04
+1.882767931614961338e-02 2.455224282978122937e+04
+1.929390337178054846e-02 2.446921788138839474e+04
+1.977167239088782613e-02 2.436903700710296471e+04
+2.026127225786554173e-02 2.425150370641046902e+04
+2.076299593637552510e-02 2.411646587400927820e+04
+2.127714364464897145e-02 2.396382616901523215e+04
+2.180402303512921774e-02 2.379362682674905955e+04
+2.234394937856278018e-02 2.360601309001208938e+04
+2.289724575264912715e-02 2.340117648137342621e+04
+2.346424323536181605e-02 2.317935404291936720e+04
+2.404528110305683558e-02 2.294082823105127682e+04
+2.464070703348669039e-02 2.268592660292821893e+04
+2.525087731384152712e-02 2.241502129112521652e+04
+2.587615705394208376e-02 2.212852826440967692e+04
+2.651692040471170797e-02 2.182690883081683205e+04
+2.717355078205850247e-02 2.151091131890229371e+04
+2.784644109630119574e-02 2.118175529763183658e+04
+2.853599398727644024e-02 2.084070093424935476e+04
+2.924262206526778013e-02 2.048899288433036781e+04
+2.996674815790086738e-02 2.012785494393836052e+04
+3.070880556315226662e-02 1.975848517172106585e+04
+3.146923830862368571e-02 1.938205148702629958e+04
+3.224850141723623748e-02 1.899968774512793243e+04
+3.304706117950432370e-02 1.861249028605922649e+04
+3.386539543255145945e-02 1.822164742776443381e+04
+3.470399384603552878e-02 1.782904169356620696e+04
+3.556335821515410611e-02 1.743669509745847245e+04
+3.644400276090559859e-02 1.704648227281618165e+04
+3.734645443778540630e-02 1.666013082012918676e+04
+3.827125324910176513e-02 1.627922385649358512e+04
+3.921895257009935104e-02 1.590520417161065598e+04
+4.019011947908452537e-02 1.553937976057270862e+04
+4.118533509675009752e-02 1.518293051654994997e+04
+4.220519493390249843e-02 1.483692236204348956e+04
+4.325030924779994096e-02 1.450233046947473667e+04
+4.432130340731408463e-02 1.418002913976149648e+04
+4.541881826713450171e-02 1.387079653808634976e+04
+4.654351055123903680e-02 1.357532484916791145e+04
+4.769605324586032036e-02 1.329423069315682005e+04
+4.887713600218282495e-02 1.302790276576554061e+04
+5.008746554901213899e-02 1.277580095974760297e+04
+5.132776611566269853e-02 1.253711778344820050e+04
+5.259877986531768385e-02 1.231109874964580195e+04
+5.390126733911976276e-02 1.209685997273816065e+04
+5.523600791125903714e-02 1.189272287232704184e+04
+5.660380025532985027e-02 1.169686296765135558e+04
+5.800546282223620342e-02 1.150744523056637081e+04
+5.944183432993103283e-02 1.132214833946442559e+04
+6.091377426528313266e-02 1.113860176910252449e+04
+6.242216339837123457e-02 1.095416728521241203e+04
+6.396790430951386497e-02 1.076588346443158298e+04
+6.555192192934940210e-02 1.057092414116286091e+04
+6.717516409229026819e-02 1.036659085628279900e+04
+6.883860210368225596e-02 1.015064023475476824e+04
+7.054323132100773219e-02 9.921537829760687600e+03
+7.229007174948165471e-02 9.677836077325504448e+03
+7.408016865239551441e-02 9.418114204352577872e+03
+7.591459317657567318e-02 9.142477298891364626e+03
+7.779444299332909096e-02 8.852240391769948474e+03
+7.972084295526118969e-02 8.548894107715903374e+03
+8.169494576935777685e-02 8.234558593874273356e+03
+8.371793268673477506e-02 7.912421766156066042e+03
+8.579101420946752543e-02 7.586895893471648378e+03
+8.791543081492360356e-02 7.262641481314052726e+03
+9.009245369803149661e-02 6.943763021935947108e+03
+9.232338553193047970e-02 6.635219874291194174e+03
+9.460956124745557860e-02 6.341832678539185508e+03
+9.695234883192532793e-02 6.067183701088749331e+03
+9.935315014770902675e-02 5.814516504091843672e+03
+1.018134017710646128e-01 5.586163578750735724e+03
+1.043345758517476712e-01 5.383100543589324843e+03
+1.069181809939071803e-01 5.205078664140041838e+03
+1.095657631587949044e-01 5.050451367463438146e+03
+1.122789065898271571e-01 4.916295968942557920e+03
+1.150592347605548377e-01 4.798643473850082046e+03
+1.179084113461070504e-01 4.692269145414637023e+03
+1.208281412186903991e-01 4.591241596843385196e+03
+1.238201714677400894e-01 4.489402461492211842e+03
+1.268862924453314500e-01 4.380724457010695915e+03
+1.300283388374799398e-01 4.260582047751852770e+03
+1.332481907619687544e-01 4.125790398261103292e+03
+1.365477748933621727e-01 3.974711576026199964e+03
+1.399290656158761470e-01 3.808608789060290292e+03
+1.433940862047983211e-01 3.631120725639472312e+03
+1.469449100371623962e-01 3.447647997409116215e+03
+1.505836618324028209e-01 3.264737979598796755e+03
+1.543125189237301853e-01 3.089268882206079525e+03
+1.581337125609905137e-01 2.927443466130404431e+03
+1.620495292457861669e-01 2.783895836036893797e+03
+1.660623120996587154e-01 2.660987474546118392e+03
+1.701744622661503226e-01 2.558700499879131712e+03
+1.743884403475852440e-01 2.474225876336954116e+03
+1.787067678774292567e-01 2.402653395184386682e+03
+1.831320288291094223e-01 2.338180898131173763e+03
+1.876668711621947983e-01 2.273899682166730599e+03
+1.923140084068662437e-01 2.203457094578800479e+03
+1.970762212876213115e-01 2.122579785236535827e+03
+2.019563593871862850e-01 2.030299919736316951e+03
+2.069573428516322255e-01 1.929569351414579160e+03
+2.120821641377122757e-01 1.825638450636406787e+03
+2.173338898034696542e-01 1.724491878933555427e+03
+2.227156623431849058e-01 1.631666714572418186e+03
+2.282307020677624698e-01 1.550701675318566913e+03
+2.338823090316785869e-01 1.482736694675283843e+03
+2.396738650076478960e-01 1.426343188389133047e+03
+2.456088355101865572e-01 1.377315496966086812e+03
+2.516907718692859008e-01 1.330290294217489645e+03
+2.579233133554333368e-01 1.280602056095839998e+03
+2.643101893572566974e-01 1.225706625782899664e+03
+2.708552216130918344e-01 1.165907834858679962e+03
+2.775623264978110405e-01 1.104078541151915033e+03
+2.844355173662773129e-01 1.044373298634860703e+03
+2.914789069548308631e-01 9.906048395186099924e+02
+2.986967098422417810e-01 9.442859981313558819e+02
+3.060932449716041726e-01 9.043024186265535036e+02
+3.136729382346761241e-01 8.679117124764508162e+02
+3.214403251202178624e-01 8.319968419135008162e+02
+3.294000534279085679e-01 7.943045037587772867e+02
+3.375568860494666534e-01 7.548652275857760969e+02
+3.459157038186403965e-01 7.155163684381942630e+02
+3.544815084317678999e-01 6.784938347566229595e+02
+3.632594254406620871e-01 6.452462886564676410e+02
+3.722547073196048606e-01 6.155796557629239487e+02
+3.814727366082910076e-01 5.879079483246687232e+02
+3.909190291325959077e-01 5.606382467973436405e+02
+4.005992373051017741e-01 5.331748860738363192e+02
+4.105191535073518527e-01 5.059588436501837236e+02
+4.206847135558604012e-01 4.801230898320164329e+02
+4.311020002539465157e-01 4.562285956170831014e+02
+4.417772470315250999e-01 4.341509302361195637e+02
+4.527168416750260715e-01 4.132168885435450534e+02
+4.639273301496794066e-01 3.928228410437349112e+02
+4.754154205164455860e-01 3.728451486391516596e+02
+4.871879869459442292e-01 3.537293231832456968e+02
+4.992520738317759998e-01 3.357953771151881028e+02
+5.116149000057036433e-01 3.190439283562216133e+02
+5.242838630572085323e-01 3.030086643166432054e+02
+5.372665437600143701e-01 2.875268502117486946e+02
+5.505707106082227131e-01 2.727120057160207125e+02
+5.642043244647743094e-01 2.586617286793930361e+02
+5.781755433250220788e-01 2.454037841060095104e+02
+5.924927271982571853e-01 2.327886841880300892e+02
+6.071644431101205219e-01 2.207035439521922342e+02
+6.221994702288841106e-01 2.091928211190014792e+02
+6.376068051186766228e-01 1.982890495930011241e+02
+6.533956671227865165e-01 1.879377247270295470e+02
+6.695755038802766457e-01 1.780798092835900661e+02
+6.861559969792012659e-01 1.686961998438593184e+02
+7.031470677498161681e-01 1.597816346192807373e+02
+7.205588832012368439e-01 1.513218862199659611e+02
+7.384018621051121611e-01 1.432907288341707783e+02
+7.566866812299408718e-01 1.356627239450232594e+02
+7.754242817297720691e-01 1.284166572866402021e+02
+7.946258756910984378e-01 1.215358988851808562e+02
+8.143029528418772589e-01 1.150045898628380741e+02
+8.344672874266783058e-01 1.088072201594727630e+02
+8.551309452520859944e-01 1.029279076729081908e+02
+8.763062909065544304e-01 9.735103500116431974e+01
+8.980059951590548817e-01 9.206172278970443301e+01
+9.202430425409295900e-01 8.704579886936245714e+01
+9.430307391154916230e-01 8.228981661966730599e+01
+9.663827204400274873e-01 7.778110725709622386e+01
+9.903129597249484828e-01 7.350759862632277475e+01
+1.014835776194996431e+00 6.945776045475109584e+01
+1.039965843657487676e+00 6.562058282859844383e+01
+1.065718199282737810e+00 6.198555536226473350e+01
+1.092108252601901919e+00 5.854264178547209241e+01
+1.119151794727635041e+00 5.528220642570903465e+01
+1.146865007803077097e+00 5.219503111733268241e+01
+1.175264474684825533e+00 4.927234102630196588e+01
+1.204367188865671956e+00 4.650578500245043045e+01
+1.234190564643065757e+00 4.388741601789430291e+01
+1.264752447539368996e+00 4.140967247530876705e+01
+1.296071124980151090e+00 3.906536034833371929e+01
+1.328165337236894894e+00 3.684763609088596326e+01
+1.361054288640687115e+00 3.474997570212080689e+01
+1.394757659073581291e+00 3.276614020628372970e+01
+1.429295615744525572e+00 3.089019998495519559e+01
+1.464688825256882154e+00 2.911652608523429464e+01
+1.500958465974782552e+00 2.743977506624939267e+01
+1.538126240695702363e+00 2.585487462354170773e+01
+1.576214389636841018e+00 2.435700994986634527e+01
+1.615245703743089178e+00 2.294161079326468311e+01
+1.655243538324519426e+00 2.160433917543889848e+01
+1.696231827031595252e+00 2.034107397872709555e+01
+1.738235096176433014e+00 1.914787726034486681e+01
+1.781278479408709092e+00 1.802100537777974765e+01
+1.825387732754962578e+00 1.695691269484690267e+01
+1.870589250030329165e+00 1.595224090127217131e+01
+1.916910078631902437e+00 1.500380887045074374e+01
+1.964377935723191415e+00 1.410860309690004577e+01
+2.013021224819327770e+00 1.326376867816948923e+01
+2.062869052782990931e+00 1.246660080822553596e+01
+2.113951247241182330e+00 1.171453620295969067e+01
+2.166298374433299756e+00 1.100512281095544509e+01
+2.219941757501158630e+00 1.033601120951558272e+01
+2.274913495231942751e+00 9.704982885901532796e+00
+2.331246481265267345e+00 9.109944692591174231e+00
+2.388974423775876321e+00 8.548921147013034627e+00
+2.448131865643713212e+00 8.020047250786713988e+00
+2.508754205123478354e+00 7.521561791038521960e+00
+2.570877717026009535e+00 7.051801089200893990e+00
+2.634539574424171970e+00 6.609193165314607654e+00
+2.699777870896254317e+00 6.192246368287515068e+00
+2.766631643320149436e+00 5.799526799519411746e+00
+2.835140895232000080e+00 5.429678050298370806e+00
+2.905346620763258780e+00 5.081423853028947946e+00
+2.977290829170507802e+00 4.753562675548606897e+00
+3.051016569972671455e+00 4.444962722404610211e+00
+3.126567958710727790e+00 4.154557311207590864e+00
+3.203990203345279397e+00 3.881340594465231053e+00
+3.283329631307819518e+00 3.624363599752224552e+00
+3.364633717221826359e+00 3.382729610777138962e+00
+3.447951111310339822e+00 3.155575511419563828e+00
+3.533331668506967560e+00 2.942075982601958906e+00
+3.620826478287776151e+00 2.741456681100251647e+00
+3.710487895241869616e+00 2.552990897304204587e+00
+3.802369570399006360e+00 2.375995972862030570e+00
+3.896526483332957813e+00 2.209830021680539325e+00
+3.993014975059850258e+00 2.053888928315894535e+00
+4.091892781751123032e+00 1.907603600144645695e+00
+4.193219069281346023e+00 1.770437441587019656e+00
+4.297054468631518631e+00 1.641878445316759416e+00
+4.403461112169044789e+00 1.521430368706337299e+00
+4.512502670826123996e+00 1.408626519163996615e+00
+4.624244392198733955e+00 1.303029885562781542e+00
+4.738753139589087837e+00 1.204230621426130021e+00
+4.856097432014864879e+00 1.111843768370884611e+00
+4.976347485209206667e+00 1.025507198180906299e+00
+5.099575253635930672e+00 9.448797539600254369e-01
+5.225854473545205714e+00 8.696395726410562910e-01
+5.355260707095371053e+00 7.994814734882466079e-01
+5.487871387567363257e+00 7.341073838125135032e-01
+5.623765865698720390e+00 6.732329947690719463e-01
+5.763025457164991039e+00 6.165925941122442078e-01
+5.905733491236882848e+00 5.639373087245905802e-01
+6.051975360642329882e+00 5.150334806541974064e-01
+6.201838572663207927e+00 4.696612263669735499e-01
+6.355412801497418052e+00 4.276131620782845921e-01
+6.512789941917547232e+00 3.886932796234572884e-01
+6.674064164258307841e+00 3.527159584453644636e-01
+6.839331970765542223e+00 3.195050854262757034e-01
+7.008692253340655931e+00 2.888932999452123451e-01
+7.182246352714913407e+00 2.607213712563899999e-01
+7.360098119089059310e+00 2.348376353167859754e-01
+7.542353974274570660e+00 2.110975090701580903e-01
+7.729122975373620363e+00 1.893630760822878623e-01
+7.920516880036001517e+00 1.695027349148396922e-01
+8.116650213331949359e+00 1.513909021336008465e-01
+8.317640336280957669e+00 1.349077623307636531e-01
+8.523607516077470692e+00 1.199379917023740694e-01
+8.734674998055634632e+00 1.063669366188381843e-01
+8.950969079436047693e+00 9.408636927266789129e-02
+9.172619184898717748e+00 8.299598315628044232e-02
+9.399757944027332002e+00 7.300252325593835356e-02
+9.632521270671343672e+00 6.401905059335084858e-02
+9.871048444273215594e+00 5.596432562655864057e-02
+1.011548219320960662e+01 4.876229475652207185e-02
+1.036596878019622281e+01 4.234166560097039900e-02
+1.062265808980760085e+01 3.663568711730262606e-02
+1.088570371816408766e+01 3.158445878261247758e-02
+1.115526306483970664e+01 2.713286374964413855e-02
+1.143149742704589578e+01 2.322700605288272047e-02
+1.171457209614760053e+01 1.981474761147316091e-02
+1.200465645656913871e+01 1.684627467551316066e-02
+1.230192408714945884e+01 1.427452083987750323e-02
+1.260655286500713324e+01 1.205546141672676069e-02
+1.291872507197733100e+01 1.014829494799825149e-02
+1.323862750368447117e+01 8.515527276628662851e-03
+1.356645158131579798e+01 7.120904772255640461e-03
+1.390239346616278659e+01 5.927179783104513829e-03
+1.424665417699884529e+01 4.904002068234917036e-03
+1.459943971036379118e+01 4.027570429188010066e-03
+1.496096116382656049e+01 3.278883075262653112e-03
+1.533143486230055608e+01 2.642404723328194757e-03
+1.571108248748675251e+01 2.105056211529552235e-03
+1.610013121052217500e+01 1.655462486809058898e-03
+1.649881382791312845e+01 1.283413519440386929e-03
+1.690736890083449495e+01 9.797448361452047814e-04
+1.732604089787842128e+01 7.378443656264515108e-04
+1.775508034133801516e+01 5.502906581665962474e-04
+1.819474395711309000e+01 4.080194835546846000e-04
+1.864529482832830709e+01 3.019373532666019041e-04
+1.910700255275515858e+01 2.238647733956170222e-04
+1.958014340413216914e+01 1.669450104864232481e-04
+2.006500049747982573e+01 1.257088024750528893e-04
+2.056186395850913229e+01 9.595073150690684781e-05
+2.107103109722521950e+01 7.452481981482626133e-05
+2.159280658582974866e+01 5.902040272169603233e-05
+2.212750264102891862e+01 4.758168828982433653e-05
+2.267543921085545122e+01 3.896853889419730907e-05
+2.323694416611724733e+01 3.235378862708540175e-05
+2.381235349658658862e+01 2.717521961353487693e-05
+2.440201151204755803e+01 2.304400862099148200e-05
+2.500627104832197034e+01 1.968702959689855027e-05
+2.562549367839700309e+01 1.690984818962607220e-05
+2.626004992878090505e+01 1.457258922734305176e-05
+2.691031950121651661e+01 1.257131535230771185e-05
+2.757669149988446122e+01 1.081607219391183680e-05
+2.825956466423305358e+01 9.241625495162152182e-06
+2.895934760757342019e+01 7.808387479382568005e-06
+2.967645906158295332e+01 6.496101804428874514e-06
+3.041132812686329956e+01 5.298671982003738792e-06
+3.116439452970286794e+01 4.219376368001608973e-06
+3.193610888519738111e+01 3.266185056145327731e-06
+3.272693296688634490e+01 2.447309357149805200e-06
+3.353733998306577035e+01 1.767667456733319127e-06
+3.436781485994382734e+01 1.232115091931593971e-06
+3.521885453180782122e+01 8.351118692016836486e-07
+3.609096823837661816e+01 5.548326843995743936e-07
+3.698467782951622240e+01 3.642375802672225835e-07
+3.790051807750103308e+01 2.381738820984367374e-07
+3.883903699700748291e+01 1.563765112922644279e-07
+3.980079617303145767e+01 1.039197848101933709e-07
+4.078637109692634510e+01 7.046210693016416202e-08
+4.179635151076136168e+01 4.913885269750601589e-08
+4.283134176020804773e+01 3.547576300632935449e-08
+4.389196115616465477e+01 2.652737527212006813e-08
+4.497884434533552422e+01 2.052502035256360728e-08
+4.609264168998692668e+01 1.641612558992349412e-08
+4.723401965710669259e+01 1.355896267425384515e-08
+4.840366121720045811e+01 1.155372348733041863e-08
+4.960226625296355252e+01 1.014677789568813922e-08
+5.083055197807182424e+01 9.175209610124388029e-09
+5.208925336634376180e+01 8.534075215752613844e-09
+5.337912359152939246e+01 8.153201415538782982e-09
+5.470093447798961250e+01 7.934159272026030106e-09
+5.605547696253552203e+01 7.756392970267612913e-09
+5.744356156770422928e+01 7.511462687318555720e-09
+5.886601888675411232e+01 7.105828454160170866e-09
+6.032370008066987310e+01 6.475153844200605609e-09
+6.181747738747533560e+01 5.604673346381780971e-09
+6.334824464415692802e+01 4.543965615895845272e-09
+6.491691782151272605e+01 3.402702315109682412e-09
+6.652443557224506776e+01 2.320893574465301909e-09
+6.817175979262565022e+01 1.439913008438052646e-09
+6.985987619806888915e+01 8.362651387286296124e-10
+7.158979491295809794e+01 4.699660057198922573e-10
+7.336255107507707862e+01 2.641749404266485534e-10
+7.517920545500996354e+01 1.535350441946572881e-10
+7.704084509087746824e+01 9.536788510600376722e-11
+7.894858393879248126e+01 6.544304894417588565e-11
+8.090356353942185308e+01 5.128373448963491983e-11
+8.290695370105433426e+01 4.743932634934064687e-11
+8.495995319958294090e+01 5.322727042024682985e-11
+8.706379049582098162e+01 7.080968612459683139e-11
+8.921972447058035982e+01 1.065018182031756918e-10
+9.142904517795346919e+01 1.726600254401497926e-10
+9.369307461724646657e+01 2.876481275298218432e-10
+9.601316752402956922e+01 4.694948372918105206e-10
+9.839071218077494052e+01 7.157546140516350675e-10
+1.008271312475683033e+02 9.716863547222858740e-10
+1.033238826133913761e+02 1.119905069844849323e-09
+1.058824602684840670e+02 1.045363652513696129e-09
+1.085043951983090125e+02 7.798391452019646085e-10
+1.111912562996526503e+02 4.824306266532919396e-10
+1.139446513194126140e+02 2.578512518664167085e-10
+1.167662278166298506e+02 1.240567737530927084e-10
+1.196576741483453361e+02 5.597587829933610901e-11
+1.226207204798683108e+02 2.467873401275421556e-11
+1.256571398200615448e+02 1.107640163118535457e-11
+1.287687490822632412e+02 5.272792739526633049e-12
+1.319574101714799497e+02 2.773711103721254275e-12
+1.352250310985013471e+02 1.665283167454923907e-12
+1.385735671216046683e+02 1.129770391972871083e-12
+1.420050219165280794e+02 8.465977970471373638e-13
+1.455214487754185768e+02 6.849475673690594637e-13
+1.491249518354676127e+02 5.848428294652160391e-13
+1.528176873379713641e+02 5.151468635162508436e-13
+1.566018649185687934e+02 4.575529911423617034e-13
+1.604797489294292632e+02 4.005701527607858394e-13
+1.644536597941813341e+02 3.378710813534021925e-13
+1.685259753963927096e+02 2.685840141476925828e-13
+1.726991325024345940e+02 1.997919340449873794e-13
+1.769756282195763220e+02 1.400475203486411904e-13
+1.813580214901899694e+02 9.320566277986828182e-14
+1.858489346229537205e+02 5.934010325034730844e-14
+1.904510548619723238e+02 3.641355999827606992e-14
+1.951671359947531528e+02 2.169984077181235770e-14
+2.000000000000000284e+02 1.265313784185148962e-14
diff --git a/Workspace/CumNumOfSat/HaloDistributionFunction/subhalomf.py b/Workspace/CumNumOfSat/HaloDistributionFunction/subhalomf.py
new file mode 100755
index 0000000..5c9ca0e
--- /dev/null
+++ b/Workspace/CumNumOfSat/HaloDistributionFunction/subhalomf.py
@@ -0,0 +1,173 @@
+import numpy as np
+import matplotlib.pyplot as plt
+from scipy.integrate import cumtrapz, trapz
+from classy import Class
+import genmassfct as gmf
+
+
+def ps_class(cosmopars):
+ """
+ Calculate power spectrum with CLASS
+ """
+
+ Om, Ob, As, h0, ns, mWDM, fWDM = cosmopars
+
+
+ if (fWDM>0):
+
+ m_nu = 4.43*mWDM**(4./3)*((Om-Ob)*h0**2/0.1225)**(-1./3)
+
+ CLASSparams = {
+ 'h': h0,
+ 'T_cmb': 2.726,
+ 'Omega_b': Ob,
+ 'Omega_cdm': (1-fWDM)*(Om-Ob),
+ 'Omega_ncdm': fWDM*(Om-Ob),
+ 'N_ur': 3.04,
+ 'N_ncdm': 1,
+ 'm_ncdm': 1000*m_nu,
+ 'T_ncdm': 0.715985,
+ 'n_s': ns,
+ 'A_s': As,
+ 'P_k_max_h/Mpc': 200,
+ 'k_per_decade_for_pk': 10,
+ 'output': 'mPk',
+ 'z_pk': 0.0,
+ 'ncdm_fluid_approximation': 3,
+ }
+ else:
+
+ CLASSparams = {
+ 'h': h0,
+ 'T_cmb': 2.726,
+ 'Omega_b': Ob,
+ 'Omega_cdm': (Om-Ob),
+ 'N_ur': 3.04,
+ 'n_s': ns,
+ 'A_s': As,
+ 'P_k_max_h/Mpc': 200,
+ 'k_per_decade_for_pk': 10,
+ 'output': 'mPk',
+ 'z_pk': 0.0,
+ 'ncdm_fluid_approximation': 1,
+ }
+
+ CLASScosmo = Class()
+ CLASScosmo.set(CLASSparams)
+ CLASScosmo.compute()
+ s8 = CLASScosmo.sigma8()
+ print("s8 = ",s8)
+ k_bin = np.logspace(np.log10(1e-3), np.log10(200), 500) #in [h/Mpc]
+ z_bin = np.array([0])
+ pk_bin = []
+ for i in range(len(k_bin)):
+ pk_bin += [CLASScosmo.pk_lin(k_bin[i]*h0,0)]
+
+ pk_bin = np.array(pk_bin)*h0**3 # [Mpc/h]^3
+
+ CLASScosmo.struct_cleanup()
+ CLASScosmo.empty()
+
+ return k_bin, pk_bin
+
+
+def Nsat_integral(mbin,dNsatdlnm):
+ """
+ Cumulative mass function Nsat(>M)
+ """
+
+ Nsat = trapz(dNsatdlnm/mbin,mbin) - cumtrapz(dNsatdlnm/mbin,mbin,initial=dNsatdlnm[0]/mbin[0])
+
+ return Nsat
+
+
+# MAIN #################################
+
+#Cosmology
+Om = 0.315
+Ob = 0.048
+h0 = 0.681
+As = 2.07e-9
+ns = 0.963
+
+#CDM
+mWDM = 3.0
+fWDM = 0.0
+
+cosmopars = Om, Ob, As, h0, ns, mWDM, fWDM
+
+#calculate power spectrum
+kbin, PSbin = ps_class(cosmopars)
+body = np.transpose([kbin, PSbin])
+filename = 'CDM_pk.dat'
+np.savetxt(filename,body,delimiter='\t')
+
+
+#WDM
+mWDM = 3.0
+fWDM = 1.0
+cosmopars = Om, Ob, As, h0, ns, mWDM, fWDM
+
+#calculate power spectrum
+kbin, PSbin = ps_class(cosmopars)
+body = np.transpose([kbin, PSbin])
+filename = 'WDM_pk.dat'
+np.savetxt(filename,body,delimiter='\t')
+
+
+#CDM+WDM
+mWDM = 0.5
+fWDM = 0.2
+cosmopars = Om, Ob, As, h0, ns, mWDM, fWDM
+
+
+#calculate power spectrum
+kbin, PSbin = ps_class(cosmopars)
+body = np.transpose([kbin, PSbin])
+filename = 'MDM_pk.dat'
+np.savetxt(filename,body,delimiter='\t')
+
+
+#Host halo mass (Msun/h)
+M0 = 1e12
+
+#redshift
+z0 = 0
+
+#initialise parameters
+par = gmf.par()
+par.window.window = "sharpk"
+par.code.rmin = 0.008
+par.mf.q = 1.0
+par.mf.p = 0.3
+par.mf.c = 2.5
+
+
+#Calculate stellite function for CDM
+par.file.psfct = "CDM_pk.dat"
+mbin_CDM, dNsatdlnM_CDM = gmf.dNsatdlnm(M0,z0,par)
+Nsat_CDM = Nsat_integral(mbin_CDM,dNsatdlnM_CDM)
+print(mbin_CDM)
+
+#Calculate stellite function for WDM
+par.file.psfct = "WDM_pk.dat"
+mbin_WDM, dNsatdlnM_WDM = gmf.dNsatdlnm(M0,z0,par)
+Nsat_WDM = Nsat_integral(mbin_WDM,dNsatdlnM_WDM)
+
+#Calculate stellite function for CDM+WDM
+par.file.psfct = "MDM_pk.dat"
+mbin_MDM, dNsatdlnM_MDM = gmf.dNsatdlnm(M0,z0,par)
+Nsat_MDM = Nsat_integral(mbin_MDM,dNsatdlnM_MDM)
+
+
+
+
+f = plt.figure(figsize=(6,4),dpi=140)
+plt.loglog(mbin_CDM, Nsat_CDM, color='black',ls='-')
+plt.loglog(mbin_WDM, Nsat_WDM, color='blue',ls='-')
+plt.loglog(mbin_MDM, Nsat_MDM, color='green',ls='-')
+plt.axis([1e7,4e12,0.0001,1000])
+plt.ylabel(r'Nsat(>M)')
+plt.xlabel(r'M [M$_{\odot}$/h]')
+plt.grid()
+plt.show()
diff --git a/Workspace/CumNumOfSat/HaloDistributionFunction/subhalomf_yr.py b/Workspace/CumNumOfSat/HaloDistributionFunction/subhalomf_yr.py
new file mode 100755
index 0000000..dc87173
--- /dev/null
+++ b/Workspace/CumNumOfSat/HaloDistributionFunction/subhalomf_yr.py
@@ -0,0 +1,155 @@
+import numpy as np
+import matplotlib.pyplot as plt
+from scipy.integrate import cumtrapz, trapz
+from classy import Class
+import genmassfct as gmf
+
+
+def ps_class(cosmopars):
+ """
+ Calculate power spectrum with CLASS
+ """
+
+ Om, Ob, As, h0, ns, mWDM, fWDM = cosmopars
+
+
+ if (fWDM>0):
+
+ m_nu = 4.43*mWDM**(4./3)*((Om-Ob)*h0**2/0.1225)**(-1./3)
+
+ CLASSparams = {
+ 'h': h0,
+ 'T_cmb': 2.726,
+ 'Omega_b': Ob,
+ 'Omega_cdm': (1-fWDM)*(Om-Ob),
+ 'Omega_ncdm': fWDM*(Om-Ob),
+ 'N_ur': 3.04,
+ 'N_ncdm': 1,
+ 'm_ncdm': 1000*m_nu,
+ 'T_ncdm': 0.715985,
+ 'n_s': ns,
+ 'A_s': As,
+ 'P_k_max_h/Mpc': 200,
+ 'k_per_decade_for_pk': 10,
+ 'output': 'mPk',
+ 'z_pk': 0.0,
+ 'ncdm_fluid_approximation': 3,
+ }
+ else:
+
+ CLASSparams = {
+ 'h': h0,
+ 'T_cmb': 2.726,
+ 'Omega_b': Ob,
+ 'Omega_cdm': (Om-Ob),
+ 'N_ur': 3.04,
+ 'n_s': ns,
+ 'A_s': As,
+ 'P_k_max_h/Mpc': 200,
+ 'k_per_decade_for_pk': 10,
+ 'output': 'mPk',
+ 'z_pk': 0.0,
+ 'ncdm_fluid_approximation': 1,
+ }
+
+ CLASScosmo = Class()
+ CLASScosmo.set(CLASSparams)
+ CLASScosmo.compute()
+ s8 = CLASScosmo.sigma8()
+ print("s8 = ",s8)
+ k_bin = np.logspace(np.log10(1e-3), np.log10(200), 500) #in [h/Mpc]
+ z_bin = np.array([0])
+ pk_bin = []
+ for i in range(len(k_bin)):
+ pk_bin += [CLASScosmo.pk_lin(k_bin[i]*h0,0)]
+
+ pk_bin = np.array(pk_bin)*h0**3 # [Mpc/h]^3
+
+ CLASScosmo.struct_cleanup()
+ CLASScosmo.empty()
+
+ return k_bin, pk_bin
+
+
+def Nsat_integral(mbin,dNsatdlnm):
+ """
+ Cumulative mass function Nsat(>M)
+ """
+
+ Nsat = trapz(dNsatdlnm/mbin,mbin) - cumtrapz(dNsatdlnm/mbin,mbin,initial=dNsatdlnm[0]/mbin[0])
+
+ return Nsat
+
+
+# MAIN #################################
+
+#Cosmology
+Om = 0.315
+Ob = 0.048
+h0 = 0.681
+As = 2.07e-9
+ns = 0.963
+
+#CDM
+mWDM = None # DM mass in keV
+fWDM = 0.0 # fraction of wdm
+
+cosmopars = Om, Ob, As, h0, ns, mWDM, fWDM
+
+#calculate power spectrum
+kbin, PSbin = ps_class(cosmopars)
+body = np.transpose([kbin, PSbin])
+filename = 'CDM_pk.dat'
+np.savetxt(filename,body,delimiter='\t')
+
+
+#WDM
+mWDM = 1.0 # DM mass in keV
+fWDM = 1.0 # fraction of wdm
+cosmopars = Om, Ob, As, h0, ns, mWDM, fWDM
+
+#calculate power spectrum
+kbin, PSbin = ps_class(cosmopars)
+body = np.transpose([kbin, PSbin])
+filename = 'WDM_pk.dat'
+np.savetxt(filename,body,delimiter='\t')
+
+
+
+#Host halo mass (Msun/h)
+M0 = 1e12
+
+#redshift
+z0 = 0
+
+#initialise parameters
+par = gmf.par()
+par.window.window = "sharpk"
+par.code.rmin = 0.008
+par.mf.q = 1.0
+par.mf.p = 0.3
+par.mf.c = 2.5
+
+
+#Calculate stellite function for CDM
+par.file.psfct = "CDM_pk.dat"
+mbin_CDM, dNsatdlnM_CDM = gmf.dNsatdlnm(M0,z0,par)
+Nsat_CDM = Nsat_integral(mbin_CDM,dNsatdlnM_CDM)
+
+
+#Calculate stellite function for WDM
+par.file.psfct = "WDM_pk.dat"
+mbin_WDM, dNsatdlnM_WDM = gmf.dNsatdlnm(M0,z0,par)
+Nsat_WDM = Nsat_integral(mbin_WDM,dNsatdlnM_WDM)
+
+
+
+
+f = plt.figure(figsize=(6,4),dpi=140)
+plt.loglog(mbin_CDM, Nsat_CDM, color='black',ls='-')
+plt.loglog(mbin_WDM, Nsat_WDM, color='blue',ls='-')
+plt.axis([1e7,4e12,0.0001,1000])
+plt.ylabel(r'Nsat(>M)')
+plt.xlabel(r'M [M$_{\odot}$/h]')
+plt.grid()
+plt.show()
diff --git a/Workspace/CumNumOfSat/HaloDistributionFunction/test.py b/Workspace/CumNumOfSat/HaloDistributionFunction/test.py
new file mode 100644
index 0000000..dcdf149
--- /dev/null
+++ b/Workspace/CumNumOfSat/HaloDistributionFunction/test.py
@@ -0,0 +1,38 @@
+import numpy as np
+import matplotlib.pyplot as plt
+from scipy.integrate import cumtrapz, trapz
+from classy import Class
+import genmassfct as gmf
+
+
+
+#Cosmology
+Om = 0.315
+Ob = 0.048
+h0 = 0.681
+As = 2.07e-9
+ns = 0.963
+
+#CDM
+mWDM = 3.0
+fWDM = 0.0
+
+
+CLASSparams = {
+ 'h': h0,
+ 'T_cmb': 2.726,
+ 'Omega_b': Ob,
+ 'Omega_cdm': (Om-Ob),
+ 'N_ur': 3.04,
+ 'n_s': ns,
+ 'A_s': As,
+ 'P_k_max_h/Mpc': 200,
+ 'k_per_decade_for_pk': 10,
+ 'output': 'mPk',
+ 'z_pk': 0.0,
+ 'ncdm_fluid_approximation': 1,
+ }
+
+CLASScosmo = Class()
+CLASScosmo.set(CLASSparams)
+CLASScosmo.compute()
diff --git a/Workspace/CumNumOfSat/HaloDistributionFunction/var.dat b/Workspace/CumNumOfSat/HaloDistributionFunction/var.dat
new file mode 100644
index 0000000..a5009f8
--- /dev/null
+++ b/Workspace/CumNumOfSat/HaloDistributionFunction/var.dat
@@ -0,0 +1,100 @@
+7.999999999999998432e-03 1.668846247584098208e+01 -7.762942155660028359e-08
+8.677437660875260417e-03 1.668846181550131291e+01 -8.629792555211845206e-07
+9.412240544797050024e-03 1.668845863755709402e+01 -3.701990957225337024e-06
+1.020926632207987822e-02 1.668845488066488514e+01 -1.903976749684155016e-06
+1.107378400914017617e-02 1.668845342822769595e+01 -3.002327081369533281e-07
+1.201150880116391186e-02 1.668845317358576708e+01 -8.358926548624399157e-08
+1.302863985439430168e-02 1.668845302024317689e+01 -1.399552556146767850e-07
+1.413190126781268749e-02 1.668845245836337554e+01 -6.661738653053820922e-07
+1.532858653513609858e-02 1.668845013341672612e+01 -2.676225424903511622e-06
+1.662660676099693077e-02 1.668844532643491974e+01 -4.335809825295893615e-06
+1.803454296005475160e-02 1.668843963592430057e+01 -4.056208143140600497e-06
+1.956170278478150046e-02 1.668843441481551082e+01 -3.649660537562608039e-06
+2.121818205693894524e-02 1.668842894361108620e+01 -4.378421420548033351e-06
+2.301493150952372072e-02 1.668842084997221065e+01 -7.417976463296846743e-06
+2.496382918040074630e-02 1.668840311321404357e+01 -1.826323231829524819e-05
+2.707775893620829530e-02 1.668835085487577530e+01 -5.712180941184128705e-05
+2.937069564564444291e-02 1.668819341858266725e+01 -1.701530273825927299e-04
+3.185779756520253775e-02 1.668782216707361954e+01 -3.685623920767595266e-04
+3.455550654810360389e-02 1.668717412097613462e+01 -5.774181477798649579e-04
+3.748165673889199828e-02 1.668625855541473868e+01 -7.635597720005347054e-04
+4.065559247225757761e-02 1.668506287566332702e+01 -9.885350795189496061e-04
+4.409829615549561155e-02 1.668344475366583524e+01 -1.379292343114863623e-03
+4.783252698001604769e-02 1.668096581322743077e+01 -2.238104949203754968e-03
+5.188297137890294369e-02 1.667641410831559057e+01 -4.382529768518529656e-03
+5.627640622517574021e-02 1.666700327932165493e+01 -9.293187334996398305e-03
+6.104187584963188112e-02 1.664790639662400196e+01 -1.851526884725699165e-02
+6.621088404850851428e-02 1.661355716573923758e+01 -3.172696311422611853e-02
+7.181760235029664707e-02 1.655906694086334596e+01 -4.837377872302604104e-02
+7.789909591852847703e-02 1.647963523949583831e+01 -6.902828027493233820e-02
+8.449556858394673131e-02 1.636937028309521480e+01 -9.502687356210080816e-02
+9.165062862592604498e-02 1.622189654399595327e+01 -1.263109720489576371e-01
+9.941157706018786955e-02 1.603202181555793260e+01 -1.618946719751719610e-01
+1.078297203386347491e-01 1.579661377848615267e+01 -2.004918370963586771e-01
+1.169607095285146031e-01 1.551458813916640800e+01 -2.411379614299908603e-01
+1.268649082131780848e-01 1.518652708038323773e+01 -2.830925069981158337e-01
+1.376077915465644397e-01 1.481454197624433711e+01 -3.255002734681560206e-01
+1.492603790995039037e-01 1.440226987013034687e+01 -3.674096326968842030e-01
+1.618997043593192742e-01 1.395463157218347661e+01 -4.080420024814508384e-01
+1.756093239865160749e-01 1.347737608904738771e+01 -4.468577214394849895e-01
+1.904798701951800899e-01 1.297659069590164016e+01 -4.835979134317830996e-01
+2.066096499087859140e-01 1.245827556722447405e+01 -5.182293544090864623e-01
+2.241052946523441058e-01 1.192813372068019895e+01 -5.507059881255406131e-01
+2.430824654772248961e-01 1.139144166301399075e+01 -5.811155750785106378e-01
+2.636666175788102695e-01 1.085290591702520580e+01 -6.096440406108167842e-01
+2.859938296617455800e-01 1.031664219313869424e+01 -6.364301641207443794e-01
+3.102117035355971275e-01 9.786176835139613672e+00 -6.616998717504147809e-01
+3.364803398880077956e-01 9.264444176501585915e+00 -6.856881287666680702e-01
+3.649733966860386203e-01 8.753855088250354299e+00 -7.085697212980032189e-01
+3.958792372026249118e-01 8.256348345151307555e+00 -7.305699841557264929e-01
+4.294021752575786222e-01 7.773432948407631216e+00 -7.518881533154032626e-01
+4.657638259052340191e-01 7.306258227953401629e+00 -7.726889208960745492e-01
+5.052045704979287732e-01 6.855660283817101686e+00 -7.931660399474017575e-01
+5.479851458106298479e-01 6.422211937319387332e+00 -8.134575528640574094e-01
+5.943883677321727399e-01 6.006281557133450022e+00 -8.336712527210636825e-01
+6.447210009181668644e-01 5.608064984505036321e+00 -8.539289729288123132e-01
+6.993157867655619420e-01 5.227613165696423536e+00 -8.743265046813301078e-01
+7.585336431155127457e-01 4.864859551414405736e+00 -8.949584835881555511e-01
+8.227660502264340092e-01 4.519637342525245849e+00 -9.159257057063063812e-01
+8.924376387905557095e-01 4.191699237909248588e+00 -9.373053910847400916e-01
+9.680089971029702811e-01 3.880734598201664554e+00 -9.591773656833556538e-01
+1.049979715940926761e+00 3.586383007852360638e+00 -9.816018752306480133e-01
+1.138891691282613472e+00 3.308248835412600730e+00 -1.004616115707902546e+00
+1.235332706699209249e+00 3.045902095993110237e+00 -1.028318021755317835e+00
+1.339940319102837840e+00 2.798885993196826405e+00 -1.052738580645972144e+00
+1.453406073538522580e+00 2.566725849748050514e+00 -1.077944325679212501e+00
+1.576480074883502169e+00 2.348937139349434933e+00 -1.103918559586000159e+00
+1.709975946676695946e+00 2.144995018393129893e+00 -1.131092839710582387e+00
+1.854776209860398817e+00 1.954361999219727419e+00 -1.159288786258741988e+00
+2.011838116992263004e+00 1.776643422431001706e+00 -1.186866420235231034e+00
+2.182199980496631664e+00 1.611142174636106539e+00 -1.219542775772250343e+00
+2.366988036790341532e+00 1.457482771219706041e+00 -1.247169475641549008e+00
+2.567423891660713942e+00 1.314954711078293315e+00 -1.285569751925933257e+00
+2.784832596115953685e+00 1.183374600298152446e+00 -1.309154068741468002e+00
+3.020651406096200642e+00 1.061705962652746971e+00 -1.361342860233186958e+00
+3.276439283954373227e+00 9.498669317251260402e-01 -1.378035850472576040e+00
+3.553887204519610155e+00 8.476320571459244890e-01 -1.424984711076021870e+00
+3.854829333875146702e+00 7.529963120713250024e-01 -1.489488718089102770e+00
+4.181255154751862158e+00 6.672296991375564756e-01 -1.486222657369335787e+00
+4.535322618696582708e+00 5.901579540932496704e-01 -1.535313140026256296e+00
+4.919372411962143588e+00 5.186816536204357231e-01 -1.644198663886044409e+00
+5.335943429428884777e+00 4.532358886891649785e-01 -1.675700341956436912e+00
+5.787789558853268623e+00 3.958823013969102189e-01 -1.653029936593449767e+00
+6.277897886401746952e+00 3.453476571394105132e-01 -1.709093091830883315e+00
+6.809508443823966140e+00 2.988560006111035117e-01 -1.853422264031702849e+00
+7.386135627810779702e+00 2.557866864763622683e-01 -1.980420375140015565e+00
+8.011591433137226659e+00 2.174316200106092001e-01 -2.018415998788678500e+00
+8.690010653181323264e+00 1.846179331196686757e-01 -2.006313825581588439e+00
+9.425878214415364553e+00 1.566899185880875067e-01 -2.030319467615813611e+00
+1.022405882557394463e+01 1.322826116246023365e-01 -2.140623506659938169e+00
+1.108982913750493182e+01 1.103269030411377361e-01 -2.333956487444109662e+00
+1.202891262630715197e+01 9.041012012856781965e-02 -2.577223997735562655e+00
+1.304751743036195499e+01 7.259386179360663438e-02 -2.837363208401077141e+00
+1.415237739139365658e+01 5.705803452157362510e-02 -3.102746573469256752e+00
+1.535079657087487881e+01 4.384932795852919396e-02 -3.392368180273522160e+00
+1.665069753606806202e+01 3.281800556024765808e-02 -3.760198203774670400e+00
+1.806067373491499239e+01 2.367808923854186273e-02 -4.312085666267168271e+00
+1.959004630601652508e+01 1.610067947683961609e-02 -5.269057084124861845e+00
+2.124892569926476327e+01 9.783000827509475902e-03 -7.257601781668911123e+00
+2.304827851449253373e+01 4.478297375304468933e-03 -1.336010212793839003e+01
+2.499999999999998934e+01 5.066059182116889097e-07 -9.990141901903292455e+04
diff --git a/Workspace/CumNumOfSat/IMF.py b/Workspace/CumNumOfSat/IMF.py
new file mode 120000
index 0000000..32fb2ff
--- /dev/null
+++ b/Workspace/CumNumOfSat/IMF.py
@@ -0,0 +1 @@
+../SurfaceBrightness/IMF.py
\ No newline at end of file
diff --git a/Workspace/CumNumOfSat/Isochrones b/Workspace/CumNumOfSat/Isochrones
new file mode 120000
index 0000000..47886b4
--- /dev/null
+++ b/Workspace/CumNumOfSat/Isochrones
@@ -0,0 +1 @@
+../SurfaceBrightness/Isochrones
\ No newline at end of file
diff --git a/Workspace/CumNumOfSat/MsvsMh_2018.pkl b/Workspace/CumNumOfSat/MsvsMh_2018.pkl
new file mode 100644
index 0000000..9037d19
Binary files /dev/null and b/Workspace/CumNumOfSat/MsvsMh_2018.pkl differ
diff --git a/Workspace/CumNumOfSat/Readme b/Workspace/CumNumOfSat/Readme
new file mode 100644
index 0000000..89faa01
--- /dev/null
+++ b/Workspace/CumNumOfSat/Readme
@@ -0,0 +1,133 @@
+# note:
+Next to classy, you need to pull and pip install this:
+https://bitbucket.org/aurelschneider/genmassfct/src/master/
+
+
+# Note : predictions of the haloes in WDM/CDM
+# https://arxiv.org/abs/2304.09810
+
+
+
+# test the halo function distribution (pour Courbin)
+./satComputeNvsM.py
+
+# test the Mstar vs Mhalo relation
+./satComputeMstarvsMhalo.py --LvvsMh_model rj2018
+
+./satComputeMstarvsMhalo.py --LvvsMh_model model1 -p LvvsMhm1.png
+./satComputeMstarvsMhalo.py --LvvsMh_model model2 -p LvvsMhm2.png
+./satComputeMstarvsMhalo.py --LvvsMh_model model3 -p LvvsMhm3.png
+./satComputeMstarvsMhalo.py --LvvsMh_model model4 -p LvvsMhm4.png
+
+
+
+
+
+# do Ngal realisation and plot the cumulative numbers of satellites
+./satComputeNCum.py --Ngal 80
+
+./satComputeNCumWithErrors.py --Nrealisations=100 --Ngal 100 -p NhCum100.png
+./satComputeNCumWithErrors.py --Nrealisations=100 --Ngal 75 -p NhCum075.png
+./satComputeNCumWithErrors.py --Nrealisations=100 --Ngal 50 -p NhCum050.png
+./satComputeNCumWithErrors.py --Nrealisations=100 --Ngal 25 -p NhCum025.png
+
+
+
+
+# do Ngal realisation and plot the cumulative numbers of satellites vs Luminosity
+./satComputeNCumvsLv.py --LvvsMh_file MsvsMh_2018.pkl --Ngal 80
+
+# same but now we run several realisations
+
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model1 --data --Nrealisations=100 --Ngal 100 -p LCum100m1.png
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model1 --data --Nrealisations=100 --Ngal 75 -p LCum075m1.png
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model1 --data --Nrealisations=100 --Ngal 50 -p LCum050m1.png
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model1 --data --Nrealisations=100 --Ngal 25 -p LCum025m1.png
+
+
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model2 --data --Nrealisations=100 --Ngal 100 -p LCum100m2.png
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model2 --data --Nrealisations=100 --Ngal 75 -p LCum075m2.png
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model2 --data --Nrealisations=100 --Ngal 50 -p LCum050m2.png
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model2 --data --Nrealisations=100 --Ngal 25 -p LCum025m2.png
+
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model3 --data --Nrealisations=100 --Ngal 100 -p LCum100m3.png
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model3 --data --Nrealisations=100 --Ngal 75 -p LCum075m3.png
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model3 --data --Nrealisations=100 --Ngal 50 -p LCum050m3.png
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model3 --data --Nrealisations=100 --Ngal 25 -p LCum025m3.png
+
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model4 --data --Nrealisations=100 --Ngal 100 -p LCum100m4.png
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model4 --data --Nrealisations=100 --Ngal 75 -p LCum075m4.png
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model4 --data --Nrealisations=100 --Ngal 50 -p LCum050m4.png
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model4 --data --Nrealisations=100 --Ngal 25 -p LCum025m4.png
+
+
+
+
+# variation of the DMmass
+
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model3 --data --Nrealisations=100 --Ngal 75 --DMmass 1.1 -p LCum075m3DM1.1.png
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model3 --data --Nrealisations=100 --Ngal 75 --DMmass 2.0 -p LCum075m3DM2.0.png
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model3 --data --Nrealisations=100 --Ngal 75 --DMmass 3.0 -p LCum075m3DM3.0.png
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model3 --data --Nrealisations=100 --Ngal 75 --DMmass 4.0 -p LCum075m3DM4.0.png
+
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model3 --data --Nrealisations=100 --Ngal 75 --DMmass 5.0 -p LCum075m3DM5.0.png
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model3 --data --Nrealisations=100 --Ngal 75 --DMmass 6.0 -p LCum075m3DM6.0.png
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model3 --data --Nrealisations=100 --Ngal 75 --DMmass 7.0 -p LCum075m3DM7.0.png
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model3 --data --Nrealisations=100 --Ngal 75 --DMmass 8.0 -p LCum075m3DM8.0.png
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model3 --data --Nrealisations=100 --Ngal 75 --DMmass 9.0 -p LCum075m3DM9.0.png
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model3 --data --Nrealisations=100 --Ngal 75 --DMmass 10.0 -p LCum075m3DM10.0.png
+
+
+# distribution of Main halo mass
+
+./satComputeNCumvsLvWithErrorsWithM0varied.py --LvvsMh_model model3 --data --Nrealisations=100 --Ngal 75 --DMmass 2.0 --M0_var=0 -p LCum075m3DM2.0.d0.0.png
+./satComputeNCumvsLvWithErrorsWithM0varied.py --LvvsMh_model model3 --data --Nrealisations=100 --Ngal 75 --DMmass 2.0 --M0_var=0.1 -p LCum075m3DM2.0.d0.1.png
+./satComputeNCumvsLvWithErrorsWithM0varied.py --LvvsMh_model model3 --data --Nrealisations=100 --Ngal 75 --DMmass 2.0 --M0_var=0.5 -p LCum075m3DM2.0.d0.5.png
+./satComputeNCumvsLvWithErrorsWithM0varied.py --LvvsMh_model model3 --data --Nrealisations=100 --Ngal 75 --DMmass 2.0 --M0_var=1.0 -p LCum075m3DM2.0.d1.0.png
+
+
+
+
+# in magnitude
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model3 --data --Nrealisations=100 --Ngal 75 --filter VISeuclid --DMmass 1.1 -p LCum_VIS_075m3DM1.1.png
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model3 --data --Nrealisations=100 --Ngal 75 --filter VISeuclid --DMmass 2.0 -p LCum_VIS_075m3DM2.0.png
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model3 --data --Nrealisations=100 --Ngal 75 --filter VISeuclid --DMmass 3.0 -p LCum_VIS_075m3DM3.0.png
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model3 --data --Nrealisations=100 --Ngal 75 --filter VISeuclid --DMmass 4.0 -p LCum_VIS_075m3DM4.0.png
+
+
+./satComputeNCumvsLvWithErrors.py --LvvsMh_model model3 --data --Nrealisations=100 --Ngal 30 --filter VISeuclid --DMmass 4.0 -p LCum_VIS_075m3DM4.0.png
+
+
+
+
+# comments
+
+ - no variation of the MW mass, in all realisation, we assume the same total mass and take
+ values from Sawala 2017
+
+ - the Lv vs Mh relation is obtained from CDM simulations (no WDM)
+
+ - the Lv vs Mh relation is quite uncertain
+
+
+ -> f : Subhalo mass function (SHMF) supression
+ see :
+ Nadler 2019 -> eq 7 - from Schneider 2012
+ Lovell et al. (2014),
+
+
+
+
+dmo resolution (Forouhar): 4 × 10^5
+
+
+
+
+###########################
+# plots for Oliver
+###########################
+
+/home/revaz/ownCloud/papers/2023M83
+
+
+
diff --git a/Workspace/CumNumOfSat/check_hdistrib.py b/Workspace/CumNumOfSat/check_hdistrib.py
new file mode 100755
index 0000000..dbfcd0c
--- /dev/null
+++ b/Workspace/CumNumOfSat/check_hdistrib.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python3
+
+import sys
+import numpy as np
+import matplotlib.pyplot as plt
+import Ptools as pt
+import pickle
+
+
+
+
+f = open("Mhaloes.pkl","rb")
+Mh = pickle.load(f)
+f.close()
+
+
+mass = np.log10(Mh)
+
+
+logMh = np.linspace(6.9,10,100)
+n, bins = np.histogram(mass, logMh)
+
+
+Ms = 10**bins
+dM = Ms[1:]-Ms[:-1]
+
+dNdM = n/dM
+
+Nc = np.add.accumulate(np.flip(n,0))
+Nc = np.flip(Nc,0)
+
+
+#pt.plot(Ms[1:],dNdM)
+pt.plot(Ms[1:],Nc)
+
+pt.loglog()
+
+pt.show()
diff --git a/Workspace/CumNumOfSat/data/Drlica_raw_all.txt b/Workspace/CumNumOfSat/data/Drlica_raw_all.txt
new file mode 100644
index 0000000..78312fe
--- /dev/null
+++ b/Workspace/CumNumOfSat/data/Drlica_raw_all.txt
@@ -0,0 +1,88 @@
+0.1053709571210737, 57.32295455509422
+0.01558136061859905, 57.32445429983094
+0.015543152279661854, 55.881407758743016
+-0.3525865517126947, 56.173106500325034
+-0.352609476716057, 55.320345968864046
+-0.7925784995781799, 55.32743834735412
+-0.7926167079171171, 53.93466331775135
+-1.3044174079812199, 53.94270706302792
+-1.3044403329845822, 53.1238060904914
+-1.672577678644727, 53.12950483820501
+-1.6726388119870266, 51.00580696538599
+-1.8701759242924694, 51.00874284268492
+-1.8701988492958317, 50.234382203480585
+-2.4179153879609214, 50.242399882295665
+-2.41798416297101, 47.98878033404222
+-2.4898158401729913, 47.98978475864649
+-2.4898693318475034, 46.30705637432653
+-2.615574766950966, 46.30875253216081
+-2.6156206169576905, 44.91340414879336
+-2.983750320950047, 45.14785034468967
+-2.9837961709567717, 43.787481590484376
+-3.19929120256271, 43.79023111719334
+-3.199314127566072, 43.125454267793316
+-3.289103724068547, 43.126582562270805
+-3.2891724990786337, 41.19214253274608
+-3.414893217517672, 40.77568376932792
+-3.4149390675243967, 39.54705459412567
+-3.4149696341955473, 38.7486048904889
+-3.4868165947331025, 38.356248553279066
+-3.486893011410977, 36.44944689781945
+-3.558724688612956, 36.450209799502346
+-3.558755255284105, 35.71428497499636
+-3.801194807508572, 35.53514728109904
+-3.8012330158475103, 34.640609827627074
+-3.8551067737489944, 34.641153607697326
+-3.855152623755719, 33.597366525527136
+-3.9269843009576983, 33.598069732012945
+-3.9270225092966355, 32.75229494172145
+-4.214356859772341, 32.58844046045571
+-4.21444855978579, 30.65415573405516
+-4.241385438736533, 30.65439633394102
+-4.241431288743257, 29.73073590197485
+-4.4120315220979585, 29.732213829551736
+-4.403220679139034, 26.577046205587944
+-4.528926114242497, 26.578019682821505
+-4.5290636642626705, 24.247183075797125
+-4.5829374221641554, 24.247563702321365
+-4.58298327217088, 23.516950222955092
+-4.744604545875333, 23.51805773084704
+-4.744665679217633, 22.577991578754485
+-4.987105231442101, 22.464743634771217
+-4.996160607770223, 21.34801116773821
+-5.130852644191723, 21.240265773270565
+-5.130898494198446, 20.600266445099393
+-5.184772252099931, 20.600589823192035
+-5.184948010459042, 18.320854977438604
+-5.553085356119187, 18.32282030970859
+-5.553169414464849, 17.32337962438941
+-5.750691243434716, 17.50195875657644
+-5.75076766011259, 16.631885034834095
+-5.849536216265312, 16.632363690834172
+-5.849658482949909, 15.329277357400395
+-6.038216635605107, 15.330119597676866
+-6.038323618954131, 14.27388812557346
+-8.2291897736145, 14.283003066139415
+-8.22928147362795, 13.435236364584911
+-8.750076416677874, 13.300935164582647
+-8.73236303074658, 11.298357759688674
+-8.804209991284136, 11.183954098457356
+-8.80434754130431, 10.203144770484222
+-9.055758411511237, 10.203892235870313
+-9.056079361558309, 8.236754085947869
+-9.433203308536486, 8.195761346347107
+-9.433394350231172, 7.214834100174226
+-9.79255273624107, 7.215589178777701
+-9.783810668292235, 6.160565776951869
+-10.843335548689215, 6.1311247987557485
+-10.852604891715385, 5.051142280220276
+-11.795395654991365, 5.05253006350728
+-11.786745287055977, 4.05773320232897
+-13.45682414033421, 4.080462078353642
+-13.466246316716127, 3.035766947680482
+-13.493183195666871, 3.035790774961438
+-13.484807927771834, 2.029194912920417
+-17.175167985691306, 2.0210461866638307
+-17.176191969174823, 1.020541813111283
+-18.14591961140155, 1.0208302156075462
+-18.146469811482245, 0.7071445648373939
diff --git a/Workspace/CumNumOfSat/data/Drlica_raw_detected.txt b/Workspace/CumNumOfSat/data/Drlica_raw_detected.txt
new file mode 100644
index 0000000..7b222ec
--- /dev/null
+++ b/Workspace/CumNumOfSat/data/Drlica_raw_detected.txt
@@ -0,0 +1,57 @@
+0.10461443201011678, 34.60120850712415
+0.014824835507642131, 34.60211378112381
+0.014778985500917496, 33.559503024289945
+-0.793319741353562, 33.73900728010958
+-0.7933655913602871, 32.72240314610642
+-1.305158649756602, 32.89458974916291
+-1.3052121414311144, 31.74116386613677
+-1.619468087521987, 31.90635062964912
+-1.6195750708710102, 29.708031726767977
+-1.8530280217774444, 29.710052628036994
+-1.853089155119743, 28.52247943759134
+-2.4187636130853307, 28.527181048826016
+-2.4188094630920545, 27.66761662996449
+-2.5265569788950244, 27.668485276138803
+-2.526618112237324, 26.56251781975085
+-2.6164077087397986, 26.563212776886314
+-2.616468842082097, 25.501425383209217
+-3.289890815850654, 25.506429776428575
+-3.290013082535253, 23.508092037176958
+-3.4336764369392108, 23.509076115246128
+-3.4337375702815103, 22.569368977189274
+-3.487611328182996, 22.569723265786045
+-3.478785201888497, 20.381433881187373
+-3.5595958387407234, 20.381913797437285
+-3.5596722554185978, 19.36866906062723
+-3.793125206325031, 19.369986622431508
+-3.8021882243209393, 18.313474880450645
+-3.8740199015229195, 18.313858188895484
+-3.874103959868583, 17.31490635343763
+-3.9279777177700663, 17.31517815872743
+-3.919082816465482, 16.370657719059363
+-4.215388484923645, 16.37207117382553
+-4.215594809953908, 14.266309226871673
+-4.404152962609102, 14.267093064227291
+-4.404252304290338, 13.352013349516724
+-5.185429435529652, 13.287127181095672
+-5.1856739688988505, 11.286687752331346
+-5.832159063716665, 11.28881404484611
+-5.832304255404626, 10.24642755588108
+-6.038820327360316, 10.247044145878435
+-6.030001842733604, 9.206458277261525
+-8.220875639061763, 9.165482066725831
+-8.212057154435051, 8.234728672681676
+-8.7328368141494, 8.235978336907149
+-8.724262862891889, 6.285568969714562
+-8.805073499744116, 6.28571697434985
+-8.796415490140939, 5.073923589184933
+-9.038855042365407, 5.048473521476333
+-9.03917599241248, 4.07521306033012
+-9.775458325400555, 4.055355883919236
+-9.775893900464439, 3.0325043774163576
+-10.844390098843881, 3.033448653747411
+-10.836007189281057, 2.037994906841596
+-11.80573483150778, 2.0385708389699553
+-11.788816179026375, 1.0189410601030766
+-13.485847194590926, 1.014259988026752
+-13.477410793353583, 0.7061831755850421
diff --git a/Workspace/CumNumOfSat/data/Drlica_raw_weighted.txt b/Workspace/CumNumOfSat/data/Drlica_raw_weighted.txt
new file mode 100644
index 0000000..edbfdca
--- /dev/null
+++ b/Workspace/CumNumOfSat/data/Drlica_raw_weighted.txt
@@ -0,0 +1,59 @@
+0.1077016657962444, 271.4917332036423
+-0.00003820833893719566, 272.88820399047313
+-0.0003056667114980094, 228.28460620302366
+-0.7904541159332705, 228.33717068547992
+-0.8085648685895142, 206.199935170876
+-1.3113789673355822, 207.2844252198271
+-1.3115088756879687, 190.07275195448872
+-1.6168087871319559, 188.16093316314772
+-1.6349653897949246, 164.7988808837758
+-1.8684030573657826, 166.49946278127814
+-1.8685558907215314, 150.3565918950896
+-2.425251389036871, 150.3809830567563
+-2.425388939057045, 137.1928861070218
+-2.551109657496083, 135.80584537097656
+-2.5512013575095325, 127.74509840839175
+-2.6230330347115127, 127.74777216502862
+-2.6231553013961117, 117.73919015412679
+-3.3055715181504906, 116.56773600886332
+-3.305754918177389, 103.14066458520387
+-3.449418272581347, 103.14498218213602
+-3.4494794059236464, 99.02206065446084
+-3.5033531638251314, 99.02361507926355
+-3.494718079225319, 78.71986182028233
+-3.566549756427299, 78.72150945886587
+-3.566633814772961, 74.4275482654987
+-3.809073366997428, 74.05423043572699
+-3.809432525383437, 58.27301905524054
+-3.881264202585417, 58.2742387331256
+-3.8813711859344413, 54.25919602125256
+-3.9352449438359254, 54.26004776923191
+-3.9354741938695486, 46.563393792563545
+-4.222800902677466, 46.56729227770383
+-4.214051193060843, 39.961732147060374
+-4.249967031661832, 39.962150352489736
+-4.250173356692093, 34.82225237395812
+-4.420781231714582, 34.64686381382929
+-4.42096463174148, 30.656000381440784
+-5.193155161662759, 30.662898742181003
+-5.19338441169638, 26.31344216698772
+-5.848848466164441, 26.318468197205615
+-5.8489860161846146, 24.010393711336263
+-6.0465307701578475, 23.88964853390645
+-6.046698886849169, 21.354546878931053
+-8.228578440191505, 21.47736428349184
+-8.229197415282288, 14.21035773990485
+-8.741005757014179, 14.140190432909861
+-8.732439447424454, 10.736683245294392
+-8.813250084276682, 10.736936059143979
+-8.813517542649242, 8.981983040110807
+-9.05595709487371, 8.936930710782171
+-9.056278044920782, 7.214041352680904
+-9.78358141825861, 7.17887091374962
+-9.784009351654706, 5.395641997696859
+-10.852505550034149, 5.397322119601113
+-10.853086316785994, 3.663320842272159
+-11.795877080061974, 3.6643273265796292
+-11.796870496874341, 1.8884561225600596
+-13.475943593138394, 1.87977061376417
+-13.48638975300383, 0.7061850231556008
diff --git a/Workspace/CumNumOfSat/data/N(M)_drilca_wagner2020.png b/Workspace/CumNumOfSat/data/N(M)_drilca_wagner2020.png
new file mode 100644
index 0000000..d21c9f0
Binary files /dev/null and b/Workspace/CumNumOfSat/data/N(M)_drilca_wagner2020.png differ
diff --git a/Workspace/CumNumOfSat/data/Nadler_rawb1.txt b/Workspace/CumNumOfSat/data/Nadler_rawb1.txt
new file mode 100644
index 0000000..9f5af20
--- /dev/null
+++ b/Workspace/CumNumOfSat/data/Nadler_rawb1.txt
@@ -0,0 +1,31 @@
+0.10603578221858134, 89.32883045921619
+-0.18138262660278537, 84.0337587145293
+-0.6843572003723897, 75.89742731656328
+-1.2591940180151235, 67.16628650528213
+-1.744225955819807, 60.04727374078517
+-2.1753994190585817, 53.13728948134685
+-2.7323088840719705, 46.07478686939654
+-3.415015484202272, 37.58105447646861
+-3.864146866741542, 33.25656096461749
+-4.367197857189019, 28.543381420479584
+-4.942141658180777, 23.519411422434633
+-5.391303607391196, 20.392794930652204
+-5.87639667853818, 17.502599827004676
+-6.415394074257797, 14.71895980788519
+-6.990322591913982, 12.252569765155194
+-7.187951404232875, 11.525982691328684
+-7.906558559628591, 9.49767208376429
+-8.553288187815603, 8.069272804514528
+-9.128170855465061, 6.92582592865617
+-9.703053523114518, 5.944409856512714
+-10.259962988127906, 5.154335493520198
+-10.744994925932591, 4.608023019210863
+-11.21209951110793, 4.036419090242205
+-11.912687613860852, 3.4645699359331052
+-12.541413472740643, 3.0349489911262904
+-12.882736206134645, 2.7974496736556658
+-13.565549789613973, 2.1245387395210096
+-14.266306009058216, 1.6300402772038958
+-14.787467752161941, 1.263392598993674
+-15.326602697901734, 0.9692851459965025
+-15.919687818220883, 0.7066858929719035
diff --git a/Workspace/CumNumOfSat/data/Nadler_rawb2.txt b/Workspace/CumNumOfSat/data/Nadler_rawb2.txt
new file mode 100644
index 0000000..6ce6094
--- /dev/null
+++ b/Workspace/CumNumOfSat/data/Nadler_rawb2.txt
@@ -0,0 +1,24 @@
+0.10505764874178825, 46.508605897985255
+-0.7571211610444375, 40.74411861548282
+-1.421717008518495, 36.800917403164014
+-1.9067489463231797, 32.90035635729289
+-2.4995589666019833, 28.820275023212332
+-2.9307018631696073, 26.02928847153385
+-3.3439174071078868, 23.033828400350142
+-4.026608723902614, 18.980200250687467
+-4.5296597143500925, 16.29029218531784
+-4.960894310931167, 13.839450018771304
+-5.661604680368688, 10.948121833408171
+-6.398276738413925, 8.399972180304678
+-7.081044471886525, 6.577598025467124
+-7.78170899131732, 5.365067968142694
+-8.392538064238916, 4.511893856170946
+-9.362632506519436, 3.5333341828299414
+-10.153086622452706, 2.88206636130884
+-10.817789453275786, 2.4237869329810224
+-11.392656837589673, 2.101651247034867
+-12.183003970173917, 1.8411245362597954
+-12.847584534312402, 1.6799869953202955
+-13.332876288821858, 1.2628572408543772
+-13.782221638059173, 0.9688490667783639
+-14.303475081176348, 0.7063531723121446
diff --git a/Workspace/CumNumOfSat/data/Nadler_rawt1.txt b/Workspace/CumNumOfSat/data/Nadler_rawt1.txt
new file mode 100644
index 0000000..4853f60
--- /dev/null
+++ b/Workspace/CumNumOfSat/data/Nadler_rawt1.txt
@@ -0,0 +1,28 @@
+0.10702919903094932, 173.33210477740082
+-1.0786061248622323, 131.65732049550948
+-1.8870334434315725, 106.30103906945384
+-2.749395653244697, 82.3987606019652
+-3.3961711314384337, 67.89703312481406
+-3.9171800411864077, 58.274848581641244
+-4.474135356206521, 49.00698472026296
+-5.33651284935522, 37.60210134150349
+-6.234806181104906, 28.851659212019467
+-6.899539578599139, 23.77405069196879
+-7.420533205011537, 20.61401449165911
+-7.833733465614243, 18.428731556346158
+-8.408600849928126, 15.979443625859725
+-8.911621273704453, 13.997414082608053
+-9.73800651157429, 11.301668918981136
+-10.366778220460809, 9.601907884574093
+-11.390761703978386, 7.44322516629963
+-12.12731913700681, 6.16477393935167
+-13.348954357846642, 4.427188381990717
+-14.283163528197324, 3.39696619707388
+-14.750275755040448, 2.9604540090919
+-15.738427458302699, 2.1696900414974514
+-16.4031761391325, 1.7697057008847887
+-16.942158251516545, 1.503504188519591
+-17.175702902436427, 1.414360002817215
+-17.696864645540153, 1.0962256484466144
+-18.182064700036157, 0.8760371345423558
+-18.61336042995953, 0.7144902852511762
diff --git a/Workspace/CumNumOfSat/data/Nadler_rawt2.txt b/Workspace/CumNumOfSat/data/Nadler_rawt2.txt
new file mode 100644
index 0000000..aa9429f
--- /dev/null
+++ b/Workspace/CumNumOfSat/data/Nadler_rawt2.txt
@@ -0,0 +1,31 @@
+0.10736543241359664, 216.92909796947924
+-0.772893563357723, 175.15373305848743
+-1.4016499889086655, 150.3361378422536
+-1.7070721670372522, 137.164174385748
+-2.407736686468048, 111.8790043910375
+-2.8209522304063275, 99.00392750126227
+-3.1982366524080432, 88.50763688193487
+-3.6114674796818984, 77.52745714463104
+-4.22231183593907, 64.53720444465644
+-5.0846893290877695, 49.51813533677612
+-6.018913782774023, 37.60957876509523
+-6.881260709251572, 29.451720834538754
+-7.563936742710723, 24.517397859242784
+-7.977121719977854, 22.142990713584638
+-8.749617916610628, 18.06147718972997
+-9.93531437384611, 13.170526087745108
+-11.067075939837807, 10.003737951618941
+-11.58805428291463, 8.762958114073074
+-12.342592560246912, 7.1476857835436665
+-13.007310674405568, 5.950135822268837
+-13.654040302592584, 5.055267096015819
+-14.462467621161924, 4.081657921166878
+-15.055338774783024, 3.4325587382106755
+-15.59430560383149, 2.9461211806963674
+-15.827850254751375, 2.7714428687641
+-16.45662196363789, 2.354620306434503
+-17.031489347951773, 2.041677276156202
+-17.318953606779864, 1.8627824062862914
+-17.84002364987014, 1.5348867545187164
+-18.23532712451465, 1.3173184889912688
+-18.684550207067367, 1.0965411766880875
diff --git a/Workspace/CumNumOfSat/data/Readme b/Workspace/CumNumOfSat/data/Readme
new file mode 100644
index 0000000..aaa433f
--- /dev/null
+++ b/Workspace/CumNumOfSat/data/Readme
@@ -0,0 +1,24 @@
+
+curved obtained from Drlica wagner and
+
+https://apps.automeris.io/wpd/
+
+
+Official data:
+
+mw-sats-1.0.tar.gz
+mw-sats-data.tar.gz
+mw_sats_master.csv
+
+
+Hi Yves
+
+I've uploaded a csv file (mw-sats-master.csv) corresponding to the input used to generate Table 2 of the paper:
+https://github.com/des-science/mw-sats/releases/tag/v1.0
+
+The "Classification" column in Table 2 of the paper maps onto the `type` column in this data file. There are some objects that are classified as star clusters (type=0) and were not included in the table in the paper. Note that we can also provide the TS, SIG, and PDet values in Tables 3 & 4, but we need to think a little bit about exactly how we want to distribute this (I've cc'd Mitch so that he is in the loop).
+
+I've also uploaded the files I was using to over plot the Newton and Nadler functions. Note that the columns are different in each of these files, and that the faint limit of the Nadler file has been extended from Mv = 0 to Mv = 0.1 to match the range of observed dwarfs.
+
+Best,
+Alex
diff --git a/Workspace/CumNumOfSat/data/mw-sats-1.0.tar.gz b/Workspace/CumNumOfSat/data/mw-sats-1.0.tar.gz
new file mode 100644
index 0000000..6c2818b
Binary files /dev/null and b/Workspace/CumNumOfSat/data/mw-sats-1.0.tar.gz differ
diff --git a/Workspace/CumNumOfSat/data/mw-sats-data.tar.gz b/Workspace/CumNumOfSat/data/mw-sats-data.tar.gz
new file mode 100644
index 0000000..ac45d53
Binary files /dev/null and b/Workspace/CumNumOfSat/data/mw-sats-data.tar.gz differ
diff --git a/Workspace/CumNumOfSat/data/mw_sats_master.csv b/Workspace/CumNumOfSat/data/mw_sats_master.csv
new file mode 100644
index 0000000..7fb3fff
--- /dev/null
+++ b/Workspace/CumNumOfSat/data/mw_sats_master.csv
@@ -0,0 +1,77 @@
+key,name,abbreviation,other_name,type,type2,survey,category,ra,dec,distance_modulus,distance_kpc,ellipticity,a_h,r_physical,m_v,velocity_dispersion,surface_brightness,structure_ref,distance_ref,kinematics_ref
+am_1,AM 1,AM 1,,0,0,ps1,classical,58.7608,-49.6152,20.45,123.3,0.07,0.45,15.010137,-5.03,nan,24.4225364,2018ApJ...860...66M,,
+antlia_2,Antlia II,Ant II,,4,4,,gaia,143.8868,-36.7673,20.6,131.8256739,0.38,76.2,2300.789747,-9.03,nan,31.3497774,2019MNRAS.488.2743T,2019MNRAS.488.2743T,
+aquarius_2,Aquarius II,Aqr II,,4,5,ps1,atlas,338.4813,-9.3274,20.16,107.6465214,0.39,5.1,124.7272109,-4.4,5.4,29.6504182,2016MNRAS.463..712T,2016MNRAS.463..712T,2016MNRAS.463..712T
+bootes_1,Bootes I,Boo I,,4,5,ps1,sdss,210.02,14.5135,19.1,66.0693448,0.3,9.97,160.3135737,-6.02,4.6,28.5754604,2018ApJ...860...66M,2012ApJ...744...96O,2011ApJ...736..146K
+bootes_2,Bootes II,Boo II,,4,5,ps1,sdss,209.5141,12.8553,18.1,41.68693835,0.25,3.17,33.29016986,-2.94,10.5,28.2421928,2018ApJ...860...66M,2008ApJ...688..245W,2009ApJ...690..453K
+bootes_3,Bootes III,Boo III,,4,4,ps1,sdss,209.3,26.8,18.35,46.77351413,0.5,30,288.6239554,-5.75,14,30.1222475,2009ApJ...693.1118G,arXiv:1204.1562,2012AJ....144....4M
+bootes_4,Bootes IV,Boo IV,,3,3,ps1,hsc,233.689,43.726,21.6,208.9296131,0.64,7.6,277.1347336,-4.53,nan,31.2540667,2019PASJ..tmp...91H,2019PASJ..tmp...91H,None
+canis_major_1,Canis Major,CMa,,0,0,ps1,classical,108.1458333,-27.66666667,14.29,7.211074792,nan,nan,nan,-14.39,nan,nan,2012AJ....144....4M,arXiv:1204.1562,
+canes_venatici_1,Canes Venatici I,CVn I,,4,5,ps1,sdss,202.0091,33.5521,21.69,217.7709772,0.44,7.12,337.5204756,-8.8,7.6,27.412112,2018ApJ...860...66M,2008ApJ...674L..81K,2007ApJ...670..313S
+canes_venatici_2,Canes Venatici II,CVn II,SDSS J1257+3419,4,5,ps1,sdss,194.2927,34.3226,21.02,159.9558029,0.4,1.52,54.78293934,-5.17,14.6,27.0938397,2018ApJ...860...66M,2008ApJ...675L..73G,2007ApJ...670..313S
+carina_1,Carina,Car,,4,5,,classical,100.4065,-50.9593,20.106,105,0.36,10.1,248.1632556,-9.43,6.44,26.1142965,2018ApJ...860...66M,2018ApJ...860...66M,2009AJ....137.3100W
+carina_2,Carina II,Car II,,4,5,,maglites,114.1066,-57.9991,17.79,36.14098626,0.34,8.69,76.79233291,-4.5,3.4,28.4971992,2018MNRAS.475.5085T,2018MNRAS.475.5085T,2018ApJ...857..145L
+carina_3,Carina III,Car III,,4,4,,maglites,114.6298,-57.8997,17.22,27.79713268,0.55,3.75,20.34059449,-2.4,5.6,27.712431,2018MNRAS.475.5085T,2018MNRAS.475.5085T,2018ApJ...857..145L
+centaurus_1,Centaurus I,Cen I,,3,3,,delve,189.585,-40.902,20.33,116.4126029,0.4,2.9,76.06760456,-5.55,nan,27.4266116,arXiv:1912.03301,arXiv:1912.03301,
+cetus_2,Cetus II,Cet II,DES J0117-1725,3,3,ps1 des,des,19.47,-17.42,17.38,29.92264637,nan,1.9,16.5378755,0.0,nan,29.6830115,2015ApJ...813..109D,2015ApJ...813..109D,None
+cetus_3,Cetus III,Cet III,,3,3,ps1 des,hsc,31.331,-4.27,22,251.1886432,0.76,1.23,44.02880005,-2.5,nan,29.2892974,2018PASJ...70S..18H,2018PASJ...70S..18H,None
+columba_1,Columba I,Col I,DES J0531-2801,3,3,ps1 des,des,82.86,-28.01,21.31,182.8100216,0.3,2.2,97.88086936,-4.2,nan,29.324102,2017AJ....154..267C,2017AJ....154..267C,None
+coma_berenices,Coma Berenices,Com,,4,5,ps1,sdss,186.7454,23.9069,18.22,44.05548635,0.37,5.64,57.36876436,-4.38,nan,27.9839894,2018ApJ...860...66M,2009ApJ...695L..83M,
+crater_2,Crater II,Crt II,,4,4,ps1,atlas,177.31,-18.413,20.35,117.4897555,nan,31.2,1066.303197,-8.2,2.7,30.5099571,2016MNRAS.459.2370T,2016MNRAS.459.2370T,2017ApJ...839...20C
+des_sag_1,DES J0111-1341,DESJ0111,DES 2,0,0,des,des,17.7929,-13.6848,17.12,26.54605562,0.27,0.59,3.892598034,0.3,nan,26.8218109,2017MNRAS.468...97L,2017MNRAS.468...97L,None
+des_sag_2,DES J0225+0304,DESJ0225,,1,1,des,des,36.4267,3.0695,16.88,23.76840287,0.61,2.68,11.57159472,-1.1,nan,27.7875791,2017MNRAS.468...97L,2017MNRAS.468...97L,None
+draco_1,Draco,Dra,UGC 10822; DDO 208,4,5,ps1,classical,260.0684,57.9185,19.4,75.8577575,0.29,9.67,179.7967204,-8.71,9.12,26.1345179,2018ApJ...860...66M,2004AJ....127..861B,2015MNRAS.448.2717W
+draco_2,Draco II,Dra II,Laevens 4,3,3,ps1,ps1,238.174,64.579,16.67,21.57744409,0.23,3,16.52314578,-0.8,2.9,28.8610764,2018MNRAS.480.2609L,2018MNRAS.480.2609L,2016MNRAS.458L..59M
+eridanus,Eridanus,Eri,,0,0,ps1,,66.1853,-21.1876,19.77,90.1,0.09,0.64,15.26413767,-4.93,nan,24.5589745,2018ApJ...860...66M,2018ApJ...860...66M,
+eridanus_2,Eridanus II,Eri II,DES J0222.7-5217,4,5,des,des,56.0925,-43.5329,22.9,380.1893963,0.35,1.77,157.817828,-7.21,6.9,27.3513933,2018ApJ...860...66M,2016ApJ...824L..14C,2017ApJ...838....8L
+eridanus_3,Eridanus III,Eri III,DES J0222.7-5217,0,0,des,des,35.6952,-52.2838,19.7,87.096359,0.58,0.3,4.925746043,-2.37,nan,24.6629732,2018ApJ...860...66M,arXiv:1204.1562,None
+fornax_1,Fornax,For,,4,5,des,classical,39.9583,-34.4997,20.84,147.2312502,0.29,19.6,707.3125484,-13.46,10.59,24.3586533,2018ApJ...860...66M,2009AJ....138..459P,2009AJ....137.3100W
+gaia_1,Gaia 1,Gaia1,,0,0,des,gaia,101.47,-16.75,13.3,4.570881896,nan,6.5,8.642501704,-5,nan,23.2538079,2017MNRAS.470.2702K,2017MNRAS.470.2702K,None
+gaia_2,Gaia 2,Gaia2,,0,0,des,gaia,28.124,53.04,13.65,5.370317964,0.18,1.9,2.626555877,-2,nan,23.6675462,2017MNRAS.470.2702K,2017MNRAS.470.2702K,None
+grus_1,Grus I,Gru I,,3,3,des,des,344.1797,-50.18,20.4,120.2264435,0.45,0.81,21.00837596,-3.47,-9999,26.7125755,2018ApJ...860...66M,2015ApJ...805..130K,2016ApJ...819...53W
+grus_2,Grus II,Gru II,DES J2204-4626,3,3,des,des,331.02,-46.44,18.62,52.96634439,nan,6,92.44371023,-3.9,nan,29.4999978,2015ApJ...813..109D,2015ApJ...813..109D,None
+hercules,Hercules,Her,,4,5,ps1,sdss,247.7722,12.7852,20.6,131.8256739,0.69,5.63,120.2030144,-5.83,nan,28.1401894,2018ApJ...860...66M,2012ApJ...756..121M,
+horologium_1,Horologium I,Hor I,DES J0255.4-5406,4,4,des,des,43.8813,-54.116,19.488,78.99507213,0.27,1.59,31.2165333,-3.55,4.9,27.4925364,2018ApJ...860...66M,2015ApJ...805..130K,2015ApJ...811...62K
+horologium_2,Horologium II,Hor II,,3,3,des,des,49.1077,-50.0486,19.46,77.98301105,0.52,2.09,32.84679666,-2.6,nan,28.5530781,2015ApJ...808L..39K,2015ApJ...808L..39K,None
+hydra_1,Hydra I,Hyd I,,0,0,ps1,,133.9,3.6,15.52,12.70574105,nan,nan,nan,-2.5,8.4,nan,2016ApJ...818...39H,2016ApJ...818...39H,2016ApJ...818...39H
+hydra_2,Hydra II,Hyd II,Hydra 2,3,3,,smash,185.4251,-31.986,20.89,150.6607066,0.24,1.52,58.07329945,-4.6,4.5,27.7904956,2018ApJ...860...66M,2016AJ....151..118V,2015ApJ...810...56K
+hydrus_1,Hydrus I,Hyi I,,4,5,,decam,37.389,-79.3089,17.2,27.54228703,0.21,7.42,52.83765905,-4.71,2.69,27.4753283,2018MNRAS.479.5343K,2018MNRAS.479.5343K,2018arXiv180406430K
+indus_2,Indus II,Ind II,DES J2038-4609,1,1,des,des,309.72,-46.16,21.65,213.796209,nan,2.9,180.3533091,-4.3,nan,30.5512332,2015ApJ...813..109D,2015ApJ...813..109D,None
+kim_1,Kim 1,Kim 1,,0,0,ps1,,332.9214,7.0271,16.48,19.7696964,0.59,1.09,4.013696627,0.73,nan,27.3183358,2018ApJ...860...66M,2018ApJ...860...66M,None
+indus_1,Kim 2,Kim 2,Indus I; DES J2108.8-5109,2,2,des,,317.202,-51.1671,20,100,0.32,0.48,12.05651556,-3.32,nan,25.6567222,2018ApJ...860...66M,2015ApJ...803...63K,None
+koposov_1,Koposov 1,Kop 1,,0,0,ps1,sdss,179.8253,12.2615,18.5,50.11872336,0.45,0.62,6.703461994,-1.04,nan,26.6621089,2018ApJ...860...66M,2007ApJ...669..337K,None
+koposov_2,Koposov 2,Kop 2,,0,0,ps1,sdss,119.5715,26.2574,18,39.81071706,0.43,0.44,3.846947164,-0.92,nan,25.5761943,2018ApJ...860...66M,2007ApJ...669..337K,None
+crater_1,Laevens 1,Lae I,Crater I,2,2,ps1,,174.0668,-10.8772,20.807,145.0106836,0.17,0.51,19.71675044,-4.8,2.04,25.2447898,2018ApJ...860...66M,2018ApJ...860...66M,2016MNRAS.460.3384V
+laevens_3,Laevens 3,Lae 3,,0,0,ps1,,316.7263,14.98,19.14,67.29766563,0.21,0.4,6.959846386,-4.4,nan,23.3836114,2015ApJ...813...44L,2015ApJ...813...44L,None
+lmc,LMC,LMC,Large Magellanic Cloud,4,5,,classical,80.89375,-69.75611111,18.4935,49.968924,0.148862,323,4735,-18.12,20.2,23.39,2014A&A...570A..13M,2013Natur.495...76P,2012AJ....144....4M
+leo_1,Leo I,Leo I,UGC 5470; DDO 74; Regulus Dwarf,4,5,ps1,classical,152.1146,12.3059,22.024,253.9802814,0.3,3.65,225.6150163,-11.78,9.2,23.5574526,2018ApJ...860...66M,2014PASP..126..616S,2008ApJ...675..201M
+leo_2,Leo II,Leo II,Leo B; UGC 6253; DDO 93,4,5,ps1,classical,168.3627,22.1529,21.84,233.3458062,0.07,2.52,164.9560058,-9.74,7.4,24.9174535,2018ApJ...860...66M,2005MNRAS.360..185B,2017ApJ...836..202S
+leo_4,Leo IV,Leo IV,,4,5,ps1,sdss,173.2405,-0.5453,20.94,154.1700453,0.17,2.54,103.7764667,-4.99,3.3,28.6611072,2018ApJ...860...66M,2009ApJ...699L.125M,2007ApJ...670..313S
+leo_5,Leo V,Leo V,,4,5,ps1,sdss,172.7857,2.2194,21.25,177.827941,0.43,1,39.05382223,-4.4,3.7,27.1289309,2018ApJ...860...66M,2018ApJ...860...66M,2012AJ....144....4M
+munoz_1,Munoz 1,Mun1,,0,0,ps1,,225.449,66.9682,18.266,44.99870339,0.34,0.49,5.220284413,-0.49,4.7,26.669084,2018ApJ...860...66M,2018ApJ...860...66M,2012ApJ...753L..15M
+pegasus_3,Pegasus III,Peg III,,4,5,ps1,sdss,336.102,5.405,21.66,214.7830474,0.38,0.85,41.81584599,-3.4,5.4,28.2899449,2016ApJ...833...16K,2016ApJ...833...16K,2016ApJ...833...16K
+phoenix_2,Phoenix II,Phe II,DES J2339.9-5424,4,5,des,des,354.996,-54.4115,19.595,82.98507675,0.67,1.49,20.66185719,-3.3,nan,26.8464599,2018ApJ...860...66M,2018arXiv180408627M,None
+pictor_1,Pictor I,Pic I,DES J0443.8-5017,3,3,des,des,70.949,-50.2854,20.28,113.7627286,0.63,0.88,17.71371494,-3.45,nan,26.3621614,2018ApJ...860...66M,2015ApJ...805..130K,None
+pictor_2,Pictor II,Pic II,,3,3,,maglites,101.18,-59.897,18.3,45.70881896,0.13,3.8,47.1269507,-3.2,nan,28.7369591,2016ApJ...833L...5D,2016ApJ...833L...5D,None
+pisces_2,Pisces II,Psc II,,4,5,ps1,sdss,344.6345,5.9526,21.3,181.9700859,0.34,1.12,48.16328579,-4.22,5.4,27.7641936,2018ApJ...860...66M,2012ApJ...756...79S,2015ApJ...810...56K
+reticulum_2,Reticulum II,Ret II,DES J0335.6-5403,4,5,des,des,53.9203,-54.0513,17.4,30.1995172,0.58,5.52,31.42605311,-3.88,3.3,27.1770616,2018ApJ...860...66M,2018arXiv180408627M,2015ApJ...808...95S
+reticulum_3,Reticulum III,Ret III,DES J0345-6026,3,3,des,des,56.36,-60.45,19.81,91.62204901,nan,2.4,63.96425691,-3.3,nan,29.2902996,2015ApJ...813..109D,2015ApJ...813..109D,None
+sagittarius,Sagittarius,Sgr,,4,5,,classical,283.83125,-30.545278,17.1,26.30267992,0.64,342,1565,-13.5,nan,26.0406263,2012AJ....144....4M,arXiv:1204.1562,
+sagittarius_2,Sagittarius II,Sgr II,Laevens 5,4,5,ps1,ps1,298.1647083,-22.0650528,19.2,69.18309709,nan,1.6,32.19927549,-5.2,nan,25.9098435,2018ApJ...863...25M,2018ApJ...863...25M,2019arXiv190202780L
+sculptor_1,Sculptor,Scl,,4,5,des,classical,15.0183,-33.7186,19.62,83.94599865,0.33,11.17,223.2629669,-10.82,8.8,24.4946915,2018ApJ...860...66M,2015MNRAS.454.1509M,2009AJ....137.3100W
+segue_1,Segue 1,Seg 1,,4,4,ps1,sdss,151.7504,16.0756,16.8,22.90867653,0.33,3.62,19.74567975,-1.3,3.7,28.7479731,2018ApJ...860...66M,arXiv:1204.1562,2011ApJ...733...46S
+segue_2,Segue 2,Seg 2,,3,3,ps1,sdss,34.8226,20.1624,17.72,34.9945167,0.22,3.76,33.80346842,-1.86,-9999,29.3554188,2018ApJ...860...66M,2013AJ....146...94B,2013ApJ...770...16K
+segue_3,Segue 3,Seg 3,,0,0,ps1,,320.3795,19.1178,17.16,27.03958364,0.23,0.49,3.381952938,-0.87,1.2,25.3464509,2018ApJ...860...66M,2018ApJ...860...66M,2011AJ....142...88F
+sextans_1,Sextans,Sex,,4,4,ps1,classical,153.2628,-1.6133,19.67,85.90135215,0.3,16.5,344.9523289,-8.72,7.09,27.5393969,2018ApJ...860...66M,2017MNRAS.467..208O,2009AJ....137.3100W
+smc,SMC,SMC,Small Magellanic Cloud,4,4,,classical,13.18666667,-72.82861111,18.965,62.0869,0.3974,151,2728,-17.18,27.6,23.56,2014A&A...570A..13M,2014ApJ...780...59G,2012AJ....144....4M
+smash_1,SMASH 1,SMASH1,,0,0,,,95.2496,-80.3966,18.8,57.54399373,0.62,0.57,5.881563242,-1,nan,26.418077,2016ApJ...830L..10M,2016ApJ...830L..10M,None
+triangulum_2,Triangulum II,Tri II,Laevens 2,3,3,ps1,ps1,33.3252,36.1702,17.39,30.06076303,0.46,1.99,12.78721813,-1.6,-9999,27.5044934,2018ApJ...860...66M,2017AJ....154..267C,2017ApJ...838...83K
+tucana_2,Tucana II,Tuc II,DES J2251.2-5836,4,4,des,des,342.9796,-58.5689,18.8,57.54399373,0.39,12.586,164.5427541,-3.8,8.6,30.8520011,2015ApJ...805..130K,2015ApJ...805..130K,2016ApJ...819...53W
+tucana_3,Tucana III,Tuc III,DES J2356-5935,3,3,des,des,359.15,-59.6,17.01,25.23480772,0,6,44.04304809,-2.4,-9999,29.3899978,2015ApJ...813..109D,2015ApJ...813..109D,2017ApJ...838...11S
+tucana_4,Tucana IV,Tuc IV,DES J0002-6051,4,5,des,des,0.73,-60.85,18.41,48.08393484,0.4,11.8,127.8450006,-3.5,nan,30.6040268,2015ApJ...813..109D,2015ApJ...813..109D,None
+tucana_5,Tucana V,Tuc V,DES J2337-6316,3,3,des,des,354.35,-63.27,18.71,55.20774393,0.7,1.8,15.83285556,-1.6,nan,27.9684094,2015ApJ...813..109D,2015ApJ...813..109D,None
+ursa_major_1,Ursa Major I,UMa I,,4,5,ps1,sdss,158.7706,51.9479,19.94,97.27472238,0.59,8.31,150.5632807,-5.12,7.6,29.3392068,2018ApJ...860...66M,2013ApJ...767...62G,2007ApJ...670..313S
+ursa_major_2,Ursa Major II,UMa II,,4,5,ps1,sdss,132.8726,63.1335,17.53,32.06269325,0.56,13.8,85.37516221,-4.25,6.7,28.9772657,2018ApJ...860...66M,2012ApJ...752...42D,2007ApJ...670..313S
+ursa_minor_1,Ursa Minor,UMi,UGC 9749; DDO 199,4,5,ps1,classical,227.242,67.2221,19.41,76.207901,0.55,18.3,272.1344127,-9.03,9.4,26.7145213,2018ApJ...860...66M,2002AJ....124.3222B,None
+virgo_1,Virgo I,Vir I,,3,3,ps1,hsc,180.038,-0.681,19.8,91.20108394,0.59,1.76,29.89721354,-0.33,nan,30.6187667,2018PASJ...70S..18H,2018PASJ...70S..18H,None
+willman_1,Willman 1,Wil 1,SDSSJ1049+5103,4,4,ps1,sdss,162.3436,51.0501,17.9,38.01893963,0.47,2.51,20.20867193,-2.53,4,27.5683018,2018ApJ...860...66M,2005AJ....129.2692W,2011AJ....142..128W
\ No newline at end of file
diff --git a/Workspace/CumNumOfSat/sales2022/MsMh_high_1.txt b/Workspace/CumNumOfSat/sales2022/MsMh_high_1.txt
new file mode 100644
index 0000000..2e22bfd
--- /dev/null
+++ b/Workspace/CumNumOfSat/sales2022/MsMh_high_1.txt
@@ -0,0 +1,10 @@
+8.0102564 3.32967032967
+8.2666666 3.74411302982
+8.4256410 4.25274725274
+8.6410256 4.71428571428
+8.8051282 5.25117739403
+9.2358974 6.02354788069
+9.6256410 6.58869701726
+9.9179487 7.13500784929
+10.220512 7.73783359497
+11 9
diff --git a/Workspace/CumNumOfSat/sales2022/MsMh_high_2.txt b/Workspace/CumNumOfSat/sales2022/MsMh_high_2.txt
new file mode 100644
index 0000000..27f1abd
--- /dev/null
+++ b/Workspace/CumNumOfSat/sales2022/MsMh_high_2.txt
@@ -0,0 +1,9 @@
+7.989743589 5.2982731554160125
+8.256410256 5.609105180533752
+8.528205128 5.938775510204082
+8.856410256 6.390894819466248
+9.246153846 6.861852433281005
+9.738461538 7.408163265306123
+10.10769230 7.756671899529042
+10.36923076 8.048665620094193
+11 9
diff --git a/Workspace/CumNumOfSat/sales2022/MsMh_high_3.txt b/Workspace/CumNumOfSat/sales2022/MsMh_high_3.txt
new file mode 100644
index 0000000..a17c3e1
--- /dev/null
+++ b/Workspace/CumNumOfSat/sales2022/MsMh_high_3.txt
@@ -0,0 +1,9 @@
+7.969230769230769 4.987441130298274
+8.307692307692308 5.467817896389326
+8.76923076923077 6.287284144427002
+9.169230769230769 7.125588697017269
+9.328205128205129 7.718995290423862
+9.687179487179488 8.293563579277865
+10.03076923076923 8.773940345368917
+10.34871794871795 9.188383045525903
+11 10
diff --git a/Workspace/CumNumOfSat/sales2022/MsMh_high_4.txt b/Workspace/CumNumOfSat/sales2022/MsMh_high_4.txt
new file mode 100644
index 0000000..601b57d
--- /dev/null
+++ b/Workspace/CumNumOfSat/sales2022/MsMh_high_4.txt
@@ -0,0 +1,9 @@
+7.99547511312 5.80939226519337
+8.62895927601 6.596685082872929
+8.94117647058 6.928176795580111
+9.31221719457 7.417127071823205
+9.70588235294 7.997237569060774
+9.94570135746 8.42817679558011
+10.2398190045 8.85082872928177
+10.4977375565 9.290055248618785
+11 10
diff --git a/Workspace/CumNumOfSat/sales2022/MsMh_low_1.txt b/Workspace/CumNumOfSat/sales2022/MsMh_low_1.txt
new file mode 100644
index 0000000..6aee599
--- /dev/null
+++ b/Workspace/CumNumOfSat/sales2022/MsMh_low_1.txt
@@ -0,0 +1,8 @@
+8.01025641025641 1.9544740973312393
+8.34871794871795 2.208791208791209
+8.92820512820512 2.8587127158555727
+9.24615384615384 3.4992150706436425
+9.77948717948718 4.233908948194663
+10.1487179487179 5.185243328100471
+10.3435897435897 6.324960753532182
+11 8.2
diff --git a/Workspace/CumNumOfSat/sales2022/MsMh_low_2.txt b/Workspace/CumNumOfSat/sales2022/MsMh_low_2.txt
new file mode 100644
index 0000000..8115858
--- /dev/null
+++ b/Workspace/CumNumOfSat/sales2022/MsMh_low_2.txt
@@ -0,0 +1,10 @@
+7.953846153 1.9167974
+8.369230769 2.3124018
+8.820512820 2.8587127
+9.2 3.4050235
+9.615384615 4.1114599
+10.05641025 4.9497645
+10.13846153 5.5714285
+10.32307692 6.7111459
+10.53846153 7.3893249
+11 8.2
diff --git a/Workspace/CumNumOfSat/sales2022/MsMh_low_3.txt b/Workspace/CumNumOfSat/sales2022/MsMh_low_3.txt
new file mode 100644
index 0000000..940acff
--- /dev/null
+++ b/Workspace/CumNumOfSat/sales2022/MsMh_low_3.txt
@@ -0,0 +1,10 @@
+7.953846153 1.9167974
+8.369230769 2.3124018
+8.820512820 2.8587127
+9.2 3.4050235
+9.615384615 4.1114599
+10.05641025 4.9497645
+10.13846153 5.5714285
+10.32307692 6.7111459
+10.53846153 7.3893249
+11. 8.2
diff --git a/Workspace/CumNumOfSat/sales2022/MsMh_low_4.txt b/Workspace/CumNumOfSat/sales2022/MsMh_low_4.txt
new file mode 100644
index 0000000..743f51e
--- /dev/null
+++ b/Workspace/CumNumOfSat/sales2022/MsMh_low_4.txt
@@ -0,0 +1,9 @@
+7.97285067873303 1.9475138121546962
+8.25339366515837 2.3784530386740332
+8.66968325791855 3.2569060773480674
+9.02714932126696 4.0773480662983435
+9.51583710407239 4.947513812154696
+9.99095022624434 5.850828729281768
+10.1945701357466 6.488950276243094
+10.4343891402714 7.383977900552487
+11. 8.2
diff --git a/Workspace/CumNumOfSat/satComputeMstarvsMhalo.py b/Workspace/CumNumOfSat/satComputeMstarvsMhalo.py
new file mode 100755
index 0000000..3ce29b7
--- /dev/null
+++ b/Workspace/CumNumOfSat/satComputeMstarvsMhalo.py
@@ -0,0 +1,114 @@
+#!/usr/bin/env python3
+
+import sys,os,string
+
+import argparse
+import satlib
+import numpy as np
+import Ptools as pt
+import pickle
+from scipy.interpolate import splrep,splev
+
+####################################################################
+# option parser
+####################################################################
+
+description=""
+epilog =""""""
+
+parser = argparse.ArgumentParser(description=description,epilog=epilog,formatter_class=argparse.RawDescriptionHelpFormatter)
+
+
+
+parser.add_argument("--LvvsMh_model",
+ action="store",
+ type=str,
+ dest="LvvsMh_model",
+ default = None,
+ help="Lv Mh model")
+
+
+parser.add_argument("-p",
+ action="store",
+ dest="ps",
+ metavar='FILE NAME',
+ type=str,
+ default=None,
+ help='output file name')
+
+parser.add_argument("--dpi",
+ action="store",
+ dest="dpi",
+ type=float,
+ default=300,
+ help="DPI of the saved file",
+ metavar=" FLOAT")
+
+
+
+
+####################################################################
+# main
+####################################################################
+
+
+def MakePlot(opt):
+
+
+
+ # get Mh vs Lv relation
+ Mhbins,Lvmins,Lvmaxs = satlib.GetStellarMassHaloMassRelation(model=opt.LvvsMh_model)
+
+ ax = pt.gca()
+ ax.fill_between(Mhbins,Lvmins,Lvmaxs,facecolor='orange',alpha=0.5,label=r"$\textrm{model=%s}$"%opt.LvvsMh_model)
+
+ #pt.plot(Mhbins,Lvmins)
+ #pt.plot(Mhbins,Lvmaxs)
+
+ ###########################
+ # finalize
+ ###########################
+
+ xmin = 1e8
+ xmax = 1e11
+ ymin = 1e2
+ ymax = 1e10
+
+ xlabel = r"$\rm{Halo\,\,Mass\,\,(M_{\rm halo})}\,\,[M_{\odot}]$"
+ ylabel = r"$\rm{Stellar\,\,Mass\,\,(M_{\star})}\,\,[M_{\odot}]$"
+
+ pt.SetAxis(xmin,xmax,ymin,ymax,log="xy")
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+ pt.grid(False)
+
+ pt.legend()
+
+ pt.title(r"$\textrm{model=%s}$"%opt.LvvsMh_model,fontsize=pt.labelfont)
+
+
+if __name__ == '__main__':
+
+ opt = parser.parse_args()
+ files = []
+
+ pt.InitPlot(files, opt)
+ pt.labelfont=20
+
+ # pt.figure(figsize=(8*2,6*2))
+ # pt.figure(dpi=10)
+
+ #fig = pt.gcf()
+ # fig.subplots_adjust(left=0.1)
+ # fig.subplots_adjust(right=1)
+ # fig.subplots_adjust(bottom=0.12)
+ # fig.subplots_adjust(top=0.95)
+ # fig.subplots_adjust(wspace=0.25)
+ # fig.subplots_adjust(hspace=0.02)
+
+ MakePlot(opt)
+ pt.EndPlot(files, opt)
+
+
+
+
diff --git a/Workspace/CumNumOfSat/satComputeNCum.py b/Workspace/CumNumOfSat/satComputeNCum.py
new file mode 100755
index 0000000..64641fe
--- /dev/null
+++ b/Workspace/CumNumOfSat/satComputeNCum.py
@@ -0,0 +1,180 @@
+#!/usr/bin/env python3
+
+import sys,os,string
+
+import argparse
+import satlib
+import numpy as np
+import Ptools as pt
+import pickle
+from scipy.interpolate import splrep,splev
+
+####################################################################
+# option parser
+####################################################################
+
+description=""
+epilog =""""""
+
+parser = argparse.ArgumentParser(description=description,epilog=epilog,formatter_class=argparse.RawDescriptionHelpFormatter)
+
+
+
+parser.add_argument("--Mmin",
+ action="store",
+ dest="Mmin",
+ metavar='FLOAT',
+ type=float,
+ default=5e7,
+ help='the min halo mass')
+
+
+parser.add_argument("--Mmax",
+ action="store",
+ dest="Mmax",
+ metavar='FLOAT',
+ type=float,
+ default=1e10,
+ help='the max halo mass')
+
+parser.add_argument("-N",
+ action="store",
+ dest="N",
+ metavar='INT',
+ type=int,
+ default=1000,
+ help='number of bins')
+
+
+parser.add_argument("--Ngal",
+ action="store",
+ dest="Ngal",
+ metavar='INT',
+ type=int,
+ default=100,
+ help='number of galaxies')
+
+
+
+####################################################################
+# main
+####################################################################
+
+
+opt = parser.parse_args()
+
+
+# halo bins
+lnMh = np.linspace(np.log10(opt.Mmin),np.log10(opt.Mmax),opt.N)
+Mh0 = 10**lnMh
+
+# cumulative number of haloes
+NM_CDM = satlib.CDM_CumulativeMass(Mh0)
+NM_WDM = satlib.fctWDM_CumulativeMass(Mh0)
+
+
+pt.plot(Mh0,NM_WDM)
+pt.plot(Mh0,NM_CDM)
+
+
+
+# define the CDM sampling function
+fct_CDM_Sample = np.vectorize( lambda x: 10**np.interp(x, NM_CDM[::-1]/NM_CDM.max(), np.log10(Mh0[::-1])) )
+maxCDM = (NM_CDM/NM_CDM.max()).min()
+
+# define the WDM sampling function
+fct_WDM_Sample = np.vectorize( lambda x: 10**np.interp(x, NM_WDM[::-1]/NM_WDM.max(), np.log10(Mh0[::-1])) )
+maxWDM = (NM_WDM/NM_WDM.max()).min()
+
+
+
+# number of haloes for the CDM
+Nh_CDM = int(satlib.CDM_CumulativeMass(opt.Mmin))
+
+# number of haloes for the WDM
+Nh_WDM = int(satlib.fctWDM_CumulativeMass(opt.Mmin))
+
+
+Nb = 100
+
+Ncs_CDM = np.zeros((opt.Ngal,Nb-1))
+Ncs_WDM = np.zeros((opt.Ngal,Nb-1))
+
+
+for j in range(opt.Ngal):
+
+ print(j)
+
+ # generate N haloes for the CDM
+ Mhs = fct_CDM_Sample(np.random.random(Nh_CDM))
+ lnm = np.log10(Mhs)
+ # do the histogram
+ logMh = np.linspace(np.log10(opt.Mmin),10,Nb)
+ n, bins = np.histogram(lnm, logMh)
+ Ms = 10**bins
+ dM = Ms[1:]-Ms[:-1]
+ dNdM = n/dM
+ Nc_CDM = np.add.accumulate(np.flip(n,0))
+ Nc_CDM = np.flip(Nc_CDM,0)
+
+
+ # generate N haloes for the WDM
+ Mhs = fct_WDM_Sample(np.random.random(Nh_WDM))
+ lnm = np.log10(Mhs)
+ # do the histogram
+ logMh = np.linspace(np.log10(opt.Mmin),10,Nb)
+ n, bins = np.histogram(lnm, logMh)
+ Ms = 10**bins
+ dM = Ms[1:]-Ms[:-1]
+ dNdM = n/dM
+ Nc_WDM = np.add.accumulate(np.flip(n,0))
+ Nc_WDM = np.flip(Nc_WDM,0)
+ Ncs_CDM[j] = Nc_CDM
+ Ncs_WDM[j] = Nc_WDM
+
+
+# mean
+Nc_CDM_mean = Ncs_CDM.mean(axis=0)
+Nc_WDM_mean = Ncs_WDM.mean(axis=0)
+
+# std
+Nc_CDM_std = Ncs_CDM.std(axis=0)
+Nc_WDM_std = Ncs_WDM.std(axis=0)
+
+
+
+pt.plot(Ms[1:],Nc_CDM_mean,'k')
+pt.plot(Ms[1:],Nc_WDM_mean,'k')
+
+#pt.plot(Ms[1:],Nc_CDM_mean+Nc_CDM_std,'k')
+#pt.plot(Ms[1:],Nc_CDM_mean-Nc_CDM_std,'k')
+
+#pt.plot(Ms[1:],Nc_WDM_mean+Nc_WDM_std,'k')
+#pt.plot(Ms[1:],Nc_WDM_mean-Nc_WDM_std,'k')
+
+ax = pt.gca()
+ax.fill_between(Ms[1:],Nc_CDM_mean+Nc_CDM_std,Nc_CDM_mean-Nc_CDM_std,facecolor='k',alpha=0.1,label=r"$\textrm{CDM}$")
+ax.fill_between(Ms[1:],Nc_WDM_mean+Nc_WDM_std,Nc_WDM_mean-Nc_WDM_std,facecolor='k',alpha=0.1,label=r"$\textrm{WDM}$")
+
+
+###########################
+# finalize
+###########################
+
+xmin = opt.Mmin
+xmax = opt.Mmax
+ymin = None
+ymax = None
+
+xlabel = r"$\rm{Halo\,\,Mass}$"
+ylabel = r"$\rm{Cumulative\,\,number\,\,of\,\,galaxies}\,\,(D<300\,\rm{kpc})$"
+
+pt.SetAxis(xmin,xmax,ymin,ymax,log="xy")
+pt.xlabel(xlabel)
+pt.ylabel(ylabel)
+pt.grid(False)
+
+pt.legend()
+
+
+pt.show()
diff --git a/Workspace/CumNumOfSat/satComputeNCumWithErrors.py b/Workspace/CumNumOfSat/satComputeNCumWithErrors.py
new file mode 100755
index 0000000..a76e79f
--- /dev/null
+++ b/Workspace/CumNumOfSat/satComputeNCumWithErrors.py
@@ -0,0 +1,267 @@
+#!/usr/bin/env python3
+
+import sys,os,string
+
+import argparse
+import satlib
+import numpy as np
+import Ptools as pt
+import pickle
+from scipy.interpolate import splrep,splev
+from tqdm import tqdm
+
+
+####################################################################
+# option parser
+####################################################################
+
+description=""
+epilog =""""""
+
+parser = argparse.ArgumentParser(description=description,epilog=epilog,formatter_class=argparse.RawDescriptionHelpFormatter)
+
+parser.add_argument("--M0",
+ action="store",
+ dest="M0",
+ metavar='FLOAT',
+ type=float,
+ default=1e12,
+ help='host halo mass')
+
+parser.add_argument("--Mmin",
+ action="store",
+ dest="Mmin",
+ metavar='FLOAT',
+ type=float,
+ default=5e7,
+ help='the min halo mass')
+
+
+parser.add_argument("--Mmax",
+ action="store",
+ dest="Mmax",
+ metavar='FLOAT',
+ type=float,
+ default=1e11,
+ help='the max halo mass')
+
+parser.add_argument("--DMmass",
+ action="store",
+ dest="DMmass",
+ metavar='FLOAT',
+ type=float,
+ default=2.0,
+ help='dark matter particle mass')
+
+
+parser.add_argument("-N",
+ action="store",
+ dest="N",
+ metavar='INT',
+ type=int,
+ default=1000,
+ help='number of bins')
+
+
+parser.add_argument("--Ngal",
+ action="store",
+ dest="Ngal",
+ metavar='INT',
+ type=int,
+ default=100,
+ help='number of galaxies')
+
+parser.add_argument("--Nrealisations",
+ action="store",
+ dest="Nrealisations",
+ metavar='INT',
+ type=int,
+ default=100,
+ help='number of realizations')
+
+parser.add_argument("-p",
+ action="store",
+ dest="ps",
+ metavar='FILE NAME',
+ type=str,
+ default=None,
+ help='output file name')
+
+parser.add_argument("--dpi",
+ action="store",
+ dest="dpi",
+ type=float,
+ default=300,
+ help="DPI of the saved file",
+ metavar=" FLOAT")
+
+
+####################################################################
+# main
+####################################################################
+
+def MakePlot(opt):
+
+
+ # halo bins
+ lnMh = np.linspace(np.log10(opt.Mmin),np.log10(opt.Mmax),opt.N)
+ Mh0 = 10**lnMh
+
+ # define the DM models
+ #CDM = satlib.CDM_Sawala_Model(opt.Mmin,opt.Mmax,opt.N)
+ #WDM = satlib.CDM_Forouhar_Model(opt.Mmin,opt.Mmax,opt.N)
+
+ CDM = satlib.GEN_Model(opt.Mmin,opt.Mmax,opt.N,MDM=None,fWDM=0,M0=opt.M0)
+ WDM = satlib.GEN_Model(opt.Mmin,opt.Mmax,opt.N,MDM=opt.DMmass,fWDM=1,M0=opt.M0)
+
+
+ # cumulative number of haloes
+ NM_CDM = CDM.CumulativeMass()
+ NM_WDM = WDM.CumulativeMass()
+
+ pt.plot(Mh0,NM_WDM,c='k',ls='--',label=r"$\rm{theory}$")
+ pt.plot(Mh0,NM_CDM,c='k',ls='--')
+
+
+ # number of haloes for the CDM
+ Nh_CDM = CDM.NumberOfHaloes()
+
+ # number of haloes for the WDM
+ Nh_WDM = WDM.NumberOfHaloes()
+
+
+
+ Nb = 100
+
+ Ncs_CDM = np.zeros((opt.Ngal,Nb-1))
+ Ncs_WDM = np.zeros((opt.Ngal,Nb-1))
+
+
+ Nc_CDM_realisations = np.zeros((opt.Nrealisations,Nb-1))
+ Nc_WDM_realisations = np.zeros((opt.Nrealisations,Nb-1))
+
+
+ for realisation in tqdm(range(opt.Nrealisations)):
+
+ for j in range(opt.Ngal):
+
+ # generate N haloes for the CDM
+ Mhs = CDM.fctSample(np.random.random(Nh_CDM))
+
+ lnm = np.log10(Mhs)
+ # do the histogram
+ logMh = np.linspace(np.log10(opt.Mmin),np.log10(opt.Mmax),Nb)
+ n, bins = np.histogram(lnm, logMh)
+ Ms = 10**bins
+ dM = Ms[1:]-Ms[:-1]
+ dNdM = n/dM
+ Nc_CDM = np.add.accumulate(np.flip(n,0))
+ Nc_CDM = np.flip(Nc_CDM,0)
+ Ncs_CDM[j] = Nc_CDM
+
+
+ # generate N haloes for the WDM
+ #Mhs = fct_WDM_Sample(np.random.random(Nh_WDM))
+ Mhs = WDM.fctSample(np.random.random(Nh_WDM))
+
+ lnm = np.log10(Mhs)
+ # do the histogram
+ logMh = np.linspace(np.log10(opt.Mmin),np.log10(opt.Mmax),Nb)
+ n, bins = np.histogram(lnm, logMh)
+ Ms = 10**bins
+ dM = Ms[1:]-Ms[:-1]
+ dNdM = n/dM
+ Nc_WDM = np.add.accumulate(np.flip(n,0))
+ Nc_WDM = np.flip(Nc_WDM,0)
+ Ncs_WDM[j] = Nc_WDM
+
+
+ #pt.plot(Ms[1:],Nc_CDM,'blue',alpha=0.5)
+ #pt.plot(Ms[1:],Nc_WDM,'red',alpha=0.5)
+
+
+
+ # compute the mean over the Ngal "galaxies"
+ Nc_CDM_mean = Ncs_CDM.mean(axis=0)
+ Nc_WDM_mean = Ncs_WDM.mean(axis=0)
+
+ Nc_CDM_realisations[realisation] = Nc_CDM_mean
+ Nc_WDM_realisations[realisation] = Nc_WDM_mean
+
+
+ #pt.plot(Ms[1:],Nc_CDM_mean,'blue',alpha=0.5)
+ #pt.plot(Ms[1:],Nc_WDM_mean,'red',alpha=0.5)
+
+
+ Nc_CDM_realisations_mean = Nc_CDM_realisations.mean(axis=0)
+ Nc_CDM_realisations_std = Nc_CDM_realisations.std(axis=0)
+
+ Nc_CDM_meanp = Nc_CDM_realisations_mean + 3*Nc_CDM_realisations_std
+ Nc_CDM_meanm = Nc_CDM_realisations_mean - 3*Nc_CDM_realisations_std
+
+
+ Nc_WDM_realisations_mean = Nc_WDM_realisations.mean(axis=0)
+ Nc_WDM_realisations_std = Nc_WDM_realisations.std(axis=0)
+
+ Nc_WDM_meanp = Nc_WDM_realisations_mean + 3*Nc_WDM_realisations_std
+ Nc_WDM_meanm = Nc_WDM_realisations_mean - 3*Nc_WDM_realisations_std
+
+
+
+ ax = pt.gca()
+ ax.fill_between(Ms[1:],Nc_CDM_meanp,Nc_CDM_meanm,facecolor='blue',alpha=0.25,label=r"$\textrm{CDM}$")
+ ax.fill_between(Ms[1:],Nc_WDM_meanp,Nc_WDM_meanm,facecolor='red',alpha=0.25,label=r"$\textrm{WDM}$")
+
+
+
+
+
+
+ ###########################
+ # finalize
+ ###########################
+
+ xmin = opt.Mmin
+ xmax = opt.Mmax
+ ymin = None
+ ymax = None
+
+ xlabel = r"$\rm{Halo\,\,Mass\,\,(M_{\rm halo})}\,\,[M_{\odot}]$"
+ ylabel = r"$N_{\rm halo}(>M_{\rm halo})$"
+
+ pt.SetAxis(xmin,xmax,ymin,ymax,log="xy")
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+ pt.grid(False)
+
+ pt.title(r"$\rm{%d\,\,galaxies\,\,observed}$"%opt.Ngal,fontsize=pt.labelfont)
+ pt.legend()
+
+
+
+
+
+
+
+if __name__ == '__main__':
+
+ opt = parser.parse_args()
+ files = []
+
+ pt.InitPlot(files, opt)
+ pt.labelfont=20
+
+ # pt.figure(figsize=(8*2,6*2))
+ # pt.figure(dpi=10)
+
+ #fig = pt.gcf()
+ # fig.subplots_adjust(left=0.1)
+ # fig.subplots_adjust(right=1)
+ # fig.subplots_adjust(bottom=0.12)
+ # fig.subplots_adjust(top=0.95)
+ # fig.subplots_adjust(wspace=0.25)
+ # fig.subplots_adjust(hspace=0.02)
+
+ MakePlot(opt)
+ pt.EndPlot(files, opt)
+
diff --git a/Workspace/CumNumOfSat/satComputeNCumWithErrors_Fred.py b/Workspace/CumNumOfSat/satComputeNCumWithErrors_Fred.py
new file mode 100755
index 0000000..b61e3e3
--- /dev/null
+++ b/Workspace/CumNumOfSat/satComputeNCumWithErrors_Fred.py
@@ -0,0 +1,267 @@
+#!/usr/bin/env python3
+
+import sys,os,string
+
+import argparse
+import satlib
+import numpy as np
+import Ptools as pt
+import pickle
+from scipy.interpolate import splrep,splev
+from tqdm import tqdm
+
+
+####################################################################
+# option parser
+####################################################################
+
+description=""
+epilog =""""""
+
+parser = argparse.ArgumentParser(description=description,epilog=epilog,formatter_class=argparse.RawDescriptionHelpFormatter)
+
+parser.add_argument("--M0",
+ action="store",
+ dest="M0",
+ metavar='FLOAT',
+ type=float,
+ default=1e12,
+ help='host halo mass')
+
+parser.add_argument("--Mmin",
+ action="store",
+ dest="Mmin",
+ metavar='FLOAT',
+ type=float,
+ default=5e6,
+ help='the min halo mass')
+
+
+parser.add_argument("--Mmax",
+ action="store",
+ dest="Mmax",
+ metavar='FLOAT',
+ type=float,
+ default=1e9,
+ help='the max halo mass')
+
+parser.add_argument("--DMmass",
+ action="store",
+ dest="DMmass",
+ metavar='FLOAT',
+ type=float,
+ default=2.0,
+ help='dark matter particle mass')
+
+
+parser.add_argument("-N",
+ action="store",
+ dest="N",
+ metavar='INT',
+ type=int,
+ default=1000,
+ help='number of bins')
+
+
+parser.add_argument("--Ngal",
+ action="store",
+ dest="Ngal",
+ metavar='INT',
+ type=int,
+ default=100,
+ help='number of galaxies')
+
+parser.add_argument("--Nrealisations",
+ action="store",
+ dest="Nrealisations",
+ metavar='INT',
+ type=int,
+ default=100,
+ help='number of realizations')
+
+parser.add_argument("-p",
+ action="store",
+ dest="ps",
+ metavar='FILE NAME',
+ type=str,
+ default=None,
+ help='output file name')
+
+parser.add_argument("--dpi",
+ action="store",
+ dest="dpi",
+ type=float,
+ default=300,
+ help="DPI of the saved file",
+ metavar=" FLOAT")
+
+
+####################################################################
+# main
+####################################################################
+
+def MakePlot(opt):
+
+
+ # halo bins
+ lnMh = np.linspace(np.log10(opt.Mmin),np.log10(opt.Mmax),opt.N)
+ Mh0 = 10**lnMh
+
+ # define the DM models
+ #CDM = satlib.CDM_Sawala_Model(opt.Mmin,opt.Mmax,opt.N)
+ #WDM = satlib.CDM_Forouhar_Model(opt.Mmin,opt.Mmax,opt.N)
+
+ CDM = satlib.GEN_Model(opt.Mmin,opt.Mmax,opt.N,MDM=None,fWDM=0,M0=opt.M0)
+ WDM = satlib.GEN_Model(opt.Mmin,opt.Mmax,opt.N,MDM=opt.DMmass,fWDM=1,M0=opt.M0)
+
+
+ # cumulative number of haloes
+ NM_CDM = CDM.CumulativeMass()
+ NM_WDM = WDM.CumulativeMass()
+
+ pt.plot(Mh0,NM_WDM,c='k',ls='--',label=r"$\rm{theory}$")
+ pt.plot(Mh0,NM_CDM,c='k',ls='--')
+
+
+ # number of haloes for the CDM
+ Nh_CDM = CDM.NumberOfHaloes()
+
+ # number of haloes for the WDM
+ Nh_WDM = WDM.NumberOfHaloes()
+
+
+
+ Nb = 100
+
+ Ncs_CDM = np.zeros((opt.Ngal,Nb-1))
+ Ncs_WDM = np.zeros((opt.Ngal,Nb-1))
+
+
+ Nc_CDM_realisations = np.zeros((opt.Nrealisations,Nb-1))
+ Nc_WDM_realisations = np.zeros((opt.Nrealisations,Nb-1))
+
+
+ for realisation in tqdm(range(opt.Nrealisations)):
+
+ for j in range(opt.Ngal):
+
+ # generate N haloes for the CDM
+ Mhs = CDM.fctSample(np.random.random(Nh_CDM))
+
+ lnm = np.log10(Mhs)
+ # do the histogram
+ logMh = np.linspace(np.log10(opt.Mmin),np.log10(opt.Mmax),Nb)
+ n, bins = np.histogram(lnm, logMh)
+ Ms = 10**bins
+ dM = Ms[1:]-Ms[:-1]
+ dNdM = n/dM
+ Nc_CDM = np.add.accumulate(np.flip(n,0))
+ Nc_CDM = np.flip(Nc_CDM,0)
+ Ncs_CDM[j] = Nc_CDM
+
+
+ # generate N haloes for the WDM
+ #Mhs = fct_WDM_Sample(np.random.random(Nh_WDM))
+ Mhs = WDM.fctSample(np.random.random(Nh_WDM))
+
+ lnm = np.log10(Mhs)
+ # do the histogram
+ logMh = np.linspace(np.log10(opt.Mmin),np.log10(opt.Mmax),Nb)
+ n, bins = np.histogram(lnm, logMh)
+ Ms = 10**bins
+ dM = Ms[1:]-Ms[:-1]
+ dNdM = n/dM
+ Nc_WDM = np.add.accumulate(np.flip(n,0))
+ Nc_WDM = np.flip(Nc_WDM,0)
+ Ncs_WDM[j] = Nc_WDM
+
+
+ #pt.plot(Ms[1:],Nc_CDM,'blue',alpha=0.5)
+ #pt.plot(Ms[1:],Nc_WDM,'red',alpha=0.5)
+
+
+
+ # compute the mean over the Ngal "galaxies"
+ Nc_CDM_mean = Ncs_CDM.mean(axis=0)
+ Nc_WDM_mean = Ncs_WDM.mean(axis=0)
+
+ Nc_CDM_realisations[realisation] = Nc_CDM_mean
+ Nc_WDM_realisations[realisation] = Nc_WDM_mean
+
+
+ #pt.plot(Ms[1:],Nc_CDM_mean,'blue',alpha=0.5)
+ #pt.plot(Ms[1:],Nc_WDM_mean,'red',alpha=0.5)
+
+
+ Nc_CDM_realisations_mean = Nc_CDM_realisations.mean(axis=0)
+ Nc_CDM_realisations_std = Nc_CDM_realisations.std(axis=0)
+
+ Nc_CDM_meanp = Nc_CDM_realisations_mean + 3*Nc_CDM_realisations_std
+ Nc_CDM_meanm = Nc_CDM_realisations_mean - 3*Nc_CDM_realisations_std
+
+
+ Nc_WDM_realisations_mean = Nc_WDM_realisations.mean(axis=0)
+ Nc_WDM_realisations_std = Nc_WDM_realisations.std(axis=0)
+
+ Nc_WDM_meanp = Nc_WDM_realisations_mean + 3*Nc_WDM_realisations_std
+ Nc_WDM_meanm = Nc_WDM_realisations_mean - 3*Nc_WDM_realisations_std
+
+
+
+ ax = pt.gca()
+ ax.fill_between(Ms[1:],Nc_CDM_meanp,Nc_CDM_meanm,facecolor='blue',alpha=0.25,label=r"$\textrm{CDM}$")
+ ax.fill_between(Ms[1:],Nc_WDM_meanp,Nc_WDM_meanm,facecolor='red',alpha=0.25,label=r"$\textrm{WDM}$")
+
+
+
+
+
+
+ ###########################
+ # finalize
+ ###########################
+
+ xmin = opt.Mmin
+ xmax = opt.Mmax
+ ymin = None
+ ymax = None
+
+ xlabel = r"$\rm{Halo\,\,Mass\,\,(M_{\rm halo})}\,\,[M_{\odot}]$"
+ ylabel = r"$N_{\rm halo}(>M_{\rm halo})$"
+
+ pt.SetAxis(xmin,xmax,ymin,ymax,log="xy")
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+ pt.grid(False)
+
+ pt.title(r"$\rm{%d\,\,galaxies\,\,observed}$"%opt.Ngal,fontsize=pt.labelfont)
+ pt.legend()
+
+
+
+
+
+
+
+if __name__ == '__main__':
+
+ opt = parser.parse_args()
+ files = []
+
+ pt.InitPlot(files, opt)
+ pt.labelfont=20
+
+ # pt.figure(figsize=(8*2,6*2))
+ # pt.figure(dpi=10)
+
+ #fig = pt.gcf()
+ # fig.subplots_adjust(left=0.1)
+ # fig.subplots_adjust(right=1)
+ # fig.subplots_adjust(bottom=0.12)
+ # fig.subplots_adjust(top=0.95)
+ # fig.subplots_adjust(wspace=0.25)
+ # fig.subplots_adjust(hspace=0.02)
+
+ MakePlot(opt)
+ pt.EndPlot(files, opt)
+
diff --git a/Workspace/CumNumOfSat/satComputeNCumvsLv.py b/Workspace/CumNumOfSat/satComputeNCumvsLv.py
new file mode 100755
index 0000000..a5836f9
--- /dev/null
+++ b/Workspace/CumNumOfSat/satComputeNCumvsLv.py
@@ -0,0 +1,318 @@
+#!/usr/bin/env python3
+
+import sys,os,string
+
+import argparse
+import satlib
+import numpy as np
+import Ptools as pt
+import pickle
+from scipy.interpolate import splrep,splev
+
+####################################################################
+# option parser
+####################################################################
+
+description=""
+epilog =""""""
+
+parser = argparse.ArgumentParser(description=description,epilog=epilog,formatter_class=argparse.RawDescriptionHelpFormatter)
+
+
+
+parser.add_argument("--Mmin",
+ action="store",
+ dest="Mmin",
+ metavar='FLOAT',
+ type=float,
+ default=5e7,
+ help='the min halo mass')
+
+
+parser.add_argument("--Mmax",
+ action="store",
+ dest="Mmax",
+ metavar='FLOAT',
+ type=float,
+ default=1e10,
+ help='the max halo mass')
+
+parser.add_argument("-N",
+ action="store",
+ dest="N",
+ metavar='INT',
+ type=int,
+ default=1000,
+ help='number of bins')
+
+
+parser.add_argument("--Ngal",
+ action="store",
+ dest="Ngal",
+ metavar='INT',
+ type=int,
+ default=100,
+ help='number of galaxies')
+
+
+parser.add_argument("--LvvsMh_file",
+ action="store",
+ type=str,
+ dest="LvvsMh_file",
+ default = None,
+ help="Lv Mh file")
+
+
+
+
+####################################################################
+# main
+####################################################################
+
+
+opt = parser.parse_args()
+
+
+myblue = (0,128/255.,255/255.)
+myred = (255/255.,137/255.,137/255.)
+
+
+# read Mh vs Lv
+f = open(opt.LvvsMh_file,"rb")
+Mhbins = pickle.load(f,encoding="latin1")
+Lvmins = pickle.load(f,encoding="latin1")
+Lvmaxs = pickle.load(f,encoding="latin1")
+f.close()
+
+
+
+
+# halo bins
+lnMh = np.linspace(np.log10(opt.Mmin),np.log10(opt.Mmax),opt.N)
+Mh0 = 10**lnMh
+
+# cumulative number of haloes
+NM_CDM = satlib.CDM_CumulativeMass(Mh0)
+NM_WDM = satlib.fctWDM_CumulativeMass(Mh0)
+
+
+# define the CDM sampling function
+fct_CDM_Sample = np.vectorize( lambda x: 10**np.interp(x, NM_CDM[::-1]/NM_CDM.max(), np.log10(Mh0[::-1])) )
+maxCDM = (NM_CDM/NM_CDM.max()).min()
+
+# define the WDM sampling function
+fct_WDM_Sample = np.vectorize( lambda x: 10**np.interp(x, NM_WDM[::-1]/NM_WDM.max(), np.log10(Mh0[::-1])) )
+maxWDM = (NM_WDM/NM_WDM.max()).min()
+
+
+
+
+
+
+Nbins = 100
+Nsas_CDM = np.zeros((opt.Ngal,Nbins-1))
+Nsas_WDM = np.zeros((opt.Ngal,Nbins-1))
+
+
+
+for j in range(opt.Ngal):
+
+ print(j)
+
+ #################################################
+ # generate N haloes for the CDM
+ #################################################
+ Nh = int(satlib.CDM_CumulativeMass(opt.Mmin))
+ Mhs = fct_CDM_Sample(np.random.random(Nh))
+
+ ###################
+ # loop over haloes
+ logLv = np.zeros(len(Mhs))
+
+ for i,Mh in enumerate(Mhs):
+ if Mh < 1e8:
+ continue
+
+ # find the nearest values in Mbins
+ # and set a Luminosity
+
+ idx = np.argmin( np.fabs( Mh-Mhbins ) )
+
+ logLvmins = np.log10(Lvmins[idx])
+ logLvmaxs = np.log10(Lvmaxs[idx])
+
+ logLv[i] = np.random.uniform(logLvmins,logLvmaxs)
+
+
+ ######################
+ # cumulative
+
+ bins = np.linspace(2,10,Nbins)
+ Ns,Lv = np.histogram(logLv,bins)
+
+ # now, need to cumulate
+ # invert vector first and reinvert after
+ Nsa = np.add.accumulate(Ns[-np.arange(1,len(Ns)+1)])
+ Nsa = Nsa[-np.arange(1,len(Nsa)+1)]
+ Lv = Lv[1:]
+ # add
+ Nsas_CDM[j] = Nsa
+
+
+
+
+ #################################################
+ # generate N haloes for the WDM
+ #################################################
+ Nh = int(satlib.fctWDM_CumulativeMass(opt.Mmin))
+ Mhs = fct_WDM_Sample(np.random.random(Nh))
+
+
+ ###################
+ # loop over haloes
+ logLv = np.zeros(len(Mhs))
+
+ for i,Mh in enumerate(Mhs):
+ if Mh < 1e8:
+ continue
+
+ # find the nearest values in Mbins
+ # and set a Luminosity
+
+ idx = np.argmin( np.fabs( Mh-Mhbins ) )
+
+ logLvmins = np.log10(Lvmins[idx])
+ logLvmaxs = np.log10(Lvmaxs[idx])
+
+ logLv[i] = np.random.uniform(logLvmins,logLvmaxs)
+
+
+ ######################
+ # cumulative
+
+ bins = np.linspace(2,10,Nbins)
+ Ns,Lv = np.histogram(logLv,bins)
+
+ # now, need to cumulate
+ # invert vector first and reinvert after
+ Nsa = np.add.accumulate(Ns[-np.arange(1,len(Ns)+1)])
+ Nsa = Nsa[-np.arange(1,len(Nsa)+1)]
+ Lv = Lv[1:]
+ # add
+ Nsas_WDM[j] = Nsa
+
+
+
+
+
+
+
+
+Ns_CDM_mean = Nsas_CDM.mean(axis=0)
+Ns_CDM_std = Nsas_CDM.std(axis=0)
+
+Ns_CDM_meanp = Ns_CDM_mean + Ns_CDM_std
+Ns_CDM_meanm = Ns_CDM_mean - Ns_CDM_std
+
+
+Ns_WDM_mean = Nsas_WDM.mean(axis=0)
+Ns_WDM_std = Nsas_WDM.std(axis=0)
+
+Ns_WDM_meanp = Ns_WDM_mean + Ns_WDM_std
+Ns_WDM_meanm = Ns_WDM_mean - Ns_WDM_std
+
+pt.plot(10**Lv,Ns_CDM_mean,label=r"$\textrm{CDM}$",lw=5)
+pt.plot(10**Lv,Ns_WDM_mean,label=r"$\textrm{WDM}$",lw=5)
+
+
+#ax = pt.gca()
+#ax.fill_between(10**Lv,Ns_CDM_meanp,Ns_CDM_meanm,facecolor='k',alpha=0.1,label=r"$\textrm{CDM}$")
+#ax.fill_between(10**Lv,Ns_WDM_meanp,Ns_WDM_meanm,facecolor='k',alpha=0.1,label=r"$\textrm{WDM}$")
+
+
+data = True
+
+if data:
+
+ ################################################################################
+ # add data from Nadler, Drlica etc.
+
+ ax = pt.gca()
+ s = 0.0
+ k = 1
+
+ def read_data(f):
+ data = np.loadtxt(f,delimiter=',')
+ Mv = data[:,0]
+ N = data[:,1]
+ Lv = pow(10, (4.74 - Mv) / 2.5)
+ return Lv, N
+
+
+ ###################
+ # Nadler
+
+ Lvp, Np = read_data("data/Nadler_rawt1.txt")
+ Lvm, Nm = read_data("data/Nadler_rawb1.txt")
+
+ ap = splrep(Lvp,Np,s=s,k=k)
+ am = splrep(Lvm,Nm,s=s,k=k)
+
+ Np= splev(Lvp,ap)
+ Nm= splev(Lvp,am)
+
+ #pt.plot(Lvp,Np,'k-')
+ #pt.plot(Lvm,Nm,'k-')
+ ax.fill_between(Lvp,Np,Nm,facecolor='blue',alpha=0.1,label=r"$\textrm{Nadler\,\,et\,\,al.\,\,2018a}$")
+
+
+ Lvp, Np = read_data("data/Nadler_rawt2.txt")
+ Lvm, Nm = read_data("data/Nadler_rawb2.txt")
+
+ ap = splrep(Lvp,Np,s=s,k=k)
+ am = splrep(Lvm,Nm,s=s,k=k)
+
+ Np= splev(Lvp,ap)
+ Nm= splev(Lvp,am)
+
+ #pt.plot(Lvp,Np,'k-')
+ #pt.plot(Lvm,Nm,'k-')
+ ax.fill_between(Lvp,Np,Nm,facecolor='blue',alpha=0.1)
+
+
+ ###################
+ # Drilca
+
+ Lv, N = read_data("data/Drlica_raw_weighted.txt")
+ pt.plot(Lv,N,'k-',label=r"$\textrm{DES+PS1,\,\,weighted\,\,(Drlica-Wagner\,\,et\,\,al.\,\,2020)}$")
+
+ Lv, N = read_data("data/Drlica_raw_detected.txt")
+ pt.plot(Lv,N,'k--',label=r"$\textrm{DES+PS1,\,\,detected\,\,(Drlica-Wagner\,\,et\,\,al.\,\,2020)}$")
+
+ Lv, N = read_data("data/Drlica_raw_all.txt")
+ pt.plot(Lv,N,'r-',label=r"$\textrm{All\,\,known\,\,satellites\,\,(Drlica-Wagner\,\,et\,\,al.\,\,2020)}$")
+
+
+
+
+###########################
+# finalize
+###########################
+
+xmin = 5e2
+xmax = 5e9
+ymin = 1
+ymax = 500
+
+xlabel = r"$\rm{V-band\,\,Luminosity}$"
+ylabel = r"$\rm{Cumulative\,\,number\,\,of\,\,galaxies}\,\,(D<300\,\rm{kpc})$"
+
+pt.SetAxis(xmin,xmax,ymin,ymax,log="xy")
+pt.xlabel(xlabel)
+pt.ylabel(ylabel)
+pt.grid(False)
+
+pt.legend()
+
+
+pt.show()
diff --git a/Workspace/CumNumOfSat/satComputeNCumvsLvWithErrors.py b/Workspace/CumNumOfSat/satComputeNCumvsLvWithErrors.py
new file mode 100755
index 0000000..fb36a65
--- /dev/null
+++ b/Workspace/CumNumOfSat/satComputeNCumvsLvWithErrors.py
@@ -0,0 +1,455 @@
+#!/usr/bin/env python3
+
+import sys,os,string
+
+import argparse
+import satlib
+import numpy as np
+import Ptools as pt
+import pickle
+from scipy.interpolate import splrep,splev
+from tqdm import tqdm
+
+####################################################################
+# option parser
+####################################################################
+
+description=""
+epilog =""""""
+
+parser = argparse.ArgumentParser(description=description,epilog=epilog,formatter_class=argparse.RawDescriptionHelpFormatter)
+
+
+parser.add_argument("--M0",
+ action="store",
+ dest="M0",
+ metavar='FLOAT',
+ type=float,
+ default=1e12,
+ help='host halo mass')
+
+
+parser.add_argument("--Mmin",
+ action="store",
+ dest="Mmin",
+ metavar='FLOAT',
+ type=float,
+ default=5e7,
+ help='the min halo mass')
+
+
+parser.add_argument("--Mmax",
+ action="store",
+ dest="Mmax",
+ metavar='FLOAT',
+ type=float,
+ default=1e11,
+ help='the max halo mass')
+
+parser.add_argument("--DMmass",
+ action="store",
+ dest="DMmass",
+ metavar='FLOAT',
+ type=float,
+ default=2.0,
+ help='dark matter particle mass')
+
+
+parser.add_argument("-N",
+ action="store",
+ dest="N",
+ metavar='INT',
+ type=int,
+ default=1000,
+ help='number of bins')
+
+
+parser.add_argument("--Ngal",
+ action="store",
+ dest="Ngal",
+ metavar='INT',
+ type=int,
+ default=100,
+ help='number of galaxies')
+
+
+parser.add_argument("--Nrealisations",
+ action="store",
+ dest="Nrealisations",
+ metavar='INT',
+ type=int,
+ default=100,
+ help='number of realizations')
+
+
+
+parser.add_argument("--LvvsMh_model",
+ action="store",
+ type=str,
+ dest="LvvsMh_model",
+ default = 'rj2018',
+ help="Lv Mh model")
+
+
+parser.add_argument("-p",
+ action="store",
+ dest="ps",
+ metavar='FILE NAME',
+ type=str,
+ default=None,
+ help='output file name')
+
+parser.add_argument("--dpi",
+ action="store",
+ dest="dpi",
+ type=float,
+ default=300,
+ help="DPI of the saved file",
+ metavar=" FLOAT")
+
+parser.add_argument("--data",
+ action="store_true",
+ dest="data",
+ default=False,
+ help='add data')
+
+
+parser.add_argument("--filter",
+ action="store",
+ dest="filter",
+ metavar='STR',
+ type=str,
+ default=None,
+ help='filter name')
+
+parser.add_argument("--distance",
+ action="store",
+ dest="distance",
+ type=float,
+ default=35,
+ help="distance in Mpc",
+ metavar=" FLOAT")
+
+####################################################################
+# main
+####################################################################
+
+
+def MakePlot(opt):
+
+
+ # get Mh vs Lv relation
+ Mhbins,Lvmins,Lvmaxs = satlib.GetStellarMassHaloMassRelation(model=opt.LvvsMh_model)
+
+
+
+ # halo bins
+ lnMh = np.linspace(np.log10(opt.Mmin),np.log10(opt.Mmax),opt.N)
+ Mh0 = 10**lnMh
+
+
+ # define the DM models
+ #CDM = satlib.CDM_Sawala_Model(opt.Mmin,opt.Mmax,opt.N)
+ #WDM = satlib.CDM_Forouhar_Model(opt.Mmin,opt.Mmax,opt.N)
+ CDM = satlib.GEN_Model(opt.Mmin,opt.Mmax,opt.N,MDM=None,fWDM=0,M0=opt.M0)
+ WDM = satlib.GEN_Model(opt.Mmin,opt.Mmax,opt.N,MDM=opt.DMmass,fWDM=1,M0=opt.M0)
+
+
+
+ # number of haloes for the CDM
+ Nh_CDM = CDM.NumberOfHaloes()
+
+ # number of haloes for the WDM
+ Nh_WDM = WDM.NumberOfHaloes()
+
+
+
+
+
+ Nbins = 100
+ Nsats_CDM = np.zeros((opt.Ngal,Nbins-1))
+ Nsats_WDM = np.zeros((opt.Ngal,Nbins-1))
+
+
+ Ns_CDM_realisations = np.zeros((opt.Nrealisations,Nbins-1))
+ Ns_WDM_realisations = np.zeros((opt.Nrealisations,Nbins-1))
+
+ for realisation in tqdm(range(opt.Nrealisations)):
+
+ for j in range(opt.Ngal):
+
+ #print(realisation,j)
+
+ #################################################
+ # generate N haloes for the CDM
+ #################################################
+ Mhs = CDM.fctSample(np.random.random(Nh_CDM))
+
+ ###################
+ # loop over haloes
+ logLv = np.zeros(len(Mhs))
+
+ for i,Mh in enumerate(Mhs):
+ if Mh < 1e8:
+ continue
+
+ # find the nearest values in Mbins
+ # and set a Luminosity
+
+ idx = np.argmin( np.fabs( Mh-Mhbins ) )
+
+ logLvmins = np.log10(Lvmins[idx])
+ logLvmaxs = np.log10(Lvmaxs[idx])
+
+ logLv[i] = np.random.uniform(logLvmins,logLvmaxs)
+
+
+ ######################
+ # cumulative
+
+ bins = np.linspace(2,12,Nbins)
+ Ns,Lv = np.histogram(logLv,bins)
+
+ # now, need to cumulate
+ # invert vector first and reinvert after
+ Nsat = np.add.accumulate(Ns[-np.arange(1,len(Ns)+1)])
+ Nsat = Nsat[-np.arange(1,len(Nsat)+1)]
+ Lv = Lv[1:]
+ # add
+ Nsats_CDM[j] = Nsat
+
+
+
+
+ #################################################
+ # generate N haloes for the WDM
+ #################################################
+ Mhs = WDM.fctSample(np.random.random(Nh_WDM))
+
+
+ ###################
+ # loop over haloes
+ logLv = np.zeros(len(Mhs))
+
+ for i,Mh in enumerate(Mhs):
+ if Mh < 1e8:
+ continue
+
+ # find the nearest values in Mbins
+ # and set a Luminosity
+
+ idx = np.argmin( np.fabs( Mh-Mhbins ) )
+
+ logLvmins = np.log10(Lvmins[idx])
+ logLvmaxs = np.log10(Lvmaxs[idx])
+
+ logLv[i] = np.random.uniform(logLvmins,logLvmaxs)
+
+
+ ######################
+ # cumulative
+
+ bins = np.linspace(2,12,Nbins)
+ Ns,Lv = np.histogram(logLv,bins)
+
+ # now, need to cumulate
+ # invert vector first and reinvert after
+ Nsat = np.add.accumulate(Ns[-np.arange(1,len(Ns)+1)])
+ Nsat = Nsat[-np.arange(1,len(Nsat)+1)]
+ Lv = Lv[1:]
+ # add
+ Nsats_WDM[j] = Nsat
+
+
+ # plot individual galaxies
+ #pt.plot(10**Lv,Nsats_CDM[j],'blue',alpha=0.5)
+ #pt.plot(10**Lv,Nsats_WDM[j],'red' ,alpha=0.5)
+
+
+
+
+ Ns_CDM_mean = Nsats_CDM.mean(axis=0)
+ Ns_WDM_mean = Nsats_WDM.mean(axis=0)
+
+ Ns_CDM_realisations[realisation] = Ns_CDM_mean
+ Ns_WDM_realisations[realisation] = Ns_WDM_mean
+
+ # plot means
+ #pt.plot(10**Lv,Ns_CDM_mean,lw=1,alpha=0.5, c='blue')
+ #pt.plot(10**Lv,Ns_WDM_mean,lw=1,alpha=0.5, c='red')
+
+
+
+
+
+ Ns_CDM_realisations_mean = Ns_CDM_realisations.mean(axis=0)
+ Ns_CDM_realisations_std = Ns_CDM_realisations.std(axis=0)
+
+ Ns_CDM_meanp = Ns_CDM_realisations_mean + 3*Ns_CDM_realisations_std
+ Ns_CDM_meanm = Ns_CDM_realisations_mean - 3*Ns_CDM_realisations_std
+
+
+ Ns_WDM_realisations_mean = Ns_WDM_realisations.mean(axis=0)
+ Ns_WDM_realisations_std = Ns_WDM_realisations.std(axis=0)
+
+ Ns_WDM_meanp = Ns_WDM_realisations_mean + 3*Ns_WDM_realisations_std
+ Ns_WDM_meanm = Ns_WDM_realisations_mean - 3*Ns_WDM_realisations_std
+
+
+
+ if opt.filter is not None:
+ # convert Lv assumed to be Msol in Mag
+
+ Mag = np.zeros(len(Lv))
+ for i in range(len(Lv)):
+ Mag[i] = satlib.Msol2Mag(10**Lv[i],filter=opt.filter)
+
+ # to apparent magnitude
+ opt.distance = opt.distance * 1e6 # Mpc to pc
+ Mag = Mag + 5*np.log10(opt.distance) - 5
+
+
+ ax = pt.gca()
+ ax.fill_between(Mag,Ns_CDM_meanp,Ns_CDM_meanm,facecolor='blue',alpha=0.5,label=r"$\textrm{CDM}$")
+ ax.fill_between(Mag,Ns_WDM_meanp,Ns_WDM_meanm,facecolor='red',alpha=0.5,label=r"$\textrm{WDM}$")
+
+ xmin = 30
+ xmax = 15
+ ymin = 1
+ ymax = 500
+
+ pt.SetAxis(xmin,xmax,ymin,ymax,log="y")
+ xlabel = r"$\rm{%s\,\,mag}$"%(opt.filter)
+
+ # 1e5 Msol
+ pt.plot([23.2,23.2],[0.1,1000],c='k',ls=':')
+
+
+ else:
+ ax = pt.gca()
+ ax.fill_between(10**Lv,Ns_CDM_meanp,Ns_CDM_meanm,facecolor='blue',alpha=0.5,label=r"$\textrm{CDM}$")
+ ax.fill_between(10**Lv,Ns_WDM_meanp,Ns_WDM_meanm,facecolor='red',alpha=0.5,label=r"$\textrm{WDM}$")
+
+ xmin = 5e2
+ xmax = 5e9
+ ymin = 1
+ ymax = 500
+
+ pt.SetAxis(xmin,xmax,ymin,ymax,log="xy")
+ xlabel = r"$\rm{V-band\,\,Luminosity}$"
+
+ pt.plot([1e5,1e5],[0.1,1000],c='k',ls=':')
+
+
+ if opt.data:
+
+ ################################################################################
+ # add data from Nadler, Drlica etc.
+
+ ax = pt.gca()
+ s = 0.0
+ k = 1
+
+ def read_data(f):
+ data = np.loadtxt(f,delimiter=',')
+ Mv = data[:,0]
+ N = data[:,1]
+ Lv = pow(10, (4.74 - Mv) / 2.5)
+ return Lv, N
+
+
+ ###################
+ # Nadler
+
+ Lvp, Np = read_data("data/Nadler_rawt1.txt")
+ Lvm, Nm = read_data("data/Nadler_rawb1.txt")
+
+ ap = splrep(Lvp,Np,s=s,k=k)
+ am = splrep(Lvm,Nm,s=s,k=k)
+
+ Np= splev(Lvp,ap)
+ Nm= splev(Lvp,am)
+
+ #pt.plot(Lvp,Np,'k-')
+ #pt.plot(Lvm,Nm,'k-')
+ ax.fill_between(Lvp,Np,Nm,facecolor='green',alpha=0.05,label=r"$\textrm{Nadler\,\,et\,\,al.\,\,2018a}$")
+
+
+ Lvp, Np = read_data("data/Nadler_rawt2.txt")
+ Lvm, Nm = read_data("data/Nadler_rawb2.txt")
+
+ ap = splrep(Lvp,Np,s=s,k=k)
+ am = splrep(Lvm,Nm,s=s,k=k)
+
+ Np= splev(Lvp,ap)
+ Nm= splev(Lvp,am)
+
+ #pt.plot(Lvp,Np,'k-')
+ #pt.plot(Lvm,Nm,'k-')
+ ax.fill_between(Lvp,Np,Nm,facecolor='green',alpha=0.05)
+
+
+ ###################
+ # Drilca
+
+ Lv, N = read_data("data/Drlica_raw_weighted.txt")
+ pt.plot(Lv,N,'k-',label=r"$\textrm{DES+PS1,\,\,weighted\,\,(Drlica-Wagner\,\,et\,\,al.\,\,2020)}$",alpha=0.5)
+
+ Lv, N = read_data("data/Drlica_raw_detected.txt")
+ pt.plot(Lv,N,'k--',label=r"$\textrm{DES+PS1,\,\,detected\,\,(Drlica-Wagner\,\,et\,\,al.\,\,2020)}$",alpha=0.5)
+
+ Lv, N = read_data("data/Drlica_raw_all.txt")
+ pt.plot(Lv,N,'r-',label=r"$\textrm{All\,\,known\,\,satellites\,\,(Drlica-Wagner\,\,et\,\,al.\,\,2020)}$",alpha=0.5)
+
+
+
+
+ ###########################
+ # finalize
+ ###########################
+
+
+
+
+
+ ylabel = r"$\rm{Cumulative\,\,number\,\,of\,\,galaxies}\,\,(D<300\,\rm{kpc})$"
+
+
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+ pt.grid(False)
+ pt.legend()
+
+ pt.title(r"$\rm{%d\,\,galaxies\,\,observed\,\,+\,\,model=%s}\,\,+\,\,M_{\rm{DM}}=%3.1f\,\rm{keV}$"%(opt.Ngal,opt.LvvsMh_model,opt.DMmass),fontsize=pt.labelfont)
+
+ #pt.plot([1e5,1e5],[0.1,1000],c='k',ls=':')
+
+
+
+
+
+if __name__ == '__main__':
+
+ opt = parser.parse_args()
+ files = []
+
+ pt.InitPlot(files, opt)
+ pt.labelfont=20
+
+ # pt.figure(figsize=(8*2,6*2))
+ # pt.figure(dpi=10)
+
+ #fig = pt.gcf()
+ # fig.subplots_adjust(left=0.1)
+ # fig.subplots_adjust(right=1)
+ # fig.subplots_adjust(bottom=0.12)
+ # fig.subplots_adjust(top=0.95)
+ # fig.subplots_adjust(wspace=0.25)
+ # fig.subplots_adjust(hspace=0.02)
+
+ MakePlot(opt)
+ pt.EndPlot(files, opt)
+
+
+
+
diff --git a/Workspace/CumNumOfSat/satComputeNCumvsLvWithErrorsWithM0varied.py b/Workspace/CumNumOfSat/satComputeNCumvsLvWithErrorsWithM0varied.py
new file mode 100755
index 0000000..cf88483
--- /dev/null
+++ b/Workspace/CumNumOfSat/satComputeNCumvsLvWithErrorsWithM0varied.py
@@ -0,0 +1,448 @@
+#!/usr/bin/env python3
+
+import sys,os,string
+
+import argparse
+import satlib
+import numpy as np
+import Ptools as pt
+import pickle
+from scipy.interpolate import splrep,splev
+from tqdm import tqdm
+
+####################################################################
+# option parser
+####################################################################
+
+description=""
+epilog =""""""
+
+parser = argparse.ArgumentParser(description=description,epilog=epilog,formatter_class=argparse.RawDescriptionHelpFormatter)
+
+
+parser.add_argument("--M0",
+ action="store",
+ dest="M0",
+ metavar='FLOAT',
+ type=float,
+ default=1e12,
+ help='host halo mass')
+
+
+
+parser.add_argument("--Mmin",
+ action="store",
+ dest="Mmin",
+ metavar='FLOAT',
+ type=float,
+ default=5e7,
+ help='the min halo mass')
+
+
+parser.add_argument("--Mmax",
+ action="store",
+ dest="Mmax",
+ metavar='FLOAT',
+ type=float,
+ default=1e11,
+ help='the max halo mass')
+
+parser.add_argument("--DMmass",
+ action="store",
+ dest="DMmass",
+ metavar='FLOAT',
+ type=float,
+ default=2.0,
+ help='dark matter particle mass')
+
+
+parser.add_argument("-N",
+ action="store",
+ dest="N",
+ metavar='INT',
+ type=int,
+ default=1000,
+ help='number of bins')
+
+
+parser.add_argument("--Ngal",
+ action="store",
+ dest="Ngal",
+ metavar='INT',
+ type=int,
+ default=100,
+ help='number of galaxies')
+
+
+parser.add_argument("--Nrealisations",
+ action="store",
+ dest="Nrealisations",
+ metavar='INT',
+ type=int,
+ default=100,
+ help='number of realizations')
+
+
+
+parser.add_argument("--LvvsMh_model",
+ action="store",
+ type=str,
+ dest="LvvsMh_model",
+ default = 'rj2018',
+ help="Lv Mh model")
+
+
+parser.add_argument("-p",
+ action="store",
+ dest="ps",
+ metavar='FILE NAME',
+ type=str,
+ default=None,
+ help='output file name')
+
+parser.add_argument("--dpi",
+ action="store",
+ dest="dpi",
+ type=float,
+ default=300,
+ help="DPI of the saved file",
+ metavar=" FLOAT")
+
+parser.add_argument("--data",
+ action="store_true",
+ dest="data",
+ default=False,
+ help='add data')
+
+
+parser.add_argument("--M0_var",
+ action="store",
+ dest="M0_var",
+ metavar='FLOAT',
+ type=float,
+ default=1,
+ help='variation of the mass of the main halo in dex')
+
+parser.add_argument("--M0_N",
+ action="store",
+ dest="M0_N",
+ metavar='INT',
+ type=int,
+ default=11,
+ help='number of bins for the variation of the mass of the main halo')
+
+
+
+
+
+####################################################################
+# main
+####################################################################
+
+
+def MakePlot(opt):
+
+
+ # get Mh vs Lv relation
+ Mhbins,Lvmins,Lvmaxs = satlib.GetStellarMassHaloMassRelation(model=opt.LvvsMh_model)
+
+
+
+ # halo bins
+ lnMh = np.linspace(np.log10(opt.Mmin),np.log10(opt.Mmax),opt.N)
+ Mh0 = 10**lnMh
+
+
+ # define the DM models
+
+ # CDM
+ lnfmin = -opt.M0_var
+ lnfmax = +opt.M0_var
+ M0min = 10**(lnfmin) * opt.M0
+ M0max = 10**(lnfmax) * opt.M0
+ M0s = 10**np.linspace(lnfmin,lnfmax,opt.M0_N) * opt.M0
+
+ print("Minimal main halo mass:",M0min/opt.M0)
+ print("Maximal main halo mass:",M0max/opt.M0)
+
+ CDMs = []
+ WDMs = []
+ for M0 in M0s:
+ CDMs.append(satlib.GEN_Model(opt.Mmin,opt.Mmax,opt.N,MDM=None,fWDM=0,M0=M0))
+ WDMs.append(satlib.GEN_Model(opt.Mmin,opt.Mmax,opt.N,MDM=opt.DMmass,fWDM=1,M0=M0))
+
+
+
+ Nbins = 100
+ Nsats_CDM = np.zeros((opt.Ngal,Nbins-1))
+ Nsats_WDM = np.zeros((opt.Ngal,Nbins-1))
+
+
+ Ns_CDM_realisations = np.zeros((opt.Nrealisations,Nbins-1))
+ Ns_WDM_realisations = np.zeros((opt.Nrealisations,Nbins-1))
+
+ for realisation in tqdm(range(opt.Nrealisations)):
+
+ for j in range(opt.Ngal):
+
+ # find a random host halo mass between the desired mass range
+ rand = opt.M0* 10**np.random.uniform(lnfmin,lnfmax)
+ dd = np.absolute(M0s-rand)
+ # get the index
+ idx = np.argmin(dd)
+
+ # get the proper model
+ CDM = CDMs[idx]
+ WDM = WDMs[idx]
+
+
+ # number of haloes for the CDM
+ Nh_CDM = CDM.NumberOfHaloes()
+
+ # number of haloes for the WDM
+ Nh_WDM = WDM.NumberOfHaloes()
+
+
+
+
+ #################################################
+ # generate N haloes for the CDM
+ #################################################
+ Mhs = CDM.fctSample(np.random.random(Nh_CDM))
+
+ ###################
+ # loop over haloes
+ logLv = np.zeros(len(Mhs))
+
+ for i,Mh in enumerate(Mhs):
+ if Mh < 1e8:
+ continue
+
+ # find the nearest values in Mbins
+ # and set a Luminosity
+
+ idx = np.argmin( np.fabs( Mh-Mhbins ) )
+
+ logLvmins = np.log10(Lvmins[idx])
+ logLvmaxs = np.log10(Lvmaxs[idx])
+
+ logLv[i] = np.random.uniform(logLvmins,logLvmaxs)
+
+
+ ######################
+ # cumulative
+
+ bins = np.linspace(2,12,Nbins)
+ Ns,Lv = np.histogram(logLv,bins)
+
+ # now, need to cumulate
+ # invert vector first and reinvert after
+ Nsat = np.add.accumulate(Ns[-np.arange(1,len(Ns)+1)])
+ Nsat = Nsat[-np.arange(1,len(Nsat)+1)]
+ Lv = Lv[1:]
+ # add
+ Nsats_CDM[j] = Nsat
+
+
+
+
+ #################################################
+ # generate N haloes for the WDM
+ #################################################
+ Mhs = WDM.fctSample(np.random.random(Nh_WDM))
+
+
+ ###################
+ # loop over haloes
+ logLv = np.zeros(len(Mhs))
+
+ for i,Mh in enumerate(Mhs):
+ if Mh < 1e8:
+ continue
+
+ # find the nearest values in Mbins
+ # and set a Luminosity
+
+ idx = np.argmin( np.fabs( Mh-Mhbins ) )
+
+ logLvmins = np.log10(Lvmins[idx])
+ logLvmaxs = np.log10(Lvmaxs[idx])
+
+ logLv[i] = np.random.uniform(logLvmins,logLvmaxs)
+
+
+ ######################
+ # cumulative
+
+ bins = np.linspace(2,12,Nbins)
+ Ns,Lv = np.histogram(logLv,bins)
+
+ # now, need to cumulate
+ # invert vector first and reinvert after
+ Nsat = np.add.accumulate(Ns[-np.arange(1,len(Ns)+1)])
+ Nsat = Nsat[-np.arange(1,len(Nsat)+1)]
+ Lv = Lv[1:]
+ # add
+ Nsats_WDM[j] = Nsat
+
+
+ # plot individual galaxies
+ #pt.plot(10**Lv,Nsats_CDM[j],'blue',alpha=0.5)
+ #pt.plot(10**Lv,Nsats_WDM[j],'red' ,alpha=0.5)
+
+
+
+
+ Ns_CDM_mean = Nsats_CDM.mean(axis=0)
+ Ns_WDM_mean = Nsats_WDM.mean(axis=0)
+
+ Ns_CDM_realisations[realisation] = Ns_CDM_mean
+ Ns_WDM_realisations[realisation] = Ns_WDM_mean
+
+ # plot means
+ #pt.plot(10**Lv,Ns_CDM_mean,lw=1,alpha=0.5, c='blue')
+ #pt.plot(10**Lv,Ns_WDM_mean,lw=1,alpha=0.5, c='red')
+
+
+
+
+
+ Ns_CDM_realisations_mean = Ns_CDM_realisations.mean(axis=0)
+ Ns_CDM_realisations_std = Ns_CDM_realisations.std(axis=0)
+
+ Ns_CDM_meanp = Ns_CDM_realisations_mean + 3*Ns_CDM_realisations_std
+ Ns_CDM_meanm = Ns_CDM_realisations_mean - 3*Ns_CDM_realisations_std
+
+
+ Ns_WDM_realisations_mean = Ns_WDM_realisations.mean(axis=0)
+ Ns_WDM_realisations_std = Ns_WDM_realisations.std(axis=0)
+
+ Ns_WDM_meanp = Ns_WDM_realisations_mean + 3*Ns_WDM_realisations_std
+ Ns_WDM_meanm = Ns_WDM_realisations_mean - 3*Ns_WDM_realisations_std
+
+
+
+ ax = pt.gca()
+ ax.fill_between(10**Lv,Ns_CDM_meanp,Ns_CDM_meanm,facecolor='blue',alpha=0.5,label=r"$\textrm{CDM}$")
+ ax.fill_between(10**Lv,Ns_WDM_meanp,Ns_WDM_meanm,facecolor='red',alpha=0.5,label=r"$\textrm{WDM}$")
+
+
+
+
+
+ if opt.data:
+
+ ################################################################################
+ # add data from Nadler, Drlica etc.
+
+ ax = pt.gca()
+ s = 0.0
+ k = 1
+
+ def read_data(f):
+ data = np.loadtxt(f,delimiter=',')
+ Mv = data[:,0]
+ N = data[:,1]
+ Lv = pow(10, (4.74 - Mv) / 2.5)
+ return Lv, N
+
+
+ ###################
+ # Nadler
+
+ Lvp, Np = read_data("data/Nadler_rawt1.txt")
+ Lvm, Nm = read_data("data/Nadler_rawb1.txt")
+
+ ap = splrep(Lvp,Np,s=s,k=k)
+ am = splrep(Lvm,Nm,s=s,k=k)
+
+ Np= splev(Lvp,ap)
+ Nm= splev(Lvp,am)
+
+ #pt.plot(Lvp,Np,'k-')
+ #pt.plot(Lvm,Nm,'k-')
+ ax.fill_between(Lvp,Np,Nm,facecolor='green',alpha=0.05,label=r"$\textrm{Nadler\,\,et\,\,al.\,\,2018a}$")
+
+
+ Lvp, Np = read_data("data/Nadler_rawt2.txt")
+ Lvm, Nm = read_data("data/Nadler_rawb2.txt")
+
+ ap = splrep(Lvp,Np,s=s,k=k)
+ am = splrep(Lvm,Nm,s=s,k=k)
+
+ Np= splev(Lvp,ap)
+ Nm= splev(Lvp,am)
+
+ #pt.plot(Lvp,Np,'k-')
+ #pt.plot(Lvm,Nm,'k-')
+ ax.fill_between(Lvp,Np,Nm,facecolor='green',alpha=0.05)
+
+
+ ###################
+ # Drilca
+
+ Lv, N = read_data("data/Drlica_raw_weighted.txt")
+ pt.plot(Lv,N,'k-',label=r"$\textrm{DES+PS1,\,\,weighted\,\,(Drlica-Wagner\,\,et\,\,al.\,\,2020)}$",alpha=0.5)
+
+ Lv, N = read_data("data/Drlica_raw_detected.txt")
+ pt.plot(Lv,N,'k--',label=r"$\textrm{DES+PS1,\,\,detected\,\,(Drlica-Wagner\,\,et\,\,al.\,\,2020)}$",alpha=0.5)
+
+ Lv, N = read_data("data/Drlica_raw_all.txt")
+ pt.plot(Lv,N,'r-',label=r"$\textrm{All\,\,known\,\,satellites\,\,(Drlica-Wagner\,\,et\,\,al.\,\,2020)}$",alpha=0.5)
+
+
+
+
+ ###########################
+ # finalize
+ ###########################
+
+ xmin = 5e2
+ xmax = 5e9
+ ymin = 1
+ ymax = 500
+
+
+
+ xlabel = r"$\rm{V-band\,\,Luminosity}$"
+ ylabel = r"$\rm{Cumulative\,\,number\,\,of\,\,galaxies}\,\,(D<300\,\rm{kpc})$"
+
+ pt.SetAxis(xmin,xmax,ymin,ymax,log="xy")
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+ pt.grid(False)
+ pt.legend()
+
+ pt.title(r"$\rm{%d\,\,galaxies\,\,observed\,\,+\,\,model=%s}\,\,+\,\,M_{\rm{DM}}=%3.1f\,\rm{keV}$"%(opt.Ngal,opt.LvvsMh_model,opt.DMmass),fontsize=pt.labelfont)
+
+ pt.plot([1e5,1e5],[0.1,1000],c='k',ls=':')
+
+
+
+
+
+if __name__ == '__main__':
+
+ opt = parser.parse_args()
+ files = []
+
+ pt.InitPlot(files, opt)
+ pt.labelfont=20
+
+ # pt.figure(figsize=(8*2,6*2))
+ # pt.figure(dpi=10)
+
+ #fig = pt.gcf()
+ # fig.subplots_adjust(left=0.1)
+ # fig.subplots_adjust(right=1)
+ # fig.subplots_adjust(bottom=0.12)
+ # fig.subplots_adjust(top=0.95)
+ # fig.subplots_adjust(wspace=0.25)
+ # fig.subplots_adjust(hspace=0.02)
+
+ MakePlot(opt)
+ pt.EndPlot(files, opt)
+
+
+
+
diff --git a/Workspace/CumNumOfSat/satComputeNCumvsLvWithErrors_forOliver.py b/Workspace/CumNumOfSat/satComputeNCumvsLvWithErrors_forOliver.py
new file mode 100755
index 0000000..53c9718
--- /dev/null
+++ b/Workspace/CumNumOfSat/satComputeNCumvsLvWithErrors_forOliver.py
@@ -0,0 +1,411 @@
+#!/usr/bin/env python3
+
+import sys,os,string
+
+import argparse
+import satlib
+import numpy as np
+import Ptools as pt
+import pickle
+from scipy.interpolate import splrep,splev
+from tqdm import tqdm
+
+####################################################################
+# option parser
+####################################################################
+
+description=""
+epilog =""""""
+
+parser = argparse.ArgumentParser(description=description,epilog=epilog,formatter_class=argparse.RawDescriptionHelpFormatter)
+
+
+parser.add_argument("--M0",
+ action="store",
+ dest="M0",
+ metavar='FLOAT',
+ type=float,
+ default=1e12,
+ help='host halo mass')
+
+
+parser.add_argument("--Mmin",
+ action="store",
+ dest="Mmin",
+ metavar='FLOAT',
+ type=float,
+ default=5e7,
+ help='the min halo mass')
+
+
+parser.add_argument("--Mmax",
+ action="store",
+ dest="Mmax",
+ metavar='FLOAT',
+ type=float,
+ default=1e11,
+ help='the max halo mass')
+
+parser.add_argument("--DMmass",
+ action="store",
+ dest="DMmass",
+ metavar='FLOAT',
+ type=float,
+ default=2.0,
+ help='dark matter particle mass')
+
+
+parser.add_argument("-N",
+ action="store",
+ dest="N",
+ metavar='INT',
+ type=int,
+ default=1000,
+ help='number of bins')
+
+
+parser.add_argument("--Ngal",
+ action="store",
+ dest="Ngal",
+ metavar='INT',
+ type=int,
+ default=100,
+ help='number of galaxies')
+
+
+parser.add_argument("--Nrealisations",
+ action="store",
+ dest="Nrealisations",
+ metavar='INT',
+ type=int,
+ default=100,
+ help='number of realizations')
+
+
+
+parser.add_argument("--LvvsMh_model",
+ action="store",
+ type=str,
+ dest="LvvsMh_model",
+ default = 'rj2018',
+ help="Lv Mh model")
+
+
+parser.add_argument("-p",
+ action="store",
+ dest="ps",
+ metavar='FILE NAME',
+ type=str,
+ default=None,
+ help='output file name')
+
+parser.add_argument("--dpi",
+ action="store",
+ dest="dpi",
+ type=float,
+ default=300,
+ help="DPI of the saved file",
+ metavar=" FLOAT")
+
+parser.add_argument("--data",
+ action="store_true",
+ dest="data",
+ default=False,
+ help='add data')
+
+
+parser.add_argument("--filter",
+ action="store",
+ dest="filter",
+ metavar='STR',
+ type=str,
+ default=None,
+ help='filter name')
+
+parser.add_argument("--distance",
+ action="store",
+ dest="distance",
+ type=float,
+ default=35,
+ help="distance in Mpc",
+ metavar=" FLOAT")
+
+####################################################################
+# main
+####################################################################
+
+
+def MakePlot(opt):
+
+
+ # get Mh vs Lv relation
+ Mhbins,Lvmins,Lvmaxs = satlib.GetStellarMassHaloMassRelation(model=opt.LvvsMh_model)
+
+
+
+ # halo bins
+ lnMh = np.linspace(np.log10(opt.Mmin),np.log10(opt.Mmax),opt.N)
+ Mh0 = 10**lnMh
+
+
+ # define the DM models
+ #CDM = satlib.CDM_Sawala_Model(opt.Mmin,opt.Mmax,opt.N)
+ #WDM = satlib.CDM_Forouhar_Model(opt.Mmin,opt.Mmax,opt.N)
+ CDM = satlib.GEN_Model(opt.Mmin,opt.Mmax,opt.N,MDM=None,fWDM=0,M0=opt.M0)
+
+
+
+ # number of haloes for the CDM
+ Nh_CDM = CDM.NumberOfHaloes()
+
+
+ Nbins = 100
+ Nsats_CDM = np.zeros((opt.Ngal,Nbins-1))
+
+ Ns_CDM_realisations = np.zeros((opt.Nrealisations,Nbins-1))
+
+ for realisation in tqdm(range(opt.Nrealisations)):
+
+ for j in range(opt.Ngal):
+
+ #print(realisation,j)
+
+ #################################################
+ # generate N haloes for the CDM
+ #################################################
+ Mhs = CDM.fctSample(np.random.random(Nh_CDM))
+
+ ###################
+ # loop over haloes
+ logLv = np.zeros(len(Mhs))
+
+ for i,Mh in enumerate(Mhs):
+ if Mh < 1e8:
+ continue
+
+ # find the nearest values in Mbins
+ # and set a Luminosity
+
+ idx = np.argmin( np.fabs( Mh-Mhbins ) )
+
+ logLvmins = np.log10(Lvmins[idx])
+ logLvmaxs = np.log10(Lvmaxs[idx])
+
+ logLv[i] = np.random.uniform(logLvmins,logLvmaxs)
+
+
+ ######################
+ # cumulative
+
+ bins = np.linspace(2,12,Nbins)
+ Ns,Lv = np.histogram(logLv,bins)
+
+ # now, need to cumulate
+ # invert vector first and reinvert after
+ Nsat = np.add.accumulate(Ns[-np.arange(1,len(Ns)+1)])
+ Nsat = Nsat[-np.arange(1,len(Nsat)+1)]
+ Lv = Lv[1:]
+ # add
+ Nsats_CDM[j] = Nsat
+
+
+
+
+
+ Ns_CDM_mean = Nsats_CDM.mean(axis=0)
+
+ Ns_CDM_realisations[realisation] = Ns_CDM_mean
+
+ # plot means
+ #pt.plot(10**Lv,Ns_CDM_mean,lw=1,alpha=0.5, c='blue')
+ #pt.plot(10**Lv,Ns_WDM_mean,lw=1,alpha=0.5, c='red')
+
+
+
+
+
+ Ns_CDM_realisations_mean = Ns_CDM_realisations.mean(axis=0)
+ Ns_CDM_realisations_std = Ns_CDM_realisations.std(axis=0)
+
+ Ns_CDM_meanp = Ns_CDM_realisations_mean + 3*Ns_CDM_realisations_std
+ Ns_CDM_meanm = Ns_CDM_realisations_mean - 3*Ns_CDM_realisations_std
+
+
+
+ if opt.filter is not None:
+ # convert Lv assumed to be Msol in Mag
+
+ Mag = np.zeros(len(Lv))
+ for i in range(len(Lv)):
+ Mag[i] = satlib.Msol2Mag(10**Lv[i],filter=opt.filter)
+
+ # to apparent magnitude
+ opt.distance = opt.distance * 1e6 # Mpc to pc
+ Mag = Mag + 5*np.log10(opt.distance) - 5
+
+
+ ax = pt.gca()
+ ax.fill_between(Mag,Ns_CDM_meanp,Ns_CDM_meanm,facecolor='blue',alpha=0.5,label=r"$\textrm{CDM}$")
+
+ xmin = 30
+ xmax = 15
+ ymin = 1
+ ymax = 500
+
+ pt.SetAxis(xmin,xmax,ymin,ymax,log="y")
+ xlabel = r"$\rm{%s\,\,mag}$"%(opt.filter)
+
+ # 1e5 Msol
+ pt.plot([23.2,23.2],[0.1,1000],c='k',ls=':')
+
+
+ else:
+ ax = pt.gca()
+ ax.fill_between(10**Lv,Ns_CDM_meanp,Ns_CDM_meanm,facecolor='blue',alpha=0.5,label=r"$\textrm{CDM}$")
+
+ xmin = 5e2
+ xmax = 5e9
+ ymin = 1
+ ymax = 500
+
+ pt.SetAxis(xmin,xmax,ymin,ymax,log="xy")
+ xlabel = r"$\rm{V-band\,\,Luminosity}$"
+
+ pt.plot([1e5,1e5],[0.1,1000],c='k',ls=':')
+
+
+ '''
+
+ if opt.data:
+
+ ################################################################################
+ # add data from Nadler, Drlica etc.
+
+ ax = pt.gca()
+ s = 0.0
+ k = 1
+
+ def read_data(f):
+ data = np.loadtxt(f,delimiter=',')
+ Mv = data[:,0]
+ N = data[:,1]
+ Lv = pow(10, (4.74 - Mv) / 2.5)
+ return Lv, N
+
+
+ ###################
+ # Nadler
+
+ Lvp, Np = read_data("data/Nadler_rawt1.txt")
+ Lvm, Nm = read_data("data/Nadler_rawb1.txt")
+
+ ap = splrep(Lvp,Np,s=s,k=k)
+ am = splrep(Lvm,Nm,s=s,k=k)
+
+ Np= splev(Lvp,ap)
+ Nm= splev(Lvp,am)
+
+ #pt.plot(Lvp,Np,'k-')
+ #pt.plot(Lvm,Nm,'k-')
+ ax.fill_between(Lvp,Np,Nm,facecolor='green',alpha=0.05,label=r"$\textrm{Nadler\,\,et\,\,al.\,\,2018a}$")
+
+
+ Lvp, Np = read_data("data/Nadler_rawt2.txt")
+ Lvm, Nm = read_data("data/Nadler_rawb2.txt")
+
+ ap = splrep(Lvp,Np,s=s,k=k)
+ am = splrep(Lvm,Nm,s=s,k=k)
+
+ Np= splev(Lvp,ap)
+ Nm= splev(Lvp,am)
+
+ #pt.plot(Lvp,Np,'k-')
+ #pt.plot(Lvm,Nm,'k-')
+ ax.fill_between(Lvp,Np,Nm,facecolor='green',alpha=0.05)
+
+
+ ###################
+ # Drilca
+
+ Lv, N = read_data("data/Drlica_raw_weighted.txt")
+ pt.plot(Lv,N,'k-',label=r"$\textrm{DES+PS1,\,\,weighted\,\,(Drlica-Wagner\,\,et\,\,al.\,\,2020)}$",alpha=0.5)
+
+ Lv, N = read_data("data/Drlica_raw_detected.txt")
+ pt.plot(Lv,N,'k--',label=r"$\textrm{DES+PS1,\,\,detected\,\,(Drlica-Wagner\,\,et\,\,al.\,\,2020)}$",alpha=0.5)
+
+ Lv, N = read_data("data/Drlica_raw_all.txt")
+ pt.plot(Lv,N,'r-',label=r"$\textrm{All\,\,known\,\,satellites\,\,(Drlica-Wagner\,\,et\,\,al.\,\,2020)}$",alpha=0.5)
+
+ '''
+
+ # Oliver data
+ Lv = np.array([5.91561634e+06, 2.14783047e+07, 8.55066713e+07, 1.12719746e+06,
+ 3.73250158e+07, 1.95884467e+08, 2.83139200e+06, 3.73250158e+07,
+ 1.78648757e+06, 1.02801630e+08, 2.83139200e+05, 4.09260660e+08,
+ 5.91561634e+06])
+
+ logLv = np.log10(Lv)
+
+ bins = np.array([5,5.5,6,6.5,7,7.5,8])
+ bins = np.linspace(4,9,20)
+
+ h,bins = np.histogram(logLv, bins=bins)
+
+ h = np.flip(h)
+ h = np.add.accumulate(h)
+ h = np.flip(h)
+
+ #pt.scatter(10**bins[1:],h,marker='s',color="k",s=50,label=r'$\rm{M83}$')
+ pt.plot(10**bins[1:],h,color="k",label=r'$\rm{M83}$')
+
+
+
+ ###########################
+ # finalize
+ ###########################
+
+
+
+
+
+ ylabel = r"$\rm{Cumulative\,\,number\,\,of\,\,galaxies}\,\,(D<300\,\rm{kpc})$"
+
+
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+ pt.grid(False)
+ pt.legend()
+
+ pt.title(r"$\rm{%d\,\,galaxies\,\,observed\,\,+\,\,model=%s}$"%(opt.Ngal,opt.LvvsMh_model),fontsize=pt.labelfont)
+
+ #pt.plot([1e5,1e5],[0.1,1000],c='k',ls=':')
+
+
+
+
+
+if __name__ == '__main__':
+
+ opt = parser.parse_args()
+ files = []
+
+ pt.InitPlot(files, opt)
+ pt.labelfont=20
+
+ # pt.figure(figsize=(8*2,6*2))
+ # pt.figure(dpi=10)
+
+ #fig = pt.gcf()
+ # fig.subplots_adjust(left=0.1)
+ # fig.subplots_adjust(right=1)
+ # fig.subplots_adjust(bottom=0.12)
+ # fig.subplots_adjust(top=0.95)
+ # fig.subplots_adjust(wspace=0.25)
+ # fig.subplots_adjust(hspace=0.02)
+
+ MakePlot(opt)
+ pt.EndPlot(files, opt)
+
+
+
+
diff --git a/Workspace/CumNumOfSat/satComputeNvsM.py b/Workspace/CumNumOfSat/satComputeNvsM.py
new file mode 100755
index 0000000..0c29e17
--- /dev/null
+++ b/Workspace/CumNumOfSat/satComputeNvsM.py
@@ -0,0 +1,176 @@
+#!/usr/bin/env python3
+
+import sys,os,string
+
+import argparse
+import satlib
+import numpy as np
+import Ptools as pt
+import pickle
+from scipy.interpolate import splrep,splev
+from tqdm import tqdm
+
+
+####################################################################
+# option parser
+####################################################################
+
+description=""
+epilog =""""""
+
+parser = argparse.ArgumentParser(description=description,epilog=epilog,formatter_class=argparse.RawDescriptionHelpFormatter)
+
+parser.add_argument("--M0",
+ action="store",
+ dest="M0",
+ metavar='FLOAT',
+ type=float,
+ default=1e12,
+ help='host halo mass')
+
+parser.add_argument("--Mmin",
+ action="store",
+ dest="Mmin",
+ metavar='FLOAT',
+ type=float,
+ default=5e6,
+ help='the min halo mass')
+
+
+parser.add_argument("--Mmax",
+ action="store",
+ dest="Mmax",
+ metavar='FLOAT',
+ type=float,
+ default=1e9,
+ help='the max halo mass')
+
+parser.add_argument("--DMmass",
+ action="store",
+ dest="DMmass",
+ metavar='FLOAT',
+ type=float,
+ default=2.0,
+ help='dark matter particle mass')
+
+
+parser.add_argument("-N",
+ action="store",
+ dest="N",
+ metavar='INT',
+ type=int,
+ default=1000,
+ help='number of bins')
+
+
+parser.add_argument("--Ngal",
+ action="store",
+ dest="Ngal",
+ metavar='INT',
+ type=int,
+ default=100,
+ help='number of galaxies')
+
+parser.add_argument("--Nrealisations",
+ action="store",
+ dest="Nrealisations",
+ metavar='INT',
+ type=int,
+ default=100,
+ help='number of realizations')
+
+parser.add_argument("-p",
+ action="store",
+ dest="ps",
+ metavar='FILE NAME',
+ type=str,
+ default=None,
+ help='output file name')
+
+parser.add_argument("--dpi",
+ action="store",
+ dest="dpi",
+ type=float,
+ default=300,
+ help="DPI of the saved file",
+ metavar=" FLOAT")
+
+
+####################################################################
+# main
+####################################################################
+
+def MakePlot(opt):
+
+
+ # halo bins
+ lnMh = np.linspace(np.log10(opt.Mmin),np.log10(opt.Mmax),opt.N)
+ Mh0 = 10**lnMh
+
+ # define the DM models
+ #CDM = satlib.CDM_Sawala_Model(opt.Mmin,opt.Mmax,opt.N)
+ #WDM = satlib.CDM_Forouhar_Model(opt.Mmin,opt.Mmax,opt.N)
+
+ CDM = satlib.GEN_Model(opt.Mmin,opt.Mmax,opt.N,MDM=None,fWDM=0,M0=opt.M0)
+ pt.plot(CDM.mbin,CDM.Nsat,label=r"$\rm{CDM}$")
+
+ Ms = [3,5,7,9]
+
+ for DMmass in Ms:
+ print(DMmass)
+
+ WDM = satlib.GEN_Model(opt.Mmin,opt.Mmax,opt.N,MDM=DMmass,fWDM=1,M0=opt.M0)
+ pt.plot(WDM.mbin,WDM.Nsat,label=r"$%d\,\rm{keV}$"%DMmass)
+
+
+
+
+
+ ###########################
+ # finalize
+ ###########################
+
+ xmin = opt.Mmin
+ xmax = opt.Mmax
+ ymin = 8
+ ymax = 3e2
+
+ xlabel = r"$\rm{Halo\,\,Mass\,\,(M_{\rm halo})}\,\,[M_{\odot}]$"
+ ylabel = r"$dN/dm$"
+
+ pt.SetAxis(xmin,xmax,ymin,ymax,log="xy")
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+ pt.grid(False)
+
+ #pt.title(r"$\rm{%d\,\,galaxies\,\,observed}$"%opt.Ngal,fontsize=pt.labelfont)
+ pt.legend()
+
+
+
+
+
+
+
+if __name__ == '__main__':
+
+ opt = parser.parse_args()
+ files = []
+
+ pt.InitPlot(files, opt)
+ pt.labelfont=20
+
+ # pt.figure(figsize=(8*2,6*2))
+ # pt.figure(dpi=10)
+
+ #fig = pt.gcf()
+ # fig.subplots_adjust(left=0.1)
+ # fig.subplots_adjust(right=1)
+ # fig.subplots_adjust(bottom=0.12)
+ # fig.subplots_adjust(top=0.95)
+ # fig.subplots_adjust(wspace=0.25)
+ # fig.subplots_adjust(hspace=0.02)
+
+ MakePlot(opt)
+ pt.EndPlot(files, opt)
+
diff --git a/Workspace/CumNumOfSat/satComputedNdM.py b/Workspace/CumNumOfSat/satComputedNdM.py
new file mode 100755
index 0000000..4116cd5
--- /dev/null
+++ b/Workspace/CumNumOfSat/satComputedNdM.py
@@ -0,0 +1,304 @@
+#!/usr/bin/env python3
+
+import sys,os,string
+
+import argparse
+import satlib
+import numpy as np
+import Ptools as pt
+import pickle
+from scipy.interpolate import splrep,splev
+
+from scipy.integrate import cumtrapz, trapz
+from classy import Class
+import genmassfct as gmf
+
+####################################################################
+# option parser
+####################################################################
+
+description=""
+epilog =""""""
+
+parser = argparse.ArgumentParser(description=description,epilog=epilog,formatter_class=argparse.RawDescriptionHelpFormatter)
+
+
+
+parser.add_argument("--Mmin",
+ action="store",
+ dest="Mmin",
+ metavar='FLOAT',
+ type=float,
+ default=5e7,
+ help='the min halo mass')
+
+
+parser.add_argument("--Mmax",
+ action="store",
+ dest="Mmax",
+ metavar='FLOAT',
+ type=float,
+ default=1e11,
+ help='the max halo mass')
+
+
+parser.add_argument("--Mh",
+ action="store",
+ dest="Mh",
+ metavar='FLOAT',
+ type=float,
+ default=1e12,
+ help='halo mass')
+
+
+parser.add_argument("--DMmass",
+ action="store",
+ dest="DMmass",
+ metavar='FLOAT',
+ type=float,
+ default=2.0,
+ help='dark matter particle mass')
+
+
+
+parser.add_argument("-o","--outputfile",
+ action="store",
+ type=str,
+ dest="outputfile",
+ default = None,
+ help="output file name")
+
+parser.add_argument("-p",
+ action="store",
+ dest="ps",
+ metavar='FILE NAME',
+ type=str,
+ default=None,
+ help='output file name')
+
+parser.add_argument("--dpi",
+ action="store",
+ dest="dpi",
+ type=float,
+ default=300,
+ help="DPI of the saved file",
+ metavar=" FLOAT")
+
+
+
+parser.add_argument("-N",
+ action="store",
+ dest="N",
+ metavar='INT',
+ type=int,
+ default=1000,
+ help='number of bins')
+
+
+
+
+def ps_class(cosmopars):
+ """
+ Calculate power spectrum with CLASS
+ """
+
+ Om, Ob, As, h0, ns, mWDM, fWDM = cosmopars
+
+
+ if (fWDM>0):
+
+ m_nu = 4.43*mWDM**(4./3)*((Om-Ob)*h0**2/0.1225)**(-1./3)
+
+ CLASSparams = {
+ 'h': h0,
+ 'T_cmb': 2.726,
+ 'Omega_b': Ob,
+ 'Omega_cdm': (1-fWDM)*(Om-Ob),
+ 'Omega_ncdm': fWDM*(Om-Ob),
+ 'N_ur': 3.04,
+ 'N_ncdm': 1,
+ 'm_ncdm': 1000*m_nu,
+ 'T_ncdm': 0.715985,
+ 'n_s': ns,
+ 'A_s': As,
+ 'P_k_max_h/Mpc': 200,
+ 'k_per_decade_for_pk': 10,
+ 'output': 'mPk',
+ 'z_pk': 0.0,
+ 'ncdm_fluid_approximation': 3,
+ }
+ else:
+
+ CLASSparams = {
+ 'h': h0,
+ 'T_cmb': 2.726,
+ 'Omega_b': Ob,
+ 'Omega_cdm': (Om-Ob),
+ 'N_ur': 3.04,
+ 'n_s': ns,
+ 'A_s': As,
+ 'P_k_max_h/Mpc': 200,
+ 'k_per_decade_for_pk': 10,
+ 'output': 'mPk',
+ 'z_pk': 0.0,
+ 'ncdm_fluid_approximation': 1,
+ }
+
+ CLASScosmo = Class()
+ CLASScosmo.set(CLASSparams)
+ CLASScosmo.compute()
+ s8 = CLASScosmo.sigma8()
+ print("s8 = ",s8)
+ k_bin = np.logspace(np.log10(1e-3), np.log10(200), 500) #in [h/Mpc]
+ z_bin = np.array([0])
+ pk_bin = []
+ for i in range(len(k_bin)):
+ pk_bin += [CLASScosmo.pk_lin(k_bin[i]*h0,0)]
+
+ pk_bin = np.array(pk_bin)*h0**3 # [Mpc/h]^3
+
+ CLASScosmo.struct_cleanup()
+ CLASScosmo.empty()
+
+ return k_bin, pk_bin
+
+
+def Nsat_integral(mbin,dNsatdlnm):
+ """
+ Cumulative mass function Nsat(>M)
+ """
+
+ Nsat = trapz(dNsatdlnm/mbin,mbin) - cumtrapz(dNsatdlnm/mbin,mbin,initial=dNsatdlnm[0]/mbin[0])
+
+ return Nsat
+
+
+
+
+
+####################################################################
+# main
+####################################################################
+
+
+
+
+
+
+def MakePlot(opt):
+
+ #Cosmology
+ Om = 0.315
+ Ob = 0.048
+ h0 = 0.681
+ As = 2.07e-9
+ ns = 0.963
+
+ ##################################
+ # CDM
+ ##################################
+
+ mWDM = None # DM mass in keV
+ fWDM = 0.0 # fraction of wdm
+ cosmopars = Om, Ob, As, h0, ns, mWDM, fWDM
+
+ #calculate power spectrum
+ kbin, PSbin = ps_class(cosmopars)
+ body = np.transpose([kbin, PSbin])
+ filename = 'CDM_pk.dat'
+ np.savetxt(filename,body,delimiter='\t')
+
+ #WDM
+ mWDM = opt.DMmass # DM mass in keV
+ fWDM = 1.0 # fraction of wdm
+ cosmopars = Om, Ob, As, h0, ns, mWDM, fWDM
+
+ #calculate power spectrum
+ kbin, PSbin = ps_class(cosmopars)
+ body = np.transpose([kbin, PSbin])
+ filename = 'WDM_pk.dat'
+ np.savetxt(filename,body,delimiter='\t')
+
+
+ #Host halo mass (Msun/h)
+ M0 = 1e12
+
+ #redshift
+ z0 = 0
+
+ #initialise parameters
+ par = gmf.par()
+ par.window.window = "sharpk"
+ par.code.rmin = 0.008
+ par.mf.q = 1.0
+ par.mf.p = 0.3
+ par.mf.c = 2.5
+
+
+ #Calculate stellite function for CDM
+ par.file.psfct = "CDM_pk.dat"
+ mbin_CDM, dNsatdlnM_CDM = gmf.dNsatdlnm(M0,z0,par)
+ Nsat_CDM = Nsat_integral(mbin_CDM,dNsatdlnM_CDM)
+
+
+ #Calculate stellite function for WDM
+ par.file.psfct = "WDM_pk.dat"
+ mbin_WDM, dNsatdlnM_WDM = gmf.dNsatdlnm(M0,z0,par)
+ Nsat_WDM = Nsat_integral(mbin_WDM,dNsatdlnM_WDM)
+
+
+ pt.loglog(mbin_CDM, Nsat_CDM, color='black',ls='-',label="CDM")
+ pt.loglog(mbin_WDM, Nsat_WDM, color='blue' ,ls='-',label="WDM")
+
+ #pt.axis([1e7,4e12,0.0001,1000])
+
+ pt.ylabel(r'Nsat(>M)')
+ pt.xlabel(r'M [M$_{\odot}$/h]')
+
+
+ ########################
+ # add sawala
+
+ Mh0 = M0
+
+ import satlib
+
+ lnMh = np.linspace(np.log10(opt.Mmin),np.log10(opt.Mmax),opt.N)
+ Mh = 10**lnMh
+
+
+ NM_CDM = satlib.CDM_CumulativeMass(Mh)
+ NM_WDM = satlib.fctWDM_CumulativeMass(Mh)
+
+ pt.loglog(Mh,NM_WDM,label="yrWDM")
+ pt.loglog(Mh,NM_CDM,label="yrCDM")
+
+
+ pt.axis([1e7,4e12,0.0001,1000])
+
+ pt.legend()
+
+
+if __name__ == '__main__':
+
+ opt = parser.parse_args()
+ files = []
+
+ pt.InitPlot(files, opt)
+ pt.labelfont=20
+
+ # pt.figure(figsize=(8*2,6*2))
+ # pt.figure(dpi=10)
+
+ #fig = pt.gcf()
+ # fig.subplots_adjust(left=0.1)
+ # fig.subplots_adjust(right=1)
+ # fig.subplots_adjust(bottom=0.12)
+ # fig.subplots_adjust(top=0.95)
+ # fig.subplots_adjust(wspace=0.25)
+ # fig.subplots_adjust(hspace=0.02)
+
+ MakePlot(opt)
+ pt.EndPlot(files, opt)
+
+
diff --git a/Workspace/CumNumOfSat/satlib.py b/Workspace/CumNumOfSat/satlib.py
new file mode 100644
index 0000000..0e990ac
--- /dev/null
+++ b/Workspace/CumNumOfSat/satlib.py
@@ -0,0 +1,644 @@
+
+import numpy as np
+from scipy import special
+from scipy.integrate import quad
+
+
+a = 1.859e9 # to fit Sawala 2017
+b = -1.915 # to fit Sawala 2017
+
+def CDM_DistributionFunction(Mh):
+ '''
+ dN/dM :
+ '''
+ dNdM = a *(Mh)**b
+ return dNdM
+
+
+def CDM_CumulativeMass(Mh):
+ NM = -a*(Mh)**(b+1)/(b+1)
+ return NM
+
+
+
+def WDMCDMRatio(Mhs):
+ """
+ Ratio of the halo mass function of the WDM to CDM (Forouhar 2023)
+ """
+ lnMhs = np.log10(Mhs)
+ f = np.array([0,0.004,0.008,0.025,0.092,0.253,0.396,0.485,0.620,0.746,0.827,0.869,0.873,0.936,1])
+ lnMh = np.array([7,7.176,7.549,7.934,8.367,8.900,9.244,9.457,9.742,10.00,10.35,10.55,11.10,11.38,11.63])
+ fs = np.interp(lnMhs,lnMh,f)
+ return fs
+
+
+# cumulative mass fct from CDM_CumulativeMass
+fctCDM_CumulativeMass = np.vectorize(lambda x: quad( lambda M: CDM_DistributionFunction(M) ,x, 1e12)[0])
+
+
+# cumulative mass fct from CDM_CumulativeMass
+fctWDM_CumulativeMass = np.vectorize(lambda x: quad( lambda M: CDM_DistributionFunction(M)*WDMCDMRatio(M) ,x, 1e12)[0])
+
+
+
+
+
+def GetStellarMassHaloMassRelation(model='rj2018'):
+
+ if model=="rj2018":
+
+ import pickle
+ # read Mh vs Lv
+ f = open("MsvsMh_2018.pkl","rb")
+ Mhbins = pickle.load(f,encoding="latin1")
+ Lvmins = pickle.load(f,encoding="latin1")
+ Lvmaxs = pickle.load(f,encoding="latin1")
+ f.close()
+
+ return Mhbins,Lvmins,Lvmaxs
+
+
+ elif model=="model1":
+
+ Mhbins = np.linspace(7,11,20)
+
+ data = np.loadtxt("sales2022/MsMh_low_1.txt")
+ Mh1 = data[:,0]
+ Msl = data[:,1]
+ Lvmins = np.interp(Mhbins,Mh1,Msl)
+
+ data = np.loadtxt("sales2022/MsMh_high_1.txt")
+ Mh1 = data[:,0]
+ Msu = data[:,1]
+ Lvmaxs = np.interp(Mhbins,Mh1,Msu)
+
+ return 10**Mhbins,10**Lvmins,10**Lvmaxs
+
+
+ elif model=="model2":
+
+ Mhbins = np.linspace(7,11,20)
+
+ data = np.loadtxt("sales2022/MsMh_low_2.txt")
+ Mh1 = data[:,0]
+ Msl = data[:,1]
+ Lvmins = np.interp(Mhbins,Mh1,Msl)
+
+ data = np.loadtxt("sales2022/MsMh_high_2.txt")
+ Mh1 = data[:,0]
+ Msu = data[:,1]
+ Lvmaxs = np.interp(Mhbins,Mh1,Msu)
+
+ return 10**Mhbins,10**Lvmins,10**Lvmaxs
+
+
+ elif model=="model3":
+
+ Mhbins = np.linspace(7,11,20)
+
+ data = np.loadtxt("sales2022/MsMh_low_3.txt")
+ Mh1 = data[:,0]
+ Msl = data[:,1]
+ Lvmins = np.interp(Mhbins,Mh1,Msl)
+
+ data = np.loadtxt("sales2022/MsMh_high_3.txt")
+ Mh1 = data[:,0]
+ Msu = data[:,1]
+ Lvmaxs = np.interp(Mhbins,Mh1,Msu)
+
+ return 10**Mhbins,10**Lvmins,10**Lvmaxs
+
+
+
+ elif model=="model4":
+
+ Mhbins = np.linspace(7,11,20)
+
+ data = np.loadtxt("sales2022/MsMh_low_4.txt")
+ Mh1 = data[:,0]
+ Msl = data[:,1]
+ Lvmins = np.interp(Mhbins,Mh1,Msl)
+
+ data = np.loadtxt("sales2022/MsMh_high_4.txt")
+ Mh1 = data[:,0]
+ Msu = data[:,1]
+ Lvmaxs = np.interp(Mhbins,Mh1,Msu)
+
+ return 10**Mhbins,10**Lvmins,10**Lvmaxs
+
+
+
+
+class DM_Model():
+
+ def __init__(self,Mmin,Mmax,N):
+
+ self.Mmin = Mmin # minimal halo mass
+ self.Mmax = Mmax # maximal halo mass
+ self.N = N # number of mass bins
+
+ # halo mass bins
+ self.Mh = 10**np.linspace(np.log10(self.Mmin),np.log10(self.Mmax),self.N)
+
+
+
+ def DistributionFunction(self,Mh):
+ '''
+ return the dark matter distribution function
+ i.e., dN/dM
+ '''
+ pass
+
+
+ def CumulativeMass(self,Mh):
+ '''
+ return the cumulative halo mass
+ '''
+ pass
+
+
+ def NumberOfHaloes(self):
+ '''
+ return the number of haloes
+ '''
+ return int(self.CumulativeMass(self.Mmin))
+
+
+##############################################
+# CDM from Sawala 2017 fit
+##############################################
+
+class CDM_Sawala_Model(DM_Model):
+
+ def __init__(self,Mmin,Mmax,N):
+
+
+ # do the initialisation
+ super().__init__(Mmin,Mmax,N)
+
+
+ self.a = 1.859e9 # to fit Sawala 2017
+ self.b = -1.915 # to fit Sawala 2017
+
+ # cumulative number of haloes
+ NM = self.CumulativeMass()
+
+ # compute the sampling function
+ self.fctSample = np.vectorize( lambda x: 10**np.interp(x, NM[::-1]/NM.max(), np.log10(self.Mh[::-1])) )
+
+
+
+ def DistributionFunction(self,Mh=None):
+ '''
+ return the dark matter distribution function
+ i.e., dN/dM
+ '''
+ if Mh is None:
+ Mh = self.Mh
+
+ dNdM = self.a *(Mh)**self.b
+ return dNdM
+
+
+ def CumulativeMass(self,Mh=None):
+ '''
+ return the cumulative halo mass
+ '''
+
+ if Mh is None:
+ Mh = self.Mh
+
+ NM = -self.a*(Mh)**(self.b+1)/(self.b+1)
+ return NM
+
+
+
+
+
+##############################################
+# WDM from Sawala 2017 + Forouhar 2023
+##############################################
+
+class CDM_Forouhar_Model(DM_Model):
+
+ def __init__(self,Mmin,Mmax,N):
+
+
+ # do the initialisation
+ super().__init__(Mmin,Mmax,N)
+
+ self.CDM = CDM_Sawala_Model(Mmin,Mmax,N)
+
+ # cumulative mass fct from CDM_CumulativeMass
+ self.fctCumulativeMass = np.vectorize(lambda x: quad( lambda M: self.DistributionFunction(M),x, 1e12)[0])
+
+
+
+ # cumulative number of haloes
+ NM = self.CumulativeMass()
+
+ # compute the sampling function
+ self.fctSample = np.vectorize( lambda x: 10**np.interp(x, NM[::-1]/NM.max(), np.log10(self.Mh[::-1])) )
+
+
+
+
+ def DistributionFunction(self,Mh=None):
+ '''
+ return the dark matter distribution function
+ i.e., dN/dM
+ '''
+ if Mh is None:
+ Mh = self.Mh
+
+ dNdM = self.CDM.DistributionFunction(Mh)*self.WDMCDMRatio(Mh)
+ return dNdM
+
+
+ def CumulativeMass(self,Mh=None):
+ '''
+ return the cumulative halo mass
+ '''
+ if Mh is None:
+ Mh = self.Mh
+
+ return self.fctCumulativeMass(Mh)
+
+
+
+
+ def WDMCDMRatio(self,Mh=None):
+ """
+ Ratio of the halo mass function of the WDM to CDM (Forouhar 2023)
+ """
+ if Mh is None:
+ Mh = self.Mh
+
+ lnMhs = np.log10(Mh)
+ f = np.array([0,0.004,0.008,0.025,0.092,0.253,0.396,0.485,0.620,0.746,0.827,0.869,0.873,0.936,1])
+ lnMh = np.array([7,7.176,7.549,7.934,8.367,8.900,9.244,9.457,9.742,10.00,10.35,10.55,11.10,11.38,11.63])
+ fs = np.interp(lnMhs,lnMh,f)
+ return fs
+
+
+##############################################
+# WDM from Bode, Ostriker & Turok (2001)
+# Viel 2005 (nu updated)
+##############################################
+# Note : here we avoid to use classy to get
+# the power spectrum
+
+from scipy.integrate import cumtrapz, trapz
+import genmassfct as gm
+
+
+class GEN_Model(DM_Model):
+
+ def __init__(self,Mmin,Mmax,N,MDM=2,fWDM=0,M0=1e12,Om=0.315,h0=0.674):
+
+ # do the initialisation
+ super().__init__(Mmin,Mmax,N)
+
+ # unperturbed power spectrum filename
+ filename = './CDM_PS.dat'
+ # temporary file
+ self.filename = '/tmp/powerspectrum_pk.dat'
+
+ k, pk = np.loadtxt(filename, unpack=True, usecols = (0,1))
+ if MDM is not None:
+ Pk = self.Transfer(k,pk,MDM,Om,h0)
+ else:
+ Pk = pk
+
+ # save (needed for )
+ body = np.transpose([k, Pk])
+ np.savetxt(self.filename,body,delimiter='\t')
+
+
+ # initialise parameters
+ par = gmf.par()
+ par.window.window = "sharpk"
+ par.code.rmin = 0.008
+ par.mf.q = 1.0
+ par.mf.p = 0.3
+ par.mf.c = 2.5
+
+ # redshift
+ z0 = 0
+
+ # calculate stellite function
+ par.file.psfct = self.filename
+ self.mbin, dNsatdlnM = gmf.dNsatdlnm(M0,z0,par)
+ self.Nsat = Nsat_integral(self.mbin,dNsatdlnM)
+
+ # cumulative number of haloes
+ NM = self.CumulativeMass()
+
+ # compute the sampling function
+ self.fctSample = np.vectorize( lambda x: 10**np.interp(x, NM[::-1]/NM.max(), np.log10(self.Mh[::-1])) )
+
+
+
+
+
+ def CumulativeMass(self,Mh=None):
+ '''
+ return the cumulative halo mass
+ '''
+ if Mh is None:
+ Mh = self.Mh
+
+ return np.interp(Mh,self.mbin,self.Nsat)
+
+
+
+
+
+
+
+
+
+ def Transfer(self,k,pk,DMmass,OmegaWDM,h):
+ """
+ initially from Bode, Ostriker & Turok (2001)
+ but values from Viel 2005 (nu updated)
+ """
+
+ OmegaWDM = OmegaWDM/0.25
+ h = h/0.7
+
+ nu = 1.12
+ alpha = 0.049*DMmass**(-1.11) * (OmegaWDM)**(0.11) * (h)**(1.22)
+
+
+ T = (1+(alpha*k)**(2*nu))**(-5/nu)
+ pk = pk*T**2
+ return pk
+
+
+
+
+
+
+
+
+
+
+
+
+
+##############################################
+# Generic model (Schneider 2014)
+##############################################
+# Note : deprecated
+
+from scipy.integrate import cumtrapz, trapz
+from classy import Class
+import genmassfct as gmf
+
+
+def ps_class(cosmopars):
+ """
+ Calculate power spectrum with CLASS
+ """
+
+ Om, Ob, As, h0, ns, mWDM, fWDM = cosmopars
+
+
+ if (fWDM>0):
+
+ m_nu = 4.43*mWDM**(4./3)*((Om-Ob)*h0**2/0.1225)**(-1./3)
+
+ CLASSparams = {
+ 'h': h0,
+ 'T_cmb': 2.726,
+ 'Omega_b': Ob,
+ 'Omega_cdm': (1-fWDM)*(Om-Ob),
+ 'Omega_ncdm': fWDM*(Om-Ob),
+ 'N_ur': 3.04,
+ 'N_ncdm': 1,
+ 'm_ncdm': 1000*m_nu,
+ 'T_ncdm': 0.715985,
+ 'n_s': ns,
+ 'A_s': As,
+ 'P_k_max_h/Mpc': 200,
+ 'k_per_decade_for_pk': 10,
+ 'output': 'mPk',
+ 'z_pk': 0.0,
+ 'ncdm_fluid_approximation': 3,
+ }
+ else:
+
+ CLASSparams = {
+ 'h': h0,
+ 'T_cmb': 2.726,
+ 'Omega_b': Ob,
+ 'Omega_cdm': (Om-Ob),
+ 'N_ur': 3.04,
+ 'n_s': ns,
+ 'A_s': As,
+ 'P_k_max_h/Mpc': 200,
+ 'k_per_decade_for_pk': 10,
+ 'output': 'mPk',
+ 'z_pk': 0.0,
+ 'ncdm_fluid_approximation': 1,
+ }
+
+ CLASScosmo = Class()
+ CLASScosmo.set(CLASSparams)
+ CLASScosmo.compute()
+ s8 = CLASScosmo.sigma8()
+ print("s8 = ",s8)
+ k_bin = np.logspace(np.log10(1e-3), np.log10(200), 500) #in [h/Mpc]
+ z_bin = np.array([0])
+ pk_bin = []
+ for i in range(len(k_bin)):
+ pk_bin += [CLASScosmo.pk_lin(k_bin[i]*h0,0)]
+
+ pk_bin = np.array(pk_bin)*h0**3 # [Mpc/h]^3
+
+ CLASScosmo.struct_cleanup()
+ CLASScosmo.empty()
+
+ return k_bin, pk_bin
+
+
+def Nsat_integral(mbin,dNsatdlnm):
+ """
+ Cumulative mass function Nsat(>M)
+ """
+
+ Nsat = trapz(dNsatdlnm/mbin,mbin) - cumtrapz(dNsatdlnm/mbin,mbin,initial=dNsatdlnm[0]/mbin[0])
+
+ return Nsat
+
+
+
+
+
+class oldGEN_Model(DM_Model):
+
+ def __init__(self,Mmin,Mmax,N,MDM=2,fWDM=0,M0=1e12):
+
+ # do the initialisation
+ super().__init__(Mmin,Mmax,N)
+
+ # temporary file
+ self.filename = '/tmp/powerspectrum_pk.dat'
+
+
+ # Cosmologycal parameters
+ Om = 0.315
+ Ob = 0.048
+ h0 = 0.681
+ As = 2.07e-9
+ ns = 0.963
+
+ # redshift
+ z0 = 0
+
+ self.MDM = MDM # dark matter mass in keV
+ self.fWDM = fWDM # warm dark matter fraction
+ self.M0 = M0 # Host halo mass (Msun/h)
+
+ cosmopars = Om, Ob, As, h0, ns, self.MDM, fWDM
+
+
+ # calculate power spectrum
+ kbin, PSbin = ps_class(cosmopars)
+ body = np.transpose([kbin, PSbin])
+ np.savetxt(self.filename,body,delimiter='\t')
+
+
+ # initialise parameters
+ par = gmf.par()
+ par.window.window = "sharpk"
+ par.code.rmin = 0.008
+ par.mf.q = 1.0
+ par.mf.p = 0.3
+ par.mf.c = 2.5
+
+
+ # calculate stellite function
+ par.file.psfct = self.filename
+ self.mbin, dNsatdlnM = gmf.dNsatdlnm(M0,z0,par)
+ self.Nsat = Nsat_integral(self.mbin,dNsatdlnM)
+
+
+
+ # cumulative number of haloes
+ NM = self.CumulativeMass()
+
+ # compute the sampling function
+ self.fctSample = np.vectorize( lambda x: 10**np.interp(x, NM[::-1]/NM.max(), np.log10(self.Mh[::-1])) )
+
+
+
+
+
+ def CumulativeMass(self,Mh=None):
+ '''
+ return the cumulative halo mass
+ '''
+ if Mh is None:
+ Mh = self.Mh
+
+ return np.interp(Mh,self.mbin,self.Nsat)
+
+
+
+
+def Msol2Mag(mass,Age=12,MH=-2,filter="F475X"):
+ '''
+ mass : in Msol
+ Age : in Gyr
+ MH : in [M/H]
+ '''
+
+ import stars_class
+
+ mass = np.array([mass])
+ Age = np.array([Age])
+ MH = np.array([MH])
+
+
+ ###################################
+ # compute Magnitudes
+ ###################################
+
+ # get the number of stars in each mass bin
+ Nstars = stars_class.Stars_fun(mass,None,None, 'normed_3slope')
+
+
+
+ ##############################
+ # F475X magnitude
+
+ if filter=="F475X":
+ M = stars_class.HST475X_fun(None,Age,MH)
+ # convert to flux (ignore the zero point)
+ F = 10**(-M/2.5)
+ # sum the contribution of the mass bins
+ F = np.sum(F*Nstars, axis=0)
+ # compute the absolute magnitude in each pixel (as before we ignore the zero point)
+ M = - 2.5*np.log10(F)
+ return M[0]
+
+ ##############################
+ # VIS Euclid magnitude
+
+ if filter=="VISeuclid":
+ M = stars_class.VISeuclid_fun(None,Age,MH)
+ # convert to flux (ignore the zero point)
+ F = 10**(-M/2.5)
+ # sum the contribution of the mass bins
+ F = np.sum(F*Nstars, axis=0)
+ # compute the absolute magnitude in each pixel (as before we ignore the zero point)
+ M = - 2.5*np.log10(F)
+ return M[0]
+
+ ##############################
+ # Y Euclid magnitude
+
+ if filter=="Yeuclid":
+ M = stars_class.Yeuclid_fun(None,Age,MH)
+ # convert to flux (ignore the zero point)
+ F = 10**(-M/2.5)
+ # sum the contribution of the mass bins
+ F = np.sum(F*Nstars, axis=0)
+ # compute the absolute magnitude in each pixel (as before we ignore the zero point)
+ M = - 2.5*np.log10(F)
+ return M[0]
+
+ ##############################
+ # J Euclid magnitude
+
+ if filter=="Jeuclid":
+ M = stars_class.Jeuclid_fun(None,Age,MH)
+ # convert to flux (ignore the zero point)
+ F = 10**(-M/2.5)
+ # sum the contribution of the mass bins
+ F = np.sum(F*Nstars, axis=0)
+ # compute the absolute magnitude in each pixel (as before we ignore the zero point)
+ M = - 2.5*np.log10(F)
+ return M[0]
+
+
+ ##############################
+ # Vasdekhis
+
+ if filter=="V":
+ from pNbody.SSP import libvazdekis
+ LObj = libvazdekis.VazdekisLuminosities("/home/revaz/.pNbody/opt/SSP/vazdekis_kb_mu1.3.txt",band="V")
+ LObj.ExtrapolateMatrix(order=1,s=0)
+ LObj.CreateInterpolator()
+ LObj.Extrapolate2DMatrix()
+
+ # luminosity
+ Lv = LObj.Luminosities(MH,Age)*mass
+
+ # Magnitude
+ Mag_Vega = 4.81
+ Mv = Mag_Vega - 2.5*np.log10(Lv)
+ return Mv
+
diff --git a/Workspace/CumNumOfSat/stars_class.py b/Workspace/CumNumOfSat/stars_class.py
new file mode 120000
index 0000000..b7b3b64
--- /dev/null
+++ b/Workspace/CumNumOfSat/stars_class.py
@@ -0,0 +1 @@
+../SurfaceBrightness/stars_class.py
\ No newline at end of file
diff --git a/Workspace/CumNumOfSat/sto.satComputeNCumvsLvWithErrors.py b/Workspace/CumNumOfSat/sto.satComputeNCumvsLvWithErrors.py
new file mode 100755
index 0000000..f74b730
--- /dev/null
+++ b/Workspace/CumNumOfSat/sto.satComputeNCumvsLvWithErrors.py
@@ -0,0 +1,390 @@
+#!/usr/bin/env python3
+
+import sys,os,string
+
+import argparse
+import satlib
+import numpy as np
+import Ptools as pt
+import pickle
+from scipy.interpolate import splrep,splev
+from tqdm import tqdm
+
+####################################################################
+# option parser
+####################################################################
+
+description=""
+epilog =""""""
+
+parser = argparse.ArgumentParser(description=description,epilog=epilog,formatter_class=argparse.RawDescriptionHelpFormatter)
+
+
+
+parser.add_argument("--Mmin",
+ action="store",
+ dest="Mmin",
+ metavar='FLOAT',
+ type=float,
+ default=5e7,
+ help='the min halo mass')
+
+
+parser.add_argument("--Mmax",
+ action="store",
+ dest="Mmax",
+ metavar='FLOAT',
+ type=float,
+ default=1e11,
+ help='the max halo mass')
+
+parser.add_argument("-N",
+ action="store",
+ dest="N",
+ metavar='INT',
+ type=int,
+ default=1000,
+ help='number of bins')
+
+
+parser.add_argument("--Ngal",
+ action="store",
+ dest="Ngal",
+ metavar='INT',
+ type=int,
+ default=100,
+ help='number of galaxies')
+
+
+parser.add_argument("--Nrealisations",
+ action="store",
+ dest="Nrealisations",
+ metavar='INT',
+ type=int,
+ default=100,
+ help='number of realizations')
+
+
+
+parser.add_argument("--LvvsMh_model",
+ action="store",
+ type=str,
+ dest="LvvsMh_model",
+ default = 'rj2018',
+ help="Lv Mh model")
+
+
+parser.add_argument("-p",
+ action="store",
+ dest="ps",
+ metavar='FILE NAME',
+ type=str,
+ default=None,
+ help='output file name')
+
+parser.add_argument("--dpi",
+ action="store",
+ dest="dpi",
+ type=float,
+ default=300,
+ help="DPI of the saved file",
+ metavar=" FLOAT")
+
+parser.add_argument("--data",
+ action="store_true",
+ dest="data",
+ default=False,
+ help='add data')
+
+
+####################################################################
+# main
+####################################################################
+
+
+def MakePlot(opt):
+
+
+ # get Mh vs Lv relation
+ Mhbins,Lvmins,Lvmaxs = satlib.GetStellarMassHaloMassRelation(model=opt.LvvsMh_model)
+
+
+
+ # halo bins
+ lnMh = np.linspace(np.log10(opt.Mmin),np.log10(opt.Mmax),opt.N)
+ Mh0 = 10**lnMh
+
+ # cumulative number of haloes
+ NM_CDM = satlib.CDM_CumulativeMass(Mh0)
+ NM_WDM = satlib.fctWDM_CumulativeMass(Mh0)
+
+
+ # define the CDM sampling function
+ fct_CDM_Sample = np.vectorize( lambda x: 10**np.interp(x, NM_CDM[::-1]/NM_CDM.max(), np.log10(Mh0[::-1])) )
+ maxCDM = (NM_CDM/NM_CDM.max()).min()
+
+ # define the WDM sampling function
+ fct_WDM_Sample = np.vectorize( lambda x: 10**np.interp(x, NM_WDM[::-1]/NM_WDM.max(), np.log10(Mh0[::-1])) )
+ maxWDM = (NM_WDM/NM_WDM.max()).min()
+
+
+ Nh_CDM = int(satlib.CDM_CumulativeMass(opt.Mmin))
+ Nh_WDM = int(satlib.fctWDM_CumulativeMass(opt.Mmin))
+
+
+
+ Nbins = 100
+ Nsats_CDM = np.zeros((opt.Ngal,Nbins-1))
+ Nsats_WDM = np.zeros((opt.Ngal,Nbins-1))
+
+
+ Ns_CDM_realisations = np.zeros((opt.Nrealisations,Nbins-1))
+ Ns_WDM_realisations = np.zeros((opt.Nrealisations,Nbins-1))
+
+ for realisation in tqdm(range(opt.Nrealisations)):
+
+ for j in range(opt.Ngal):
+
+ #print(realisation,j)
+
+ #################################################
+ # generate N haloes for the CDM
+ #################################################
+ Mhs = fct_CDM_Sample(np.random.random(Nh_CDM))
+
+ ###################
+ # loop over haloes
+ logLv = np.zeros(len(Mhs))
+
+ for i,Mh in enumerate(Mhs):
+ if Mh < 1e8:
+ continue
+
+ # find the nearest values in Mbins
+ # and set a Luminosity
+
+ idx = np.argmin( np.fabs( Mh-Mhbins ) )
+
+ logLvmins = np.log10(Lvmins[idx])
+ logLvmaxs = np.log10(Lvmaxs[idx])
+
+ logLv[i] = np.random.uniform(logLvmins,logLvmaxs)
+
+
+ ######################
+ # cumulative
+
+ bins = np.linspace(2,12,Nbins)
+ Ns,Lv = np.histogram(logLv,bins)
+
+ # now, need to cumulate
+ # invert vector first and reinvert after
+ Nsat = np.add.accumulate(Ns[-np.arange(1,len(Ns)+1)])
+ Nsat = Nsat[-np.arange(1,len(Nsat)+1)]
+ Lv = Lv[1:]
+ # add
+ Nsats_CDM[j] = Nsat
+
+
+
+
+ #################################################
+ # generate N haloes for the WDM
+ #################################################
+ Mhs = fct_WDM_Sample(np.random.random(Nh_WDM))
+
+
+ ###################
+ # loop over haloes
+ logLv = np.zeros(len(Mhs))
+
+ for i,Mh in enumerate(Mhs):
+ if Mh < 1e8:
+ continue
+
+ # find the nearest values in Mbins
+ # and set a Luminosity
+
+ idx = np.argmin( np.fabs( Mh-Mhbins ) )
+
+ logLvmins = np.log10(Lvmins[idx])
+ logLvmaxs = np.log10(Lvmaxs[idx])
+
+ logLv[i] = np.random.uniform(logLvmins,logLvmaxs)
+
+
+ ######################
+ # cumulative
+
+ bins = np.linspace(2,12,Nbins)
+ Ns,Lv = np.histogram(logLv,bins)
+
+ # now, need to cumulate
+ # invert vector first and reinvert after
+ Nsat = np.add.accumulate(Ns[-np.arange(1,len(Ns)+1)])
+ Nsat = Nsat[-np.arange(1,len(Nsat)+1)]
+ Lv = Lv[1:]
+ # add
+ Nsats_WDM[j] = Nsat
+
+
+ # plot individual galaxies
+ #pt.plot(10**Lv,Nsats_CDM[j],'blue',alpha=0.5)
+ #pt.plot(10**Lv,Nsats_WDM[j],'red' ,alpha=0.5)
+
+
+
+
+ Ns_CDM_mean = Nsats_CDM.mean(axis=0)
+ Ns_WDM_mean = Nsats_WDM.mean(axis=0)
+
+ Ns_CDM_realisations[realisation] = Ns_CDM_mean
+ Ns_WDM_realisations[realisation] = Ns_WDM_mean
+
+ # plot means
+ #pt.plot(10**Lv,Ns_CDM_mean,lw=1,alpha=0.5, c='blue')
+ #pt.plot(10**Lv,Ns_WDM_mean,lw=1,alpha=0.5, c='red')
+
+
+
+
+
+ Ns_CDM_realisations_mean = Ns_CDM_realisations.mean(axis=0)
+ Ns_CDM_realisations_std = Ns_CDM_realisations.std(axis=0)
+
+ Ns_CDM_meanp = Ns_CDM_realisations_mean + 3*Ns_CDM_realisations_std
+ Ns_CDM_meanm = Ns_CDM_realisations_mean - 3*Ns_CDM_realisations_std
+
+
+ Ns_WDM_realisations_mean = Ns_WDM_realisations.mean(axis=0)
+ Ns_WDM_realisations_std = Ns_WDM_realisations.std(axis=0)
+
+ Ns_WDM_meanp = Ns_WDM_realisations_mean + 3*Ns_WDM_realisations_std
+ Ns_WDM_meanm = Ns_WDM_realisations_mean - 3*Ns_WDM_realisations_std
+
+
+
+ ax = pt.gca()
+ ax.fill_between(10**Lv,Ns_CDM_meanp,Ns_CDM_meanm,facecolor='blue',alpha=0.5,label=r"$\textrm{CDM}$")
+ ax.fill_between(10**Lv,Ns_WDM_meanp,Ns_WDM_meanm,facecolor='red',alpha=0.5,label=r"$\textrm{WDM}$")
+
+
+
+
+
+ if opt.data:
+
+ ################################################################################
+ # add data from Nadler, Drlica etc.
+
+ ax = pt.gca()
+ s = 0.0
+ k = 1
+
+ def read_data(f):
+ data = np.loadtxt(f,delimiter=',')
+ Mv = data[:,0]
+ N = data[:,1]
+ Lv = pow(10, (4.74 - Mv) / 2.5)
+ return Lv, N
+
+
+ ###################
+ # Nadler
+
+ Lvp, Np = read_data("data/Nadler_rawt1.txt")
+ Lvm, Nm = read_data("data/Nadler_rawb1.txt")
+
+ ap = splrep(Lvp,Np,s=s,k=k)
+ am = splrep(Lvm,Nm,s=s,k=k)
+
+ Np= splev(Lvp,ap)
+ Nm= splev(Lvp,am)
+
+ #pt.plot(Lvp,Np,'k-')
+ #pt.plot(Lvm,Nm,'k-')
+ ax.fill_between(Lvp,Np,Nm,facecolor='green',alpha=0.05,label=r"$\textrm{Nadler\,\,et\,\,al.\,\,2018a}$")
+
+
+ Lvp, Np = read_data("data/Nadler_rawt2.txt")
+ Lvm, Nm = read_data("data/Nadler_rawb2.txt")
+
+ ap = splrep(Lvp,Np,s=s,k=k)
+ am = splrep(Lvm,Nm,s=s,k=k)
+
+ Np= splev(Lvp,ap)
+ Nm= splev(Lvp,am)
+
+ #pt.plot(Lvp,Np,'k-')
+ #pt.plot(Lvm,Nm,'k-')
+ ax.fill_between(Lvp,Np,Nm,facecolor='green',alpha=0.05)
+
+
+ ###################
+ # Drilca
+
+ Lv, N = read_data("data/Drlica_raw_weighted.txt")
+ pt.plot(Lv,N,'k-',label=r"$\textrm{DES+PS1,\,\,weighted\,\,(Drlica-Wagner\,\,et\,\,al.\,\,2020)}$",alpha=0.5)
+
+ Lv, N = read_data("data/Drlica_raw_detected.txt")
+ pt.plot(Lv,N,'k--',label=r"$\textrm{DES+PS1,\,\,detected\,\,(Drlica-Wagner\,\,et\,\,al.\,\,2020)}$",alpha=0.5)
+
+ Lv, N = read_data("data/Drlica_raw_all.txt")
+ pt.plot(Lv,N,'r-',label=r"$\textrm{All\,\,known\,\,satellites\,\,(Drlica-Wagner\,\,et\,\,al.\,\,2020)}$",alpha=0.5)
+
+
+
+
+ ###########################
+ # finalize
+ ###########################
+
+ xmin = 5e2
+ xmax = 5e9
+ ymin = 1
+ ymax = 500
+
+
+
+ xlabel = r"$\rm{V-band\,\,Luminosity}$"
+ ylabel = r"$\rm{Cumulative\,\,number\,\,of\,\,galaxies}\,\,(D<300\,\rm{kpc})$"
+
+ pt.SetAxis(xmin,xmax,ymin,ymax,log="xy")
+ pt.xlabel(xlabel,fontsize=pt.labelfont)
+ pt.ylabel(ylabel,fontsize=pt.labelfont)
+ pt.grid(False)
+ pt.legend()
+
+ pt.title(r"$\rm{%d\,\,galaxies\,\,observed\,\,+\,\,model=%s}$"%(opt.Ngal,opt.LvvsMh_model),fontsize=pt.labelfont)
+
+ pt.plot([1e5,1e5],[0.1,1000],c='k',ls=':')
+
+
+
+
+
+if __name__ == '__main__':
+
+ opt = parser.parse_args()
+ files = []
+
+ pt.InitPlot(files, opt)
+ pt.labelfont=20
+
+ # pt.figure(figsize=(8*2,6*2))
+ # pt.figure(dpi=10)
+
+ #fig = pt.gcf()
+ # fig.subplots_adjust(left=0.1)
+ # fig.subplots_adjust(right=1)
+ # fig.subplots_adjust(bottom=0.12)
+ # fig.subplots_adjust(top=0.95)
+ # fig.subplots_adjust(wspace=0.25)
+ # fig.subplots_adjust(hspace=0.02)
+
+ MakePlot(opt)
+ pt.EndPlot(files, opt)
+
+
+
+

Event Timeline