Skip to content

Commit

Permalink
change version
Browse files Browse the repository at this point in the history
put more error messages
  • Loading branch information
segasai committed Jan 16, 2024
1 parent 4a9ccac commit 9a38af4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
13 changes: 9 additions & 4 deletions py/rvspecfit/make_interpol.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def process_all(setupInfo,
Process the whole library of spectra and prepare the pickle file
with arrays of convolved spectra, wavelength arrays, transformed
parameters
Parameters
-----------
setupInfo: string
Expand All @@ -177,7 +177,7 @@ def process_all(setupInfo,
this needs to be [0]
air: boolean
Transform from vacuum to air
"""
if not os.path.exists(dbfile):
raise RuntimeError('The template database file %s does not exist' %
Expand All @@ -201,6 +201,11 @@ def process_all(setupInfo,
wavefile=wavefile)
mapper = read_grid.LogParamMapper(log_parameters)
HR, lamleft, lamright, resol_function, step, log = setupInfo
if templ_lam.min() > lamleft or templ_lam.max() < lamright:
raise RuntimeError(f'''Cannot generate the spectra as the wavelength
range in the library does not cover the requested wavelengths
{lamleft} {lamright} {templ_lam.min()} {templ_lam.max()}
''')

deltav = 1000. # extra padding
fac1 = (1 + deltav / (scipy.constants.speed_of_light / 1e3))
Expand Down Expand Up @@ -304,8 +309,7 @@ def main(args):
'--parameter_names',
type=str,
default='teff,logg,feh,alpha',
help=
'comma separated list of parameters defined to make the interpolator',
help='comma separated list of parameters to make the interpolator',
required=False)

parser.add_argument(
Expand Down Expand Up @@ -362,6 +366,7 @@ def main(args):
parser.add_argument(
'--wavefile',
type=str,
required=True,
help='The path to the fits file with the wavelength grid '
'of templates')
parser.add_argument('--resolution0',
Expand Down
2 changes: 2 additions & 0 deletions py/rvspecfit/make_nd.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ def execute(spec_setup, prefix=None, regular=False, perturb=True, revision=''):

vec = vec.astype(float)
vec = mapper.forward(vec)
if not np.isfinite(vec.sum()):
raise RuntimeError('Something is broken the parameters are not finite')
ndim = len(vec[:, 0])
ret_dict = {}

Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.0.230209
0.4.0.240116

0 comments on commit 9a38af4

Please sign in to comment.