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

Notebook about stack measurements of size & centroid on pixelized images #210

Merged
merged 3 commits into from
Aug 14, 2019

Conversation

andrewkbradshaw
Copy link
Member

This notebook simulates and measures objects near the pixel scale, illustrating a bias in the calculation of moments on pixelized images. A corrective algorithm modification is proposed. This addresses the very core of issue #123 . Looking for a reviewer!

… scale, illustrating a bias in the calculation of moments on pixelized images
@kadrlica kadrlica self-requested a review August 12, 2019 13:50
@andrewkbradshaw
Copy link
Member Author

Thanks for the great suggestions Alex. Removing the source extractor was a good idea. I removed the corrected first moment definition, and added another wider Gaussian weight to the centroid measurement to illustrate the issue. Is this ready to merge to master? @kadrlica

Copy link
Contributor

@kadrlica kadrlica left a comment

Choose a reason for hiding this comment

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

Awesome, looks good. I'll approve and merge.

" else:\n",
" self.sensor = None\n",
" \n",
" def draw_gaussian(self,offset=(0.0,0.0),gal_sigma_pix=1.5,gal_ellip=0,\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

I haven't gone far enough to know if/why this makes sense, but I think it would be conceptually clearer to separate the hsm fitting from the Gaussian image generation (also, doesn't seem like the hsm fit belongs in a function called draw_gaussian.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahhh I forgot this too in the PCW chaos! That would be a good addition

"outputs": [],
"source": [
"def calc_firstmoms(img,coord,winsize,thresh,gwin_sig):\n",
" #print(img[:5,:5],coord,winsize,thresh,gwin_sig)\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume that you don't mean for this comment string to be here.

"toc-hr-collapsed": true
},
"source": [
"## Functions to make images"
Copy link
Contributor

Choose a reason for hiding this comment

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

It'd be very useful to have some context here. Something along the lines of "Here we define some functions to use GalSim to generate images of detectors. Various levels of realism (sensor features, sky background, noise, etc.) are configurable. We also provide functionality to generate a Gaussian source..."

"outputs": [],
"source": [
"# Import sep, uncomment the line below if you haven't got it installed yet\n",
"# !pip install sep --user\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure that I like this. Having python modules floating around in the users PYTHONPATH will not play nicely with conda environments (and will probably come back to bite us once we've forgotten). Unfortunately, I'm not sure I have a better solution. Is the SExtractor comparison integral to the notebook?

@kadrlica kadrlica merged commit 9f1bb62 into master Aug 14, 2019
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