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

Fix hardcode magnitude column names #30

Closed
3 tasks done
hdante opened this issue May 10, 2024 · 1 comment · Fixed by #27
Closed
3 tasks done

Fix hardcode magnitude column names #30

hdante opened this issue May 10, 2024 · 1 comment · Fixed by #27
Labels
bug Something isn't working

Comments

@hdante
Copy link

hdante commented May 10, 2024

Hello, when running an estimation with a file using different column names for the magnitudes, I get the following error:

Process 0 running estimator on chunk 0 - 1561
Traceback (most recent call last):
  File "/lustre/t1/cl/lsst/tmp/henrique.almeida/slurm-home/bin/rail-estimate", line 260, in <module>
    main()
  File "/lustre/t1/cl/lsst/tmp/henrique.almeida/slurm-home/bin/rail-estimate", line 256, in main
    estimate(cfg, ctx)
  File "/lustre/t1/cl/lsst/tmp/henrique.almeida/slurm-home/bin/rail-estimate", line 248, in estimate
    ctx.estimator.estimate(ctx.input)
  File "/lustre/t1/cl/lsst/tmp/henrique.almeida/miniconda3/lib/python3.11/site-packages/rail/estimation/estimator.py", line 97, in estimate
    self.run()
  File "/lustre/t1/cl/lsst/tmp/henrique.almeida/miniconda3/lib/python3.11/site-packages/rail/estimation/estimator.py", line 110, in run
    self._process_chunk(s, e, test_data, first)
  File "/lustre/t1/cl/lsst/tmp/henrique.almeida/miniconda3/lib/python3.11/site-packages/rail/estimation/algos/lephare.py", line 214, in _process_chunk
    flux = np.array([data["mag_{}_lsst".format(b)] for b in "ugrizy"]).T
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lustre/t1/cl/lsst/tmp/henrique.almeida/miniconda3/lib/python3.11/site-packages/rail/estimation/algos/lephare.py", line 214, in <listcomp>
    flux = np.array([data["mag_{}_lsst".format(b)] for b in "ugrizy"]).T
                     ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'mag_u_lsst'

I'm passing with the common parameters the correct name ("mag_u").

  • I have described the situation in which the bug arose, including what code was executed, information about my environment, and any applicable data others will need to reproduce the problem.
  • I have included available evidence of the unexpected behavior (including error messages, screenshots, and/or plots) as well as a descriprion of what I expected instead.
  • If I have a solution in mind, I have provided an explanation and/or pseudocode and/or task list.
@hdante hdante added the bug Something isn't working label May 10, 2024
@raphaelshirley
Copy link
Collaborator

raphaelshirley commented May 10, 2024

Hi thanks for the issue. I think I have already fixed this by looping over the bands parameter. This should be merged soon.

I will close when we merge #27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants