-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add area to available statistics #70
Conversation
Good idea. There are a few definitions for area in common use -- one is just the area of the mask (or projected mask in PPV). The other uses sig_maj and sig_min, to give an intensity-weighted spatial dispersion. It's probably best to just pick one for now. |
I was thinking more the actual area of the mask, which is the 'real' area of the structure. The area of the ellipse is easy enough to derive. Though we could have |
@ChrisBeaumont - what do you think of the attached code? For |
+1. Projecting the PPV cube to compute area_exact sounds good -- Rahul Shetty (and others) have used this definition of area in papers. |
""" | ||
The area of the ellipse representing the first and second moments of the structure. | ||
""" | ||
return np.pi * self.major_sigma * self.minor_sigma |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be 2 pi?
@property | ||
def area_ellipse(self): | ||
""" | ||
The area of the ellipse representing the first and second moments of the structure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the docstring needs to more clearly state whether the ellipse passes through sigma, or HWHM (appears to be the latter)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I don't think the first moments are relevant here, only the second?
Proposed new docstring:
The area of the ellipse defined by the second moment, where the major and minor axes used are HWHM (half-width at half-max) measures:
.. math::
\pi HWHM_{maj} HWHM_{min}
though the "math" bit is probably just as easy to say:
area = pi HWHM(maj) HWHM(min)
Looks good, except for the note about the imprecise docstring |
I clarified the docstring. I didn't include the equation because it won't be visible in the docs since this is a property (only the first sentence of text is shown). |
Looks good (is the full docstring at least displayed by IPython?) |
@ChrisBeaumont - yes, it should be actually - though in that case I would vote that we can include the equation as 'human-readable' rather than LaTeX since it will never be rendered in LaTeX. |
Looks good to me |
Add area to available statistics
Should be straightforward - need to remember to get the units right if
spatial_scale
is available.