phoebe-project/phoebe2-docs

issue with v2.4 docs: tutorials/datasets_advanced (urgent help required)

Closed this issue · 1 comments

I am trying to add the dataset which is downloaded from tess database. It is CMDRA data.
import numpy as np
import pandas as pd
import phoebe
from phoebe import u # units
import numpy as np
import matplotlib.pyplot as plt

logger = phoebe.logger()

times, fluxes, sigmas = np.genfromtxt('cmdra.txt', delimiter=",", dtype=str, unpack=True)
b.add_dataset('lc',
times=times,
fluxes=fluxes,
sigmas=sigmas,
dataset='lc01',
overwrite=True)

but i am having this error:

---> 22 b.add_dataset('lc',
23 times=times,
24 fluxes=fluxes,
25 sigmas=sigmas,

~/mambaforge/lib/python3.10/site-packages/phoebe/parameters/parameters.py in ?(self, *args, **kwargs)
420
421 return ret_
422
423 else:
--> 424 return fctn(self, *args, **kwargs)

~/mambaforge/lib/python3.10/site-packages/phoebe/frontend/bundle.py in ?(self, kind, component, return_changes, **kwargs)
6962 logger.debug("reenabling interactive_checks")
6963 conf._interactive_checks = True
6964 self.run_checks(raise_logger_warning=True)
6965
-> 6966 raise ValueError("could not set value for {}={} with error: '{}'. Dataset has not been added.".format(k, v, str(err)))
6967
6968
6969 def _to_safe_value(v):

ValueError: could not set value for times=['times' '2853.352985' '2853.353217' ... '2882.113267' '2882.113499'
'2882.11373'] with error: 'unsupported operand type(s) for *: 'numpy.ndarray' and 'Unit''. Dataset has not been added.

What might be the solution for this? I have attached the data
cmdra.txt

aprsa commented

You will need to cast your column types from strings to floats. It should work then.