Adding functionalities to create calibration config files#4537
Adding functionalities to create calibration config files#4537sum33it merged 23 commits intogwastro:masterfrom
Conversation
|
@sum33it I don't think there are any strong objections to this. Maybe you can add a short example of using this? If that works, then I think we can go ahead and merge. |
|
@sum33it What's the status of this? Can we get this rebased and then merged? |
2ffc6b1 to
f80c68f
Compare
cb525d2 to
d5f7a07
Compare
|
@ahnitz I think this PR is ready for the review. |
|
@sum33it Can you add an example to the documentation? I think in this case, that would be very useful and help verify the code continues to work. |
|
I will open a follow-up PR for detailed documentation and examples. But here, I have added an example script of how to generate a calibration config file for GW150914. The extension to other events is trivial: one needs to provide appropriate arguments like ifo-list and trigger-time. |
766b520 to
32f811e
Compare
mj-will
left a comment
There was a problem hiding this comment.
I've had a look over the new function for reading the calibration envelopes and added a few minor comments.
| else: | ||
| pass |
There was a problem hiding this comment.
I don't think this is necessary.
There was a problem hiding this comment.
In general, it might not be needed, but I still want to keep it in case we go beyond the frequency range of the calibration provided by the calibration envelopes. For example, if someone wants to do PE with a lower cutoff frequency than the standard, they might be tempted to give the same f_lower for calibration config file generation. This option should safeguard against that.
There was a problem hiding this comment.
Ah, just to clarify, I mean then else part of the if/else statement. I think it's a good idea to keep the checks you implemented.
There was a problem hiding this comment.
Got it. Thanks for the clarification. I agree with that. Will do in the following commit.
There was a problem hiding this comment.
@mj-will I have made the necessary changes and pushed the new commit.
| else: | ||
| pass |
|
Hi @mj-will |
|
@sum33it The unit tests need to pass. That's why I said to rebase, then see if anything needs to be addressed there. Otherwise, I don't have other objections. |
d5f7a07 to
849a4c8
Compare
|
@ahnitz I have rebased it and there is one failed test and it seems that it is not originating from my commits. What do you suggest? |
|
@sum33it Try rebasing to gwastro:master and starting the checks again - they've expired now so I can't check the run failures, but I will take a look at them if it fails again |
|
@GarethCabournDavies The two failed tests are related to i) |
|
I think the sphinx documentation failure is real - when I try and run the The documentation will run the examples in the |
|
(which makes sense as it hardcodes files in your own path) |
GarethCabournDavies
left a comment
There was a problem hiding this comment.
These changes should work to make the example run locally.
As an aside, it would neaten up the code if you could change print statements to logging, and use the pycbc.add_common_pycbc_options and pycbc.init_logging functions, but no worries if you can't.
…libration_uncertainty_files_o1_o2_o3.sh Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org>
…libration_config.sh Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org>
|
Thanks @GarethCabournDavies I implemented your changes in the |
|
@ahnitz Do you have any objection on merging it? Failed test seems to be coming from sphinx documentation failure which is not related to this PR. |
|
The documentation failure is related to this patch. It must be fixed before this can be merged: |
|
Thanks a lot @spxiwh for pointing this out. I have fixed that and now there is one skipped test related to |
|
@spxiwh, @GarethCabournDavies , @ahnitz: If you have no further objections, shall we merge it now? |
GarethCabournDavies
left a comment
There was a problem hiding this comment.
You can got for it merging for me - Ive made a couple of suggestions for using logging rather than printing.
It looks like one of the print statements should be an error. You can change this to logging.warning if preferred though
Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org>
Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org>
Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org>
Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org>
Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org>
|
Thanks @GarethCabournDavies for suggestions! I have accepted your suggested commits. I will merge it sometime today. |
|
Weirdly, this passed without #5156 ?? |
* WIP: Adding utilities to create calibration files` * WIP: Added a binary script for creating calibration config file * WIP: updating functions for writing calibration file. * WIP * WIP: Functions for calibration configuration * WIP: Added functions to read envelop files * Updated the scripts to create calibration files * Added examples to generate config files * Fixed a minor bug in the function to read calibration envelop files * Updated the create_calibration_file for additional functionality * Minor cleanup for unusual imports * Update examples/inference/calibration_configuration_files/download_calibration_uncertainty_files_o1_o2_o3.sh Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org> * Update examples/inference/calibration_configuration_files/generate_calibration_config.sh Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org> * Docstring cleanup * Fix for the unit tests fail * Cleanup of the main executable file * Cleanup for unit tests * Cleanup * Update bin/inference/pycbc_inference_create_calibration_config Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org> * Update bin/inference/pycbc_inference_create_calibration_config Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org> * Update bin/inference/pycbc_inference_create_calibration_config Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org> * Update bin/inference/pycbc_inference_create_calibration_config Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org> * Update bin/inference/pycbc_inference_create_calibration_config Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org> --------- Co-authored-by: Sumit Kumar <sumit.kumar@condor5.atlas.local> Co-authored-by: Sumit Kumar <sumit.kumar@condor4.atlas.local> Co-authored-by: Sumit Kumar <sumit.kumar@holodeck1> Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org>
* WIP: Adding utilities to create calibration files` * WIP: Added a binary script for creating calibration config file * WIP: updating functions for writing calibration file. * WIP * WIP: Functions for calibration configuration * WIP: Added functions to read envelop files * Updated the scripts to create calibration files * Added examples to generate config files * Fixed a minor bug in the function to read calibration envelop files * Updated the create_calibration_file for additional functionality * Minor cleanup for unusual imports * Update examples/inference/calibration_configuration_files/download_calibration_uncertainty_files_o1_o2_o3.sh Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org> * Update examples/inference/calibration_configuration_files/generate_calibration_config.sh Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org> * Docstring cleanup * Fix for the unit tests fail * Cleanup of the main executable file * Cleanup for unit tests * Cleanup * Update bin/inference/pycbc_inference_create_calibration_config Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org> * Update bin/inference/pycbc_inference_create_calibration_config Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org> * Update bin/inference/pycbc_inference_create_calibration_config Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org> * Update bin/inference/pycbc_inference_create_calibration_config Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org> * Update bin/inference/pycbc_inference_create_calibration_config Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org> --------- Co-authored-by: Sumit Kumar <sumit.kumar@condor5.atlas.local> Co-authored-by: Sumit Kumar <sumit.kumar@condor4.atlas.local> Co-authored-by: Sumit Kumar <sumit.kumar@holodeck1> Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org>
To incorporate calibration uncertainties in PE runs, one need to provide a calibration configuration files to
pycbc_inferencecode. Although, the support for the calibration config file exist, we still do not have a way to generate these config files, within PyCBC infrastructure. In this PR, I include the full infrastructure to generate the config files for PE runs for any GPS time from the publicly available calibration envelopes provided by LIGO-Virgo.