Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Load of results from RVFWHMmodel is broken #24

Open
Kamuish opened this issue Nov 29, 2024 · 3 comments
Open

[bug] Load of results from RVFWHMmodel is broken #24

Kamuish opened this issue Nov 29, 2024 · 3 comments
Assignees

Comments

@Kamuish
Copy link
Contributor

Kamuish commented Nov 29, 2024

Hi,

I am trying to load kima products using the following MWE


with chdir(selected_folder):
    with open(selected_folder / "kima_model_setup.txt") as to_read:
        for line in to_read:
            if "files" in line:
                input_files = line.split(":")[-1].split(",")[:-1]
                input_files = [i.strip() for i in input_files]
                break

    data = RVData(
        filenames=input_files,
        units="kms",
        skip=0,
        indicators=["fwhm", "s-fwhm", "cont", "s-cont", "bis", "s-bis"],
    )
    model = RVFWHMmodel(fix=False, npmax=2, data=data)

    res = kima.load_results(model, diagnostic=False)

It is failing with

Traceback (most recent call last):
  File "/home/amiguel/work/RV_analysis/EpsIndi/kima_runs/teste_joint.py", line 47, in <module>
    res = kima.load_results(model, diagnostic=False)
  File "/home/amiguel/work/RV_analysis/venv/lib64/python3.9/site-packages/kima/pykima/results.py", line 245, in load_results
    res = KimaResults(model_or_file, data,
  File "/home/amiguel/work/RV_analysis/venv/lib64/python3.9/site-packages/kima/pykima/results.py", line 602, in __init__
    self._read_GP()
  File "/home/amiguel/work/RV_analysis/venv/lib64/python3.9/site-packages/kima/pykima/results.py", line 850, in _read_GP
    self.kernel = GPmodel.KernelType(int(self.setup['kima']['kernel']))
ValueError: invalid literal for int() with base 10: 'standard'

@j-faria
Copy link
Contributor

j-faria commented Jan 9, 2025

Can you check if this is still causing an error with the current version on main (after commit 0e8e5dd)?

@j-faria j-faria self-assigned this Jan 9, 2025
@Kamuish
Copy link
Contributor Author

Kamuish commented Jan 10, 2025

The new version does not even run the RVFWHM model with the default configurations

 model = RVFWHMmodel(
fix=fix,
        npmax=NPmax,
        data=data,
    )
model.enforce_stability = True
model.trend = True
model.degree = 1
kima.run(
    model,
    steps=n_steps,
    num_threads=30,
    new_level_interval=4000,
)

This fails with

(venv) ➜  EpsIndi python kima_runs/apply_kima.py
# Seeding random number generators. First seed = 1736503611.
# Generating 30 particles from the prior...Traceback (most recent call last):
  File "/home/amiguel/RV_analysis/EpsIndi/kima_runs/apply_kima.py", line 98, in <module>
    run_kima(
    ~~~~~~~~^
        (results_path / "jointModel").as_posix(),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<6 lines>...
        run_joint_model=True,
        ^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/amiguel/RV_analysis/EpsIndi/kima_runs/apply_kima.py", line 84, in run_kima
    kima.run(
    ~~~~~~~~^
        model,
        ^^^^^^
    ...<2 lines>...
        new_level_interval=4000,
        ^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
ValueError: LogUniform distribution must have lower < upper limits

I can't seem to find which prior is setting the LogUniform distribution with the incorrect parameters, as a breakpoint() before the kima.run shows all priors to be None

@j-faria
Copy link
Contributor

j-faria commented Jan 14, 2025

ValueError: LogUniform distribution must have lower < upper limits

This is probably coming from the default prior for eta1_fwhm, which uses the span of the observed FWHM. Can you check if the FWHM is in the right units?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants