Skip to content

MetaDetect Ingester for DP2#469

Open
empEvil wants to merge 38 commits into
masterfrom
MetaDetect_ingest
Open

MetaDetect Ingester for DP2#469
empEvil wants to merge 38 commits into
masterfrom
MetaDetect_ingest

Conversation

@empEvil
Copy link
Copy Markdown
Contributor

@empEvil empEvil commented May 5, 2026

This is the ingestion stage for the Rubin MetaDetect catalog as we expect it to look for DP2

@empEvil
Copy link
Copy Markdown
Contributor Author

empEvil commented May 5, 2026

It currently assumes 'ns' rather than '00' so we might need to merge that change at the same time

@empEvil
Copy link
Copy Markdown
Contributor Author

empEvil commented May 5, 2026

so in the Schema for MetaDetect there are 2 different psf_T values, one is the original, and one is after the reconvolution, which one is it we require?

@joezuntz
Copy link
Copy Markdown
Collaborator

joezuntz commented May 5, 2026

Good question. I guess for computing T / Tpsf we need the re-convolved one since the T will be re-convolved as well? But for null tests we probably want the other one. I guess this is why both were in there before. That's annoying. Could you ingest the non-reconvolved one as "original" or something like that?

Comment thread txpipe/ingest/MetaDetect.py Outdated
}


class TXIngestMetaDetect(PipelineStage):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add DP1 to the name of this class to distinguish from e.g. DESY6.

Also since all of this recaps some stuff that is in dp1.py, is there a reason it's not in there, or deleted from there?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is meant for DP2, but can add that to it (it should work on DP1 as well because they look the same)

Comment thread txpipe/ingest/__init__.py Outdated
Comment thread txpipe/ingest/lsst.py Outdated
"ra": var_data["ra"],
"dec": var_data["dec"],
"id": var_data["shearObjectId"],
"metaStep": var_data["metaStep"].astype("S"), #might not be needed
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should all be the same I think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry what do you mean?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You wrote that it might not be needed, and I think that's right because this whole data set should have the same metaStep value because that's how they are selected. So no need to save it.

Comment thread txpipe/ingest/lsst.py
"psf_g1": var_data["gauss_psfReconvolved_g1"],
"psf_g2": var_data["gauss_psfReconvolved_g1"],
"psf_T_mean": var_data["gauss_psfReconvolved_T"],
"flags": var_data["gauss_shape_flags"], # TO BE ADDRESSED!
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain the comment more?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I wasn't sure if that was the only flag we needed, or if we need to add a bunch of the flags instead.

if not created_files:
created_files = True
variants = {
"ns": len(shear_data["ns"]),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave this as "ns" and change the rest of the code before merging since we have to do it anyway.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do I/we update the sample catalog that the CI uses to reflect this change?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, will need to do a whole replacement process. A bit fiddly.

# replace masked values with nans
if np.ma.isMaskedArray(col):
col = col.filled(np.nan)
k[name].append(col) #NOT SURE THIS WORKS EITHER TBD
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you checked this as the comment says? Delete comment if so.

Comment thread txpipe/ingest/MetaDetect.py Outdated
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

Successfully merging this pull request may close these issues.

2 participants