|
3 | 3 | from scipy.linalg import norm |
4 | 4 | from EXPtools.basis_builder import makemodel |
5 | 5 |
|
6 | | -def make_config(basis_id, numr, rmin, rmax, lmax, nmax, scale, |
| 6 | +def old_make_config(basis_id, numr, rmin, rmax, lmax, nmax, scale, |
7 | 7 | modelname='', cachename='.slgrid_sph_cache'): |
8 | 8 | """ |
9 | 9 | Creates a configuration file required to build a basis model. |
@@ -38,6 +38,42 @@ def make_config(basis_id, numr, rmin, rmax, lmax, nmax, scale, |
38 | 38 | config += ' cachename: {}\n'.format(cachename) |
39 | 39 | return config |
40 | 40 |
|
| 41 | + |
| 42 | +def make_halo_config(basis_id, numr, rmin, rmax, lmax, nmax, rmapping, |
| 43 | + modelname, cachename): |
| 44 | + """ |
| 45 | + Creates a configuration file required to build a basis model. |
| 46 | +
|
| 47 | + Args: |
| 48 | + basis_id (str): The identity of the basis model. |
| 49 | + numr (int): The number of radial grid points. |
| 50 | + rmin (float): The minimum radius value. |
| 51 | + rmax (float): The maximum radius value. |
| 52 | + lmax (int): The maximum l value of the basis. |
| 53 | + nmax (int): The maximum n value of the basis. |
| 54 | + scale (float): Scaling factor for the basis. |
| 55 | + modelname (str, optional): Name of the model. Default is an empty string. |
| 56 | + cachename (str, optional): Name of the cache file. Default is '.slgrid_sph_cache'. |
| 57 | +
|
| 58 | + Returns: |
| 59 | + str: A string representation of the configuration file. |
| 60 | +
|
| 61 | + Raises: |
| 62 | + None |
| 63 | + """ |
| 64 | + |
| 65 | + config = 'id: {:s}\n'.format(basis_id) |
| 66 | + config += 'parameters:\n' |
| 67 | + config += ' numr: {:d}\n'.format(numr) |
| 68 | + config += ' rmin: {:.7f}\n'.format(rmin) |
| 69 | + config += ' rmax: {:.3f}\n'.format(rmax) |
| 70 | + config += ' Lmax: {:d}\n'.format(lmax) |
| 71 | + config += ' nmax: {:d}\n'.format(nmax) |
| 72 | + config += ' rmapping: {:.3f}\n'.format(rmapping) |
| 73 | + config += ' modelname: {}\n'.format(modelname) |
| 74 | + config += ' cachename: {}\n'.format(cachename) |
| 75 | + return config |
| 76 | + |
41 | 77 |
|
42 | 78 | def makebasis(pos, mass, basis_model, config=None, basis_id='sphereSL', time=0, |
43 | 79 | r_s=1.0, r_c=0.0, |
|
0 commit comments