Skip to content
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

continuum fitting struggling with really noiseless mocks #819

Open
alxogm opened this issue Oct 22, 2021 · 4 comments
Open

continuum fitting struggling with really noiseless mocks #819

alxogm opened this issue Oct 22, 2021 · 4 comments

Comments

@alxogm
Copy link
Contributor

alxogm commented Oct 22, 2021

picca_deltas.py breaks at the first iteration of continuum fitting for noiseless mocks (exptime~1e10), with the following error:

Continuum fitting: ending iteration 0 of 5
 Mean quantities in observer-frame
 loglam    eta      var_lss  fudge    chi2     num_pix 
 3.561e+00 1.00e+00 1.00e-01 1.00e-07 0.00e+00 0 
 3.570e+00 1.00e+00 1.00e-01 1.00e-07 0.00e+00 0 
 3.579e+00 1.00e+00 1.00e-01 1.00e-07 0.00e+00 0 
 3.589e+00 1.00e+00 1.00e-01 1.00e-07 0.00e+00 0 
 3.598e+00 1.00e+00 1.00e-01 1.00e-07 0.00e+00 0 
 3.607e+00 1.00e+00 1.00e-01 1.00e-07 0.00e+00 0 
 3.616e+00 1.00e+00 1.00e-01 1.00e-07 0.00e+00 0 
 3.625e+00 1.00e+00 1.00e-01 1.00e-07 0.00e+00 0 
 3.635e+00 1.00e+00 1.00e-01 1.00e-07 0.00e+00 0 
 3.644e+00 1.00e+00 1.00e-01 1.00e-07 0.00e+00 0 
 3.653e+00 1.00e+00 1.00e-01 1.00e-07 0.00e+00 0 
 3.662e+00 1.00e+00 1.00e-01 1.00e-07 0.00e+00 0 
 3.671e+00 1.00e+00 1.00e-01 1.00e-07 0.00e+00 0 
 3.681e+00 1.00e+00 1.00e-01 1.00e-07 0.00e+00 0 
 3.690e+00 1.00e+00 1.00e-01 1.00e-07 0.00e+00 0 
 3.699e+00 1.00e+00 1.00e-01 1.00e-07 0.00e+00 0 
 3.708e+00 1.00e+00 1.00e-01 1.00e-07 0.00e+00 0 
 3.717e+00 1.00e+00 1.00e-01 1.00e-07 0.00e+00 0 
 3.727e+00 1.00e+00 1.00e-01 1.00e-07 0.00e+00 0 
 3.736e+00 1.00e+00 1.00e-01 1.00e-07 0.00e+00 0 
Traceback (most recent call last):
  File "/global/homes/a/alxogm/desi/code/igmhub/picca/bin/picca_deltas.py", line 1025, in <module>
    main(cmdargs)
  File "/global/homes/a/alxogm/desi/code/igmhub/picca/bin/picca_deltas.py", line 721, in main
    Forest.get_eta = interp1d(log_lambda[w],
  File "/global/homes/a/alxogm/.conda/envs/picca/lib/python3.8/site-packages/scipy/interpolate/interpolate.py", line 467, in __init__
    self._y = self._reshape_yi(self.y)
  File "/global/homes/a/alxogm/.conda/envs/picca/lib/python3.8/site-packages/scipy/interpolate/polyint.py", line 110, in _reshape_yi
    return yi.reshape((yi.shape[0], -1))
ValueError: cannot reshape array of size 0 into shape (0,newaxis)

This is traced back to this line,

var_pipe_min = np.log10(1e-5)

since the var_pipe calculated is below this limit, and therefore no bins are retained. A simple fix is to lower down this min value for mocks, I'm not sure is a good idea to lower it down in general, but I think it would better to allow eta and fudge be fixed for mocks (as @andreufont has been requesting for a while I think)... @iprafols @Waelthus any thoughts?

@andreufont
Copy link
Contributor

Exactly, we have to be able to run the analysis without fudge or eta varying, or with a value of sigma_lss that is provided by the user. The amount of optional arguments in picca_deltas is always growing, so hopefully we can also use some sort of configuration file to specify all these options.

@Waelthus
Copy link
Contributor

I'd guess changing var_pipe_min globally would also change all results produced by picca_deltas subtly, which would be annoying at least for the tests (changing jointly with num_var_bins might work if we never had pixels below the minimum before).
If having the user provide a value for eta, fudge, var_lss is enough, it could easily be added (similarly to e.g. use_constant_weights which skips the compute_var_stats function). If we want to compute some of those values and fix others, I guess we'd run into the same problem @alxogm described above without additional changes...

@andreufont
Copy link
Contributor

There is another clear case where "user provided" values for these global functions would be useful. I'm now analysing 10 realisations of mocks that are equal in everythin except the random seed. Computing these global functions 10 times is a waste of time, we know that they are going to be very similar. We should be able to recycle the global functions computed from the first iteration for all N-1 remaining analyses

@iprafols
Copy link
Collaborator

I think this was addressed by the introduction of the classes Dr16ExpectedFluxFixedEta and similar. @alxogm do you agree? If so, we can close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants