LSSTDESC / DifferentiableHOS

Project to study higher order weak lensing statistics using differentiable simulations.
MIT License
3 stars 0 forks source link

Adds script to compute Jacobian #5

Closed EiffL closed 3 years ago

EiffL commented 3 years ago

@dlanzieri this PR tries to solve #4 , by adding a command line script that should be able to retrieve the Jacobian.

To use the script, you need to have DifferentiableHOS installed, then from the script folder you can do:

$ python compute_jacobian.py

This will run the script and output by default a file results.pkl which you can then read in Python by doing:

import pickle
results_dict = pickle.load( open( "results.pkl", "rb" ) )

this dictionary will contain the kappa map, the power spectrum, ell, and jacobian.

You can specify parameters to the script on the command line like so for example:

$ python compute_jacobian.py --filename=different_results.pkl --nc=64

The list of parameters is defined in the header of the script.

NOTE: to make it go faster, I have simplified the N-body computation! I'm only using LPT to initialize the simulation up to the start of the lightcone, and not an initial Nbody phase. I don't know how much this affects accuracy!

So, this is an example script, to see how we can run things on the command line, but it's really not tested in any way ^^'