-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
added Left and Right Circular Projection matrix #3599
Conversation
@a-r-williamson I've assigned this one to you to look over. |
…rgument in null-snr function to avoid null cuts; and removed some extra comments.
fix a bracket in pycbc_reweight_snr function
With the above commits now pycbc-multi-inspiral and lalapps_coh_PTF_inspiral code give same results when using left anf right circular polarization matrices. The details can be found at https://wiki.ligo.org/Bursts/CircularlyPolarizedProjectionMatrix |
bin/pycbc_multi_inspiral
Outdated
@@ -107,6 +107,7 @@ parser.add_argument("--null-step", type=float, default=20., help=""" | |||
parser.add_argument("--trigger-time", type=int, help=""" | |||
Time of the GRB, used to set the antenna patterns.""") | |||
|
|||
parser.add_argument("--projection-type", default='standard', type=str, help="""Choice of projection matrix with standard, left circular or right circular""") |
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.
parser.add_argument("--projection-type", default='standard', type=str, help="""Choice of projection matrix with standard, left circular or right circular""") | |
parser.add_argument("--projection-type", default="standard", | |
choices=["standard", "left", "right", "left+right"], | |
help="Choice of projection matrix. 'Left' and 'right' " | |
"correspond to face-away and face-on.") |
bin/pycbc_multi_inspiral
Outdated
@@ -211,6 +211,16 @@ def get_projection_matrix(wp, wc): | |||
return projection_matrix | |||
|
|||
|
|||
def circular_projection_matrix(wp, wc): |
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.
Can we perhaps unify this into the above function get_projection_matrix
which could have a kwarg for the projection name?
bin/pycbc_multi_inspiral
Outdated
@@ -513,6 +528,10 @@ with ctx: | |||
sigma = {ifo : np.sqrt(sigmasq[ifo]) for ifo in opt.instruments} | |||
# Every time s_num is zero or we skip the segment, we run new | |||
# template to increment the template index | |||
####### Testing values |
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.
####### Testing values |
bin/pycbc_multi_inspiral
Outdated
####### Testing values | ||
wp,wc=get_weighted_antenna_patterns(Fp,Fc,sigma) | ||
projection_matrix = get_projection_matrix(wp,wc) | ||
LCprojection_matrix, RCprojection_matrix = circular_projection_matrix(wp, wc) |
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.
We also need to account for the normal GRB search behaviour where both right and left projections are used.
…th a kwargs choice. Modify code before coherent snr calculation
I make changes and push them. Kindly check it |
bin/pycbc_multi_inspiral
Outdated
return left_projection_matrix, right_projection_matrix | ||
|
||
else: | ||
logging.info("choice of projection matrix is not available") |
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.
This should probably be an exception, not a logging.info()
call:
raise ValueError('unknown projection type ' + str(projection_type))
bin/pycbc_multi_inspiral
Outdated
|
||
if projection_type=='standard': | ||
logging.info("choice of projection matrix is %s" | ||
% str(projection_type)) |
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.
Calls to logging.info()
should not use the string formatting operations (%
and .format()
). Instead, do this:
logging.info("choice of projection matrix is %s", projection_type)
(this comment also applies to logging.info()
calls further below).
… rather a message for wrong option inputs
Fixed some issues for review. |
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.
Hi @JAMSADIQ, thanks for the recent commits. I've requested a few minor changes here, which hopefully you can just click accept on then I can approve the PR.
bin/pycbc_multi_inspiral
Outdated
logging.info("%s points above coherent threshold" | ||
% str(len(rho_coh))) |
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.
logging.info("%s points above coherent threshold" | |
% str(len(rho_coh))) | |
logging.info("%d points above coherent threshold", len(rho_coh)) |
bin/pycbc_multi_inspiral
Outdated
logging.info("Max coincident SNR = %s" | ||
% str(max(rho_coinc))) |
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.
logging.info("Max coincident SNR = %s" | |
% str(max(rho_coinc))) | |
logging.info("Max coincident SNR = %.2f", max(rho_coinc)) |
Co-authored-by: Andrew R. Williamson <a-r-williamson@users.noreply.github.com>
…gging info statments
* added Left and Right Circular Projection matrix * make some changes in projection matrix * Deleted the file from the git repository * removed extra commented lines * fix bug in new function denominator term * "added option to save network chi squared in he output hdf file" * replace reweighted-snr with coherent-snr in clustering; added a new argument in null-snr function to avoid null cuts; and removed some extra comments. * Update pycbc_multi_inspiral fix a bracket in pycbc_reweight_snr function * fixed the argparser option for projection type * modify projection matrix function adding left and right projection with a kwargs choice. Modify code before coherent snr calculation * added the option of left_right in projection matrix function and modify code * fixed some typos * minor changes * fixed logging info string formatting operations and use of ValueError rather a message for wrong option inputs * removed extra function of circular polarization * make changes in coding several line for recomended coding * Update bin/pycbc_multi_inspiral Co-authored-by: Andrew R. Williamson <a-r-williamson@users.noreply.github.com> * make some suggested minor chnages in a comment of function and few logging info statments Co-authored-by: Jam Sadiq <jam.sadiq@ldas-pcdev1.ligo.caltech.edu> Co-authored-by: Jam Sadiq <jam.sadiq@ldas-pcdev6.ligo.caltech.edu> Co-authored-by: Andrew R. Williamson <a-r-williamson@users.noreply.github.com>
Added a new function in this code for left and right circular polarization projection matrix.