-
Notifications
You must be signed in to change notification settings - Fork 3
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
pspecbeam.PSpecBeamUV updates for efield beam #143
Conversation
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.
Changes look good to me. I think @Chuneeta had some comments too though.
@@ -429,7 +440,7 @@ def power_beam_sq_int(self, pol='pI'): | |||
primary_beam_area: float, array-like | |||
""" | |||
if hasattr(self.primary_beam, 'get_beam_area'): | |||
return self.primary_beam.get_beam_sq_area(pol) | |||
return np.real(self.primary_beam.get_beam_sq_area(pol)) |
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 function be returning complex numbers to begin with? Or is there a bug in get_beam_sq_area
?
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.
That's what I was asking @bhazelton, and I never got a response, but I think I came to the conclusion that in principle it can be complex (e.g. when asking for XY
and YX
areas), but in practice we will always be using XX
or YY
or pI
or pQ
beams, in which case it is real. But @bhazelton let me know if you have any opinions on that.
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.
looks good! Just a comment that needs to be implemented.
# setup primary power beam | ||
self.primary_beam = uvb | ||
if uvb.beam_type == 'efield': | ||
self.primary_beam.efield_to_power(inplace=True) |
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.
efield_to_power is called for linear polarizations, for pseudo-stokes you need to use the function efield_to_pstokes.
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.
So this is done assuming one only wants linear dipole polarization. This function is (purposely) not trying to be smart and will not convert the efield to pstokes. To pspecbeam
for pstokes parameters, one needs to feed a pstokes power beam. (see the unit tests added where I test for exactly this case). I'll make a comment specifying this in the docstring!
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.
Looks good. Let's get this merged.
Updates the beam files in the
hera_pspec/data
directory, and allowspspecbeam.PSpecBeamUV
to take an efield beam and convert to power beams.