LSSTDESC / rail_lephare

RAIL wrapper to the LePHARE photometric redshift code
MIT License
1 stars 0 forks source link

Estimation doesn't work when input file doesn't have redshift column #49

Closed hdante closed 4 months ago

hdante commented 4 months ago

Hello, in input files without the redshift column, executing the redshift estimation doesn't work:

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 199, in _process_chunk
    input = _rail_to_lephare_input(data, self.config.bands, self.config.err_bands)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lustre/t1/cl/lsst/tmp/henrique.almeida/miniconda3/lib/python3.11/site-packages/rail/estimation/algos/lephare.py", line 246, in _rail_to_lephare_input
    ng = data["redshift"].shape[0]
         ~~~~^^^^^^^^^^^^
KeyError: 'redshift'

Before submitting Please check the following:

raphaelshirley commented 4 months ago

Hi, thanks for all the checks. This is easily fixed. I'll create a PR...