Skip to content

LephareInformer fails during prepare with missing LSST filter files (total_u.pb) despite default cache setup #85

Description

@anat-dsht

Description

I am running the LephareInformer stage from rail.estimation.algos.lephare in a JupyterLab environment on a remote cluster (CCIN2P3). The pipeline fails during the prepare step due to missing filter files, even though the default cache directories are automatically set and detected.

The error suggests that required LSST filter files (e.g. total_u.pb) are not present in the expected LEPHAREDIR directory.


Full notebook (reproducible example)

from rail.utils import catalog_utils
from rail.estimation.algos import lephare 
from rail.core.data import TableHandle

# Load catalog config
catalog_utils.load_yaml("catalogs.yaml")
catalog_utils.apply("cardinal_roman_rubin")

# Create informer
informer = lephare.LephareInformer.make_stage(
    name="inform",
    output_mode="return",
    hdf5_groupname="",
    do_prepare=True,
)

# Remove env variables to rely on default cache behavior
import os 
os.environ.pop("LEPHAREDIR")
os.environ.pop("LEPHAREWORK")

# Load data
train_data = TableHandle(
    "train", path="public/pz_challenge_taskset_1_cardinal_training_10yr.hdf5"
)
test_data = TableHandle(
    "test", path="public/pz_challenge_taskset_1_cardinal_test_10yr.hdf5"
)

# Run informer
model = informer.inform(train_data)

Console output

LEPHAREDIR is being set to the default cache directory:
/pbs/home/a/adesouhant/.cache/lephare/data
More than 1Gb may be written there.

LEPHAREWORK is being set to the default cache directory:
/pbs/home/a/adesouhant/.cache/lephare/work

Default work cache is already linked. 
This is linked to the run directory:
/pbs/home/a/adesouhant/.cache/lephare/runs/20260415T192106

Then later:

User defined LEPHAREDIR is set. Code runs depend on all required
auxiliary data being present at /pbs/home/a/adesouhant/.cache/lephare/data.
User defined LEPHAREWORK is set. All intermediate files will be written to:
/pbs/home/a/adesouhant/.cache/lephare/runs/inform

Error

ValueError: Can't open filter file 
/pbs/home/a/adesouhant/.cache/lephare/data/filt/lsst/total_u.pb

Traceback points to:

  • lephare.prepare
  • FilterSvc.from_keymap

Observations

  • The cache directory is correctly created and detected

  • However, the directory:

    /pbs/home/a/adesouhant/.cache/lephare/data/filt/lsst/
    

    does not contain the required .pb files

  • do_prepare=True does not seem to generate these filter files automatically

  • Removing LEPHAREDIR and LEPHAREWORK does not fix the issue (they are reset internally)


Expected behavior

Either:

  1. Required auxiliary data (filters, templates, etc.) should be automatically downloaded/initialized
    or
  2. A clear error message should indicate that manual setup is required

Actual behavior

The pipeline fails with a low-level error:

ValueError: Can't open filter file ...

without guidance on how to obtain or generate the missing files.


Questions

  1. Is there a recommended way to install/download LePhare auxiliary data when using RAIL?
  2. Should LSST filter files (total_u.pb, etc.) be generated by prepare, or provided beforehand?
  3. Is there a script or helper function to initialize $LEPHAREDIR properly?
  4. Is this expected behavior when using catalog_utils.apply("cardinal_roman_rubin")?

Environment

  • Platform: CCIN2P3 cluster (remote JupyterLab)

  • Python: 3.11 (conda env)

  • Packages:

    • rail
    • lephare

Additional note

The issue might be related to missing initialization of LePhare data (filters/templates), rather than a runtime bug in RAIL itself.


Thanks for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions