Skip to content

Adding rubin_proc - #25

Open
bungerbuilder wants to merge 10 commits into
schlafly:masterfrom
bungerbuilder:master
Open

Adding rubin_proc#25
bungerbuilder wants to merge 10 commits into
schlafly:masterfrom
bungerbuilder:master

Conversation

@bungerbuilder

Copy link
Copy Markdown

Rubin_proc, given a visitId and detector number, will in the RSP DP1 environment:

  • retrieves a visit_image using a visit ID and detector
  • converts the Rubin PSF into a Crowdsource-compatible PSF
  • prepares the image, inverse-uncertainty, and mask arrays
  • passes processing options to crowdsource_base.fit_im
  • returns both the Crowdsource results and Rubin exposure

@schlafly schlafly left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Some minor comments in line, but this looks pretty good, thanks!

Comment thread crowdsource/rubin_proc.py Outdated
Comment thread crowdsource/rubin_proc.py Outdated
Comment on lines +36 to +40
stamp = np.clip(np.array(psf_stamp_visit), 1e-10, np.inf)
stamp = stamp / np.sum(stamp)

psf = psfmod.SimplePSF(stamp)
psf.fitfun = partial(psfmod.wise_psf_fit, psfstamp=stamp)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

We'll want to avoid relying on WISE here, since that will do some weird things, like assuming that the diffraction spikes get spread out near the ecliptic poles.

We probably want to eventually just overhaul the PSF determination, but it's also worth thinking about what the right behavior is wrt negatives in the Rubin PSF; I doubt we 'really' want to clip and renormalize, but it's fine for now.

Comment thread crowdsource/rubin_proc.py Outdated
Comment thread crowdsource/rubin_proc.py Outdated
Comment thread crowdsource/rubin_proc.py
Comment thread crowdsource/rubin_proc.py Outdated

print("CROWDSOURCE is done!")

return res, visit_image

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please add a CLI along the lines of what is in simple_proc, so that you can either use this from python or from the command line. That's the if name == 'main' thing at the end.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Just out of curiosity, have you tried the CLI? It looks right to me but it would be good to try it once.

bungerbuilder and others added 7 commits July 15, 2026 14:11
Co-authored-by: Eddie Schlafly <eschlafly@gmail.com>
Co-authored-by: Eddie Schlafly <eschlafly@gmail.com>
Co-authored-by: Eddie Schlafly <eschlafly@gmail.com>
Co-authored-by: Eddie Schlafly <eschlafly@gmail.com>
Changed so that process() only gives back res. Also added arguments for a CLI line.
Changed from functions --> more like simple_proc codes.
Now using fit_variable_moffat_psf
Comment thread crowdsource/rubin_proc.py
psf = psfmod.SimplePSF(stamp)

print("Using fit_variable_moffat_psf")
psf.fitfun = psfmod.fit_variable_moffat_psf

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

You mentioned needing an update to psf.py here, but I don't see it. You'll probably need to git add that file.

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