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

Ellipticity, position angle correction in protodc2 GCR. #48

Merged
merged 26 commits into from
Dec 8, 2017

Conversation

dkorytov
Copy link
Contributor

@dkorytov dkorytov commented Dec 7, 2017

No description provided.

@yymao yymao self-requested a review December 7, 2017 20:54
@yymao yymao added the reader Issues related to reader modules label Dec 7, 2017
Copy link
Member

@yymao yymao left a comment

Choose a reason for hiding this comment

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

Thanks, @dkorytov. I've made some inline comments.

@@ -65,7 +66,9 @@ def _subclass_init(self, filename, **kwargs):
'size_bulge_true': 'morphology/spheroidHalfLightRadius',
'disk_sersic_index': 'morphology/diskSersicIndex',
'bulge_sersic_index': 'morphology/spheroidSersicIndex',
'ellipticity_1': 'morphology/totalEllipticity1',
'position_angle': (lambda pos_angle: pos_angle*(180.0/np.pi)**2,'morphology/positionAngle'),
Copy link
Member

Choose a reason for hiding this comment

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

  • Please confirm if **2 in this formula is correct
  • use np.rad2deg instead of *(180.0/np.pi)
  • Please add one space after comma

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I incorrectly converted the units, so I have apply the conversion twice. The position angle comes out 0->180. I can apply the function twice...

@@ -65,7 +66,9 @@ def _subclass_init(self, filename, **kwargs):
'size_bulge_true': 'morphology/spheroidHalfLightRadius',
'disk_sersic_index': 'morphology/diskSersicIndex',
'bulge_sersic_index': 'morphology/spheroidSersicIndex',
'ellipticity_1': 'morphology/totalEllipticity1',
'position_angle': (lambda pos_angle: pos_angle*(180.0/np.pi)**2,'morphology/positionAngle'),
'ellipticity_1': (lambda ellip2, pos_angle : ellip2/np.tan(2*pos_angle*(180.0/np.pi)) , 'morphology/totalEllipticity2','morphology/positionAngle'),
Copy link
Member

Choose a reason for hiding this comment

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

  • use np.rad2deg instead of *(180.0/np.pi)
  • Please add one space after commas, and remove spaces before commas
  • Please remove the space before colon

'ellipticity_1': 'morphology/totalEllipticity1',
'position_angle': (lambda pos_angle: pos_angle*(180.0/np.pi)**2,'morphology/positionAngle'),
'ellipticity_1': (lambda ellip2, pos_angle : ellip2/np.tan(2*pos_angle*(180.0/np.pi)) , 'morphology/totalEllipticity2','morphology/positionAngle'),
'size_true': (lambda size1,size2,lum1,lum2: ((size1*lum1)+(size2*lum2))/(lum1+lum2),'morphology/diskHalfLightRadius','morphology/spheroidHalfLightRadius','LSST_filters/diskLuminositiesStellar:LSST_r:rest','LSST_filters/spheroidLuminositiesStellar:LSST_r:rest'),
Copy link
Member

Choose a reason for hiding this comment

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

  • Please add one space after commas

@@ -12,6 +12,7 @@
__all__ = ['AlphaQGalaxyCatalog']



Copy link
Member

Choose a reason for hiding this comment

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

Add a line __version__ = '2.1.1.1' (or your preferred versioning scheme) to indicate the version of this reader file.

@@ -74,7 +77,7 @@ def _subclass_init(self, filename, **kwargs):
'velocity_y': 'vy',
'velocity_z': 'vz',
}

Copy link
Member

Choose a reason for hiding this comment

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

remove unneeded space

self.sky_area = fh['metaData/skyArea'].value
else:
self.sky_area = 25 #If the sky area isn't specified use the default value of the sky area.

Copy link
Member

Choose a reason for hiding this comment

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

add self.sky_area = float(self.sky_area) to ensure it is a float

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reader Issues related to reader modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants