jvines / astroARIADNE

Easy stellar SED fitting!
MIT License
57 stars 7 forks source link

An error in the fit #34

Closed AstroJLin closed 2 years ago

AstroJLin commented 2 years ago

Hi,

Here, I suffer from an error when I go to perform the fit. Can you give some suggestions!

Thanks!

The error is as follow:

In [16]: f.initialize()
    ...: f.fit_bma()
Creation of the directory /home/linj/outputs failed. It might already exist

        *** EXECUTING MAIN FITTING ROUTINE ***
            Selected engine : Bayesian Model Averaging
            Live points : 500
            log Evidence tolerance : 0.5
            Free parameters : 22
            Bounding : multi
            Sampling : rwalk
            N threads : 4

            FITTING MODEL : kurucz
10365it [06:03, 28.49it/s, +500 | bound: 115 | nc: 1 | ncall: 233133 | eff(%):  4.670 | loglstar:   -inf < 416.332 <    inf | logz: 396.176 +/-    nan | dlogz:  0.001 >  0.500]  
            FITTING MODEL : ck04
10561it [06:11, 28.43it/s, +500 | bound: 118 | nc: 1 | ncall: 237365 | eff(%):  4.670 | loglstar:   -inf < 416.488 <    inf | logz: 395.929 +/-    nan | dlogz:  0.001 >  0.500]   
        *** AVERAGING POSTERIOR SAMPLES ***
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 26/26 [00:00<00:00, 35.18it/s]
        *** ESTIMATING AGE AND MASS USING MIST ISOCHRONES ***
/home/linj/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/mist/models.py:144: DtypeWarning: Columns (17) have mixed types. Specify dtype option on import or set low_memory=False.
  df = pd.read_csv(
/home/linj/anaconda3/lib/python3.9/site-packages/pandas/core/arraylike.py:397: RuntimeWarning: divide by zero encountered in log10
  result = getattr(ufunc, method)(*inputs, **kwargs)
Exception while calling loglikelihood function:
  params: [ 8.78844679e+02  5.64954949e+00 -4.86923523e-01  4.10574531e+02
  7.46851131e-01  7.89594729e+00 -3.29797767e+00  1.42526837e+00
 -4.44973058e+00 -8.58535501e+00 -2.58163024e+00  9.62262106e+00
 -5.03642457e+00 -2.73567711e+00  3.59569221e+00 -7.72955858e+00]
  args: [<isochrones.starmodel.SingleStarModel object at 0x7f3e04270700>, {'Teff': (4628.024071348419, 75.45861396695454), 'feh': (0.004864873337200648, 0.37195504029505133), 'distance': (310.21362282396774, 9.857211346815802), 'parallax': (3.2235850601811094, 0.10243121802124831), 'radius': (0.7819502180151121, 0.0496921336222782), 'AV': (0.017463920561400573, 0.015531079110128474), 'mass': (6.762727760073872e-06, 0.29214169917007754), 'logL': (-0.5870917183493323, 1.486574024016478), 'H': (11.767000198364258, 0.03799999877810478), 'J': (12.222000122070312, 0.032999999821186066), 'K': (11.649999618530273, 0.03200000151991844), 'V': (14.086999893188477, 0.020999999716877937), 'B': (15.170999526977539, 0.014000000432133675), 'G': (13.8175, 0.0006), 'RP': (13.1127, 0.0015), 'BP': (14.4012, 0.0027), 'W1': (11.555000305175781, 0.027000000700354576), 'W2': (11.63599967956543, 0.027000000700354576), 'TESS': (13.1686, 0.0062)}, ['H', 'J', 'K', 'V', 'B', 'G', 'RP', 'BP', 'W1', 'W2', 'TESS']]
  kwargs: {}
  exception:
Traceback (most recent call last):
  File "/home/linj/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/grid.py", line 107, in read_hdf
    df = pd.read_hdf(h5file, path)
  File "/home/linj/anaconda3/lib/python3.9/site-packages/pandas/io/pytables.py", line 427, in read_hdf
    raise FileNotFoundError(f"File {path_or_buf} does not exist")
FileNotFoundError: File /home/linj/.isochrones/mist/mist_v1.2_vvcrit0.4_full_isos.h5 does not exist

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/linj/anaconda3/lib/python3.9/site-packages/pandas/core/ops/array_ops.py", line 163, in _na_arithmetic_op
    result = func(left, right)
  File "/home/linj/anaconda3/lib/python3.9/site-packages/pandas/core/computation/expressions.py", line 239, in evaluate
    return _evaluate(op, op_str, a, b)  # type: ignore[misc]
  File "/home/linj/anaconda3/lib/python3.9/site-packages/pandas/core/computation/expressions.py", line 128, in _evaluate_numexpr
    result = _evaluate_standard(op, op_str, a, b)
  File "/home/linj/anaconda3/lib/python3.9/site-packages/pandas/core/computation/expressions.py", line 69, in _evaluate_standard
    return op(a, b)
TypeError: unsupported operand type(s) for -: 'str' and 'float'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/linj/anaconda3/lib/python3.9/site-packages/dynesty-1.2.3-py3.9.egg/dynesty/dynesty.py", line 1026, in __call__
    return self.func(np.asarray(x).copy(), *self.args, **self.kwargs)
  File "/home/linj/anaconda3/lib/python3.9/site-packages/astroARIADNE-0.5.5-py3.9.egg/astroARIADNE/isochrone.py", line 122, in loglike
    lp = lp0 + mod.lnpost(theta[: mod.n_params])
  File "/home/linj/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/starmodel.py", line 539, in lnpost
    lnpr = self.lnprior(p)
  File "/home/linj/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/starmodel.py", line 1631, in lnprior
    lnp += self._priors["eep"].lnpdf(val, age=pars[self.age_index], feh=pars[self.feh_index])
  File "/home/linj/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/priors.py", line 139, in lnpdf
    pdf = self.pdf(x, **kwargs)
  File "/home/linj/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/priors.py", line 59, in pdf
    return self._pdf(x, **kwargs) / self._norm
  File "/home/linj/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/priors.py", line 428, in _pdf
    orig_val, dx_deep = self.ic.interp_value(pars, [self.orig_par, self.deriv_prop]).squeeze()
  File "/home/linj/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/models.py", line 400, in interp_value
    return self.model_grid.interp(pars, props)
  File "/home/linj/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/grid.py", line 136, in interp
    self._interp = DFInterpolator(self.df, filename=filename, is_full=self.is_full)
  File "/home/linj/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/models.py", line 158, in df
    self._df = self.read_hdf()
  File "/home/linj/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/grid.py", line 109, in read_hdf
    df = self.write_hdf(orig=orig)
  File "/home/linj/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/grid.py", line 113, in write_hdf
    df = self.get_df(orig=orig)
  File "/home/linj/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/models.py", line 117, in get_df
    df = self.compute_additional_columns(df)
  File "/home/linj/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/mist/models.py", line 84, in compute_additional_columns
    df["feh"] = df["log_surf_z"] - np.log10(df["surface_h1"]) - np.log10(0.0181)  # Aaron Dotter says
  File "/home/linj/anaconda3/lib/python3.9/site-packages/pandas/core/ops/common.py", line 70, in new_method
    return method(self, other)
  File "/home/linj/anaconda3/lib/python3.9/site-packages/pandas/core/arraylike.py", line 108, in __sub__
    return self._arith_method(other, operator.sub)
  File "/home/linj/anaconda3/lib/python3.9/site-packages/pandas/core/series.py", line 5639, in _arith_method
    return base.IndexOpsMixin._arith_method(self, other, op)
  File "/home/linj/anaconda3/lib/python3.9/site-packages/pandas/core/base.py", line 1295, in _arith_method
    result = ops.arithmetic_op(lvalues, rvalues, op)
  File "/home/linj/anaconda3/lib/python3.9/site-packages/pandas/core/ops/array_ops.py", line 222, in arithmetic_op
    res_values = _na_arithmetic_op(left, right, op)
  File "/home/linj/anaconda3/lib/python3.9/site-packages/pandas/core/ops/array_ops.py", line 170, in _na_arithmetic_op
    result = _masked_arith_op(left, right, op)
  File "/home/linj/anaconda3/lib/python3.9/site-packages/pandas/core/ops/array_ops.py", line 108, in _masked_arith_op
    result[mask] = op(xrav[mask], yrav[mask])
TypeError: unsupported operand type(s) for -: 'str' and 'float'
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
File ~/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/grid.py:107, in Grid.read_hdf(self, orig)
    106     path = "orig" if orig else "df"
--> 107     df = pd.read_hdf(h5file, path)
    108 except (FileNotFoundError, KeyError):

File ~/anaconda3/lib/python3.9/site-packages/pandas/io/pytables.py:427, in read_hdf(path_or_buf, key, mode, errors, where, start, stop, columns, iterator, chunksize, **kwargs)
    426 if not exists:
--> 427     raise FileNotFoundError(f"File {path_or_buf} does not exist")
    429 store = HDFStore(path_or_buf, mode=mode, errors=errors, **kwargs)

FileNotFoundError: File /home/linj/.isochrones/mist/mist_v1.2_vvcrit0.4_full_isos.h5 does not exist

During handling of the above exception, another exception occurred:

TypeError                                 Traceback (most recent call last)
File ~/anaconda3/lib/python3.9/site-packages/pandas/core/ops/array_ops.py:163, in _na_arithmetic_op(left, right, op, is_cmp)
    162 try:
--> 163     result = func(left, right)
    164 except TypeError:

File ~/anaconda3/lib/python3.9/site-packages/pandas/core/computation/expressions.py:239, in evaluate(op, a, b, use_numexpr)
    237     if use_numexpr:
    238         # error: "None" not callable
--> 239         return _evaluate(op, op_str, a, b)  # type: ignore[misc]
    240 return _evaluate_standard(op, op_str, a, b)

File ~/anaconda3/lib/python3.9/site-packages/pandas/core/computation/expressions.py:128, in _evaluate_numexpr(op, op_str, a, b)
    127 if result is None:
--> 128     result = _evaluate_standard(op, op_str, a, b)
    130 return result

File ~/anaconda3/lib/python3.9/site-packages/pandas/core/computation/expressions.py:69, in _evaluate_standard(op, op_str, a, b)
     68     _store_test_result(False)
---> 69 return op(a, b)

TypeError: unsupported operand type(s) for -: 'str' and 'float'

During handling of the above exception, another exception occurred:

TypeError                                 Traceback (most recent call last)
Input In [16], in <cell line: 2>()
      1 f.initialize()
----> 2 f.fit_bma()

File ~/anaconda3/lib/python3.9/site-packages/astroARIADNE-0.5.5-py3.9.egg/astroARIADNE/fitter.py:586, in Fitter.fit_bma(self)
    583 c = np.random.choice(self.colors)
    584 avgd = self.bayesian_model_average(outs, self._grids, self._norm,
    585                                    self.n_samples, c)
--> 586 self.save_bma(avgd)
    588 elapsed_time = execution_time(self.start)
    589 end(self.coordinator, elapsed_time, self.out_folder,
    590     'Bayesian Model Averaging', self.norm)

File ~/anaconda3/lib/python3.9/site-packages/astroARIADNE-0.5.5-py3.9.egg/astroARIADNE/fitter.py:1116, in Fitter.save_bma(self, avgd)
   1110     logdat_average = out_filler(sampw, logdat_average, 'AD', 'AD', out,
   1111                                 method='averaged')
   1113 # Add estimated age to best fit dictionary. This is done with the wider
   1114 # sampled distribution instead of the averaged one in order to save time
-> 1116 age_samp, mass_samp, eep_samp = self.estimate_age(
   1117     out['best_fit_samples'],
   1118     out['uncertainties_samples'],
   1119     c=choice(self.colors)
   1120 )
   1121 # Create new thingy for MIST samples. Sadly now everything done before
   1122 # this update will be incompatible :(
   1123 out['mist_samples'] = dict()

File ~/anaconda3/lib/python3.9/site-packages/astroARIADNE-0.5.5-py3.9.egg/astroARIADNE/fitter.py:1452, in Fitter.estimate_age(self, bf, unc, c)
   1449         params[b] = (m, e)
   1450         used_bands.append(b)
-> 1452 age_samp, mass_samp, eep_samp = estimate(used_bands, params, logg=False)
   1454 return age_samp, mass_samp, eep_samp

File ~/anaconda3/lib/python3.9/site-packages/astroARIADNE-0.5.5-py3.9.egg/astroARIADNE/isochrone.py:59, in estimate(bands, params, logg, out_folder)
     57     model._priors['AV'] = GaussianPrior(av, av_e)
     58 model._priors['distance'] = GaussianPrior(dist, dist_e)
---> 59 sampler = dynesty.NestedSampler(
     60     loglike, prior_transform, model.n_params + len(bands),
     61     nlive=500, bound='multi', sample='rwalk',
     62     logl_args=([model, params, bands]),
     63     ptform_args=([model])
     64 )
     65 try:
     66     sampler.run_nested(dlogz=0.01)

File ~/anaconda3/lib/python3.9/site-packages/dynesty-1.2.3-py3.9.egg/dynesty/dynesty.py:602, in NestedSampler(loglikelihood, prior_transform, ndim, nlive, bound, sample, periodic, reflective, update_interval, first_update, npdim, rstate, queue_size, pool, use_pool, live_points, logl_args, logl_kwargs, ptform_args, ptform_kwargs, gradient, grad_args, grad_kwargs, compute_jac, enlarge, bootstrap, walks, facc, slices, fmove, max_move, update_func, ncdim, save_history, history_filename)
    599     kwargs['grad'] = grad
    600     kwargs['compute_jac'] = compute_jac
--> 602 live_points = initialize_live_points(live_points,
    603                                      ptform,
    604                                      loglike,
    605                                      M,
    606                                      nlive=nlive,
    607                                      npdim=npdim,
    608                                      rstate=rstate,
    609                                      use_pool_ptform=use_pool.get(
    610                                          'prior_transform', True))
    612 # Initialize our nested sampler.
    613 sampler = _SAMPLERS[bound](loglike,
    614                            ptform,
    615                            npdim,
   (...)
    624                            kwargs,
    625                            ncdim=ncdim)

File ~/anaconda3/lib/python3.9/site-packages/dynesty-1.2.3-py3.9.egg/dynesty/dynamicsampler.py:363, in initialize_live_points(live_points, prior_transform, loglikelihood, M, nlive, npdim, rstate, use_pool_ptform)
    360 else:
    361     live_v = np.array(
    362         list(map(prior_transform, np.asarray(live_u))))
--> 363 live_logl = np.array(loglikelihood.map(np.asarray(live_v)))
    365 # Convert all `-np.inf` log-likelihoods to finite large
    366 # numbers. Necessary to keep estimators in our sampler from
    367 # breaking.
    368 for i, logl in enumerate(live_logl):

File ~/anaconda3/lib/python3.9/site-packages/dynesty-1.2.3-py3.9.egg/dynesty/utils.py:90, in LogLikelihood.map(self, pars)
     86 """ Evaluate the likelihood f-n on the list of vectors
     87 The pool is used if it was provided when the object was created
     88 """
     89 if self.pool is None:
---> 90     ret = np.array(list(map(self.loglikelihood, pars)))
     91 else:
     92     ret = np.array(self.pool.map(self.loglikelihood, pars))

File ~/anaconda3/lib/python3.9/site-packages/dynesty-1.2.3-py3.9.egg/dynesty/dynesty.py:1026, in _function_wrapper.__call__(self, x)
   1018 def __call__(self, x):
   1019     try:
   1020         # IMPORTANT
   1021         # Here we make a copy if the input vector just to ensure
   (...)
   1024         # This comes at performance cost, but it's worthwhile
   1025         # as it may lead to hard to diagnose weird behaviour
-> 1026         return self.func(np.asarray(x).copy(), *self.args, **self.kwargs)
   1027     except:  # noqa
   1028         print("Exception while calling {0} function:".format(self.name))

File ~/anaconda3/lib/python3.9/site-packages/astroARIADNE-0.5.5-py3.9.egg/astroARIADNE/isochrone.py:122, in loglike(theta, mod, params, jitter_vars)
    120     lp0 -= 2 * np.log(err)  # This is to fix a bug in isochrones
    121     mod.kwargs[k] = (params[k][0], err)
--> 122 lp = lp0 + mod.lnpost(theta[: mod.n_params])
    123 if np.isfinite(lp):
    124     return np.clip(lp, -1e10, np.inf)

File ~/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/starmodel.py:539, in StarModel.lnpost(self, p, **kwargs)
    538 def lnpost(self, p, **kwargs):
--> 539     lnpr = self.lnprior(p)
    540     if not np.isfinite(lnpr):
    541         return -np.inf

File ~/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/starmodel.py:1631, in BasicStarModel.lnprior(self, pars)
   1627         lnp += self._priors["eep"].lnpdf(
   1628             val, mass=pars[self.mass_index], feh=pars[self.feh_index]
   1629         )
   1630     elif self.ic.eep_replaces == "mass":
-> 1631         lnp += self._priors["eep"].lnpdf(val, age=pars[self.age_index], feh=pars[self.feh_index])
   1632 else:
   1633     lnp += self._priors[par].lnpdf(val)

File ~/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/priors.py:139, in BoundedPrior.lnpdf(self, x, **kwargs)
    137     return self._lnpdf(x, **kwargs)
    138 else:
--> 139     pdf = self.pdf(x, **kwargs)
    140     return np.log(pdf) if pdf else -np.inf

File ~/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/priors.py:59, in Prior.pdf(self, x, **kwargs)
     57     return 0
     58 else:
---> 59     return self._pdf(x, **kwargs) / self._norm

File ~/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/priors.py:428, in EEP_prior._pdf(self, eep, **kwargs)
    426 elif self.orig_par == "mass":
    427     pars = [eep, kwargs["age"], kwargs["feh"]]
--> 428 orig_val, dx_deep = self.ic.interp_value(pars, [self.orig_par, self.deriv_prop]).squeeze()
    429 return self.orig_prior(orig_val) * dx_deep

File ~/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/models.py:400, in ModelGridInterpolator.interp_value(self, pars, props)
    398     i0, i1, i2, i3, i4 = self.param_index_order
    399     pars = [pars[i0], pars[i1], pars[i2]]
--> 400 return self.model_grid.interp(pars, props)

File ~/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/grid.py:136, in Grid.interp(self)
    134 if self._interp is None:
    135     filename = getattr(self, "interp_grid_npz_filename", None)
--> 136     self._interp = DFInterpolator(self.df, filename=filename, is_full=self.is_full)
    137 return self._interp

File ~/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/models.py:158, in StellarModelGrid.df(self)
    155 @property
    156 def df(self):
    157     if self._df is None:
--> 158         self._df = self.read_hdf()
    159         self._df["dm_deep"] = self.get_dm_deep()
    161     return self._df

File ~/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/grid.py:109, in Grid.read_hdf(self, orig)
    107     df = pd.read_hdf(h5file, path)
    108 except (FileNotFoundError, KeyError):
--> 109     df = self.write_hdf(orig=orig)
    110 return df

File ~/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/grid.py:113, in Grid.write_hdf(self, orig)
    112 def write_hdf(self, orig=False):
--> 113     df = self.get_df(orig=orig)
    114     h5file = self.hdf_filename
    115     path = "orig" if orig else "df"

File ~/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/models.py:117, in StellarModelGrid.get_df(self, orig)
    115 if not orig:
    116     df.rename(columns=self.column_map, inplace=True)
--> 117     df = self.compute_additional_columns(df)
    118     # Select only the columns we want,
    119     df = df[list(self.default_columns)]

File ~/anaconda3/lib/python3.9/site-packages/isochrones-2.1-py3.9.egg/isochrones/mist/models.py:84, in MISTModelGrid.compute_additional_columns(self, df)
     81 """
     82 """
     83 df = super().compute_additional_columns(df)
---> 84 df["feh"] = df["log_surf_z"] - np.log10(df["surface_h1"]) - np.log10(0.0181)  # Aaron Dotter says
     85 return df

File ~/anaconda3/lib/python3.9/site-packages/pandas/core/ops/common.py:70, in _unpack_zerodim_and_defer.<locals>.new_method(self, other)
     66             return NotImplemented
     68 other = item_from_zerodim(other)
---> 70 return method(self, other)

File ~/anaconda3/lib/python3.9/site-packages/pandas/core/arraylike.py:108, in OpsMixin.__sub__(self, other)
    106 @unpack_zerodim_and_defer("__sub__")
    107 def __sub__(self, other):
--> 108     return self._arith_method(other, operator.sub)

File ~/anaconda3/lib/python3.9/site-packages/pandas/core/series.py:5639, in Series._arith_method(self, other, op)
   5637 def _arith_method(self, other, op):
   5638     self, other = ops.align_method_SERIES(self, other)
-> 5639     return base.IndexOpsMixin._arith_method(self, other, op)

File ~/anaconda3/lib/python3.9/site-packages/pandas/core/base.py:1295, in IndexOpsMixin._arith_method(self, other, op)
   1292 rvalues = ensure_wrapped_if_datetimelike(rvalues)
   1294 with np.errstate(all="ignore"):
-> 1295     result = ops.arithmetic_op(lvalues, rvalues, op)
   1297 return self._construct_result(result, name=res_name)

File ~/anaconda3/lib/python3.9/site-packages/pandas/core/ops/array_ops.py:222, in arithmetic_op(left, right, op)
    217 else:
    218     # TODO we should handle EAs consistently and move this check before the if/else
    219     # (https://github.com/pandas-dev/pandas/issues/41165)
    220     _bool_arith_check(op, left, right)
--> 222     res_values = _na_arithmetic_op(left, right, op)
    224 return res_values

File ~/anaconda3/lib/python3.9/site-packages/pandas/core/ops/array_ops.py:170, in _na_arithmetic_op(left, right, op, is_cmp)
    164 except TypeError:
    165     if not is_cmp and (is_object_dtype(left.dtype) or is_object_dtype(right)):
    166         # For object dtype, fallback to a masked operation (only operating
    167         #  on the non-missing values)
    168         # Don't do this for comparisons, as that will handle complex numbers
    169         #  incorrectly, see GH#32047
--> 170         result = _masked_arith_op(left, right, op)
    171     else:
    172         raise

File ~/anaconda3/lib/python3.9/site-packages/pandas/core/ops/array_ops.py:108, in _masked_arith_op(x, y, op)
    106     # See GH#5284, GH#5035, GH#19448 for historical reference
    107     if mask.any():
--> 108         result[mask] = op(xrav[mask], yrav[mask])
    110 else:
    111     if not is_scalar(y):

TypeError: unsupported operand type(s) for -: 'str' and 'float'
jvines commented 2 years ago

Hi,

The problem lies with the isochrones package as it’s not fully installed yet and it’s lacking the actual isochrones. Try running nosetests isochrones in a terminal, if that doesn’t fix the issue then raise an issue on their github asking for help, as I understand installing isochrones might come with a fair share of problems

AstroJLin commented 2 years ago

Hi,

Thank you for your reply.

Here, the isochrones package use the python< 3.6 and pandas <1.1.0 ? Do you know what is the version of some dependencies for the isochrones. Can you give some suggestions.

Thanks

jvines commented 2 years ago

What do you mean isochrones requires python < 3.6?? I've used it all the way to python 3.9. In any case, you have it installed, just not completely. Did you even try running nosetests isochrones? that should download the MIST isochrone tracks and interpolate them. If that fails, you should ask the author of isochrones how to fix that problem

AstroJLin commented 2 years ago

Yes. I doubt if it is the version problem of python and pandas, which doesn't seem to be the problem now. I have try to run nosetests isochrones, but the error still exist. I have try to ask the author of isochrones how to fix that problem, but the author did not give any response. I would like to know what command did you use to install the isochrones (pip install isochrones ?), can you tell me?

Thanks!

jvines commented 2 years ago

I installed it with pip install isochrones

I know there are some issues on the isochrones github that tackle the problem you're having. Try searching around there if there's a solution

AstroJLin commented 2 years ago

Thank you for your reply.

Here, I try to tackle the problem I have on the isochrones github. In addition, if I do not install the isochrones, Would you like to help me fit my source with astroARIADNE. I will include you as one of the authors of my article.

Thanks

jvines commented 2 years ago

Sure, I can fit your source, no problem. I'll try to check the isochrones issues too to link you to something that could be useful.

Feel free to send me an email with your source details if you choose that route

AstroJLin commented 2 years ago

Ok, thank you very much for your help.

AstroJLin commented 2 years ago

Hi,

I have send you an email with my source details. Do you receive the email?

Thanks