Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DECaPS2 commit #3

Merged
merged 62 commits into from
Sep 9, 2021
Merged

DECaPS2 commit #3

merged 62 commits into from
Sep 9, 2021

Conversation

andrew-saydjari
Copy link
Collaborator

The long awaited DECaPS2 Commit. The PR includes the synthetic injection pipeline developed for DECam uncertainty estimates. Validation of the injection pipeline is available upon request.

@andrew-saydjari
Copy link
Collaborator Author

More detailed comments since a bit more was done:

  • some of the run and saving code was separated into new functions in order to support the injection tests and reduce duplications of the code
  • the injection pipeline works by reading the psf model from a completed ccd, and injecting stars randomly at positions that are not at the edges and uniformly drawn. The fluxes are drawn from the observed flux distribution via cdf sampling. Note that this flux distribution is not the TRUE flux distribution. There are many faint sources not found by crowdsource and the injections only match the flux distribution of found sources.
  • the injection tests are saved with identical names to the usual DECam files with an extra .I. extension to indicate that they have been injected.
  • the injection fraction can be controlled from the cmd line and is set at 10% by default (10% of the number of stars found in the original image are injected on top of the original image).
  • the injected images are run as if they were a CCD in the original observation run with no other modifications
  • injected CCDs can be distinguished in the catalogues by keys ending in I. For example, injection into N28 results in a new CCD in the cat and mod files called N28I.
  • finally, the "ground truth" parameters of the flux and positions of the injected sources are saved as a MCK field in the cat files for later use during calibration.
  • galaxy masking module was updated with some by-hand exclusions validated by AKS. To create this list we restrict gal to -10<b<10 from the hyperleda query obtained from ameisner, restrict diam > 1 arcmin, plot all of these galaxy masks on top of images, list all galaxies that do not appear in the images for all 5 bands. This led to 8 galaxies removed by hand.

@andrew-saydjari andrew-saydjari changed the title DECaPS2 Commit DECaPS2 commit Sep 9, 2021
nx, ny = im.shape

# this requres stars to be "good" and in a reasonable flux range (0 flux to 17th mag)
maskf = ((flags_stars==1) | (flags_stars==2097153)) & (flux_stars>0) & (flux_stars<158489.3192461114);
Copy link
Owner

Choose a reason for hiding this comment

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

Is this 17th mag assuming some nominal zero point for a particular band? This number is oddly specific.

Copy link
Collaborator Author

@andrew-saydjari andrew-saydjari Sep 9, 2021

Choose a reason for hiding this comment

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

LOL, that is exactly what it is. It is 17th mag in g-band using the mean zero point from DECaPS 1. I don't think the actual number matters, that is just how I picked it.

Copy link
Owner

Choose a reason for hiding this comment

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

Let's clarify both these numbers after your run. i.e., 150000 to me better expresses the concept of "not too bright" than 158489; the corresponding comment might be that 17th mag in g roughly corresponds to 160k counts.

I'd usually write your flag cut as something like (flags & ~decam_proc.extrabits['diffuse']) == 2**0, but that's just stylistic. It would be good form to refer to the diffuse bit by name rather than by that decimal.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure. Good code comments all.

@schlafly
Copy link
Owner

schlafly commented Sep 9, 2021

This looks good to me. Feel free to merge at your convenience. "save_fxn" is starting to have few enough arguments that it might make sense to actually name its arguments and break them out of the dictionary, and give the function a real name, but I haven't actually looked at how ugly that is and will defer to your judgment. I think you have permissions to merge and should be able to do this when you're ready; let me know otherwise. Thanks!

@andrew-saydjari
Copy link
Collaborator Author

I tried that and had missed a value that I updated in the dictionary higher up but forgot to propagate once during the validation phase, so I am going to leave it how it is. It probably could be done, but not worth the effort.

@andrew-saydjari andrew-saydjari merged commit 673bf9b into schlafly:master Sep 9, 2021
andrew-saydjari added a commit that referenced this pull request Jan 16, 2022
pyPI conforming changes (#4)
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