LSSTDESC / rail_astro_tools

Rail utility stages that depend on astronomy package such as healpy, astropy etc...
MIT License
0 stars 0 forks source link

Change the base class of lsst_noise_model, grid_selection, and spectroscopic_degrader #36

Closed ztq1996 closed 6 months ago

ztq1996 commented 6 months ago

Problem & Solution Description (including issue #)

In this PR I have

  1. added a general photometric error model class, which is an expansion of the old LSST error model class with the inclusion of the Roman and Euclid error model.
  2. Change the base class of the grid_selection from degrader to selector, implement the _select function, and return a flag with the same length as that of the input data. I have make sure that the notebook in rail hub imports the new class and runs okay without the change needed.

Code Quality

hangqianjun commented 6 months ago

Update on the selector (c.f. discussion in slack): resolving the problem with

data = input
some_criteria = something_about(data)
data2 = data[some_criteria]

another_criteria = something_else_about(data2)
data3 = data2[another_criteria]

return data3

where selection for data3 is untraceable directly to data. Option may be to add a tracker of the object ID or row index.

ztq1996 commented 6 months ago

Great idea, I will implement the id approach tomorrow for the grid selection, because there are so many layers of selections

jfcrenshaw commented 6 months ago

LGTM!