-
Notifications
You must be signed in to change notification settings - Fork 22
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
Remove blinding civ [bump minor] #1046
Conversation
py/picca/io.py
Outdated
else: # This is for BinTable format | ||
|
||
# check if we are doing metal forests | ||
if "MIN_RF_WAVE" in header and "MIN_RF_WAVE" in header: |
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.
@iprafols - you probably meant MAX_RF_WAVE in one of these clauses
py/picca/io.py
Outdated
max_rf_wave = header["MAX_RF_WAVE"] | ||
if min_rf_wave > lya_wave and max_rf_wave > lya_wave: | ||
if lambda_abs2 is None: | ||
lambda_abs2 = lambda_abs |
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.
Why do you need to set lambda_abs2 here?
py/picca/io.py
Outdated
if lambda_abs2 is None: | ||
lambda_abs2 = lambda_abs | ||
blinding_tracers = ["LYA", "QSO"] | ||
if tracer1 not in blinding_tracers and tracer2 not in blinding_tracers: |
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.
@iprafols - I think you want to have an "or" here, since we don't want to blind QSO x CIV either. Basically, you want to blind only when both tracers are either LyA or QSO
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.
@iprafols - it looks like you have fixed this above (for the ImageHDU format) but you have not fixed it for the BinTable format. It still says "and" instead of "or"
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.
@iprafols - I added several comments on the code, most of them are important enough that should be fixed.
I'm also surprised by the large number of files changed, in particular some log files related to picca delta attributes? Are these related to automated testing, or were they added by mistake?
Another comment: when @julienguy runs his analysis of CIV auto-correlations, he actually tells Picca to run the Lya auto-correlation but passes CIV deltas. He does this because he wants to see use the "wrong" Lya coordinates that we use in the main analysis, but without having to deal with the Lya correlation "contaminating" the CIV signal. Similarly, we don't want to blind either the QSO x CIV(LYA) correlation (that Cesar is computing). So we should only blind when we have all of the above TRUE:
Even when only one of these is False we should not blind. Do you agree @julienguy ? |
Hi @andreufont , I fixed the comments on the code. Thanks! |
@andreufont , are you happy with the changes? should we merge this? |
@@ -253,7 +253,7 @@ def main(cmdargs): | |||
xcf.lambda_abs = constants.ABSORBER_IGM[args.lambda_abs] | |||
|
|||
# read blinding keyword | |||
blinding = io.read_blinding(args.in_dir) | |||
blinding = io.read_blinding(args.in_dir, args.lambda_abs, args.lambda_abs_obj) |
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 would have expected the second argument here would be 'obj_name' as in picca_xcf, but I noticed that this variable is named different in this (not very popular) script, so we can leave it as is for now.
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.
@iprafols - has this been tested? I found a couple of bugs that I think should be fixed, and it would also be good if someone looking into these (Andrea? Julien? Cesar?) checked that the branch works as intended.
py/picca/io.py
Outdated
max_rf_wave = header["MAX_RF_WAVE"] | ||
if min_rf_wave > lya_wave and max_rf_wave > lya_wave: | ||
if tracer2 is None: | ||
tracer2 = lambda_abs |
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.
@iprafols - where have you defined lambda_abs? Shouldn't you use here tracer2 = tracer1?
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.
Have you tested this code? It looks like it should have crashed...
py/picca/io.py
Outdated
max_rf_wave = header["MAX_RF_WAVE"] | ||
if min_rf_wave > lya_wave and max_rf_wave > lya_wave: | ||
if tracer2 is None: | ||
tracer2 = lambda_abs |
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.
Again, this should be tracer2 = tracer1
py/picca/io.py
Outdated
if lambda_abs2 is None: | ||
lambda_abs2 = lambda_abs | ||
blinding_tracers = ["LYA", "QSO"] | ||
if tracer1 not in blinding_tracers and tracer2 not in blinding_tracers: |
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.
@iprafols - it looks like you have fixed this above (for the ImageHDU format) but you have not fixed it for the BinTable format. It still says "and" instead of "or"
I fixed the bugs, but indeed we should fully test this (I have not had the time to properly do it) |
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.
The changes look good. Let's see if @Andrea-MG and @julienguy can run their CIV codes on this branch and get unblind results, before we merge.
tests (python 3.10) are failing due to a weird coveralls error. Maybe their server is down. Otherwise, they might have updated something and the new version is not backwards compatible. We should try to rerun failing tests in a while to see if it was just their server being down or not |
server seems to not be down according to this. Restarted the tests which was not successful, but apparently even with servers up they had similar issues half a year back due to software updates on their side, lets just wait... |
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 don't think we are doing this right. When one of the tracers is not LYA or QSO, the rest-frame range shouldn't matter. In other words, if you are looking at CIV absorption in the LYB region, you should not blind either.
@iprafols , @Andrea-MG - I think we should change the order of the if clauses.
|
I sent feedback to @iprafols and after the fixes I could run successfully cf, xcf, dmat and xdmat with these changes, testing with CIV and Lyb forests. |
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 have run successfully cf, xcf, dmat and xdmat with these changes, testing with CIV and Lyb forests with @iprafols and get in all "blinding = none" in all.
if ((min_rf_wave > lya_wave and max_rf_wave > lya_wave) or | ||
(min_rf_wave < lyb_wave and max_rf_wave < lyb_wave)): | ||
# we are doing a metal forest, so do not blind (ever) | ||
blinding = "none" |
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.
@iprafols , @Andrea-MG - Are you sure about this? It looks to me that the this code would not blind the QSO x LyA(LyB) correlation.
I believe the "if" statement in line 263 should only have the first line (check that both rf_wave are above lya_wave), but it should not have the second condition.
Blinding is removed when running on metal forests