Package: picca
piccaPackage for Igm Cosmological-Correlations Analyses.This package contains tools used for the analysis of the Lyman-alpha forest sample from the extended Baryon Oscillation Spectroscopic Survey (eBOSS) and the Dark Energy Spectroscopic Instrument (DESI). Here you will find tools tofit continua of forestscompute correlation functions (1D and 3D) and power-spectra (1D)compute covariance matricesfit models for the correlation functionsThe current reference is du Mas des Bourboux et al. 2020 (https://arxiv.org/abs/2007.08995).InstallationFirst, create a clean environment withversion>=3.9:conda create -n my_picca_env python==version
conda activate my_picca_envIf you already have an environment, you just need to activate it.
After you have the environment, you can install picca with:pip install piccaIf you are a developer, or want the most recent version of picca, you can download and install manually:git clone https://github.com/igmhub/picca.git
cd picca
pip install -e .Optionally, you can add the path to picca to your bashrc:export PICCA_BASE=<path to your picca>Or you can addpicca/py/to yourPYTHONPATH. Both of these are optional and picca will work without them.If you are at working at NERSC, we recommend to keep everything clean by adding a function like this in your bashrc:picca_env () {
    module load python
    conda activate my_picca_env
}Whenever you need picca just write:picca_envThis is cleaner than directly adding the commands to the bashrc file, and avoids potential issues with the transition to Perlmutter.If you want to compute models for the correlations computed with picca, or you want to fit these correlations, seehttps://github.com/andreicuceu/vega.If you are running MPI code (only needed for some tasks in fitter2), seehttps://docs.nersc.gov/development/languages/python/parallel-python/#mpi4py-in-your-custom-conda-environment. If want to run the PolyChord sampler for fitter2, seehttps://github.com/andreicuceu/fitter2_tutorial. Note that fitter2 is deprecated, and will be removed in the future.If you need to run the "picca_compute_pk_pksb.py" script you will also need to install the following packages:pip install camb
pip install cython
pip install nbodykitReproducing the BAO measurement in eBOSS DR16 (du Mas des Bourboux et al. 2020)Picca v4.0 was used in du Mas des Bourboux et al. (2020) to compute the final Lyman-alpha BAO measurement from eBOSS DR16.You can find a tutorial describing the different steps needed to reproduce the analysis (starting from the public catalogs) intutorials/eboss_dr16.Examplesexample run over 1000 spectra (the DLA catalog is not required):delta fieldpicca_delta_extraction.py config.iniTo reproduce the eBOSS analysis (du Mas des Bourboux et al. 2020) this needs to be run four times, two for calibration purposes, one for the Lyman $\alpha$ region and one for the Lyman $\beta$ regionCheck the tutorialpicca_delta_extraction_configuration_tutorialto review the available options. Find it undertutorials/delta_extractionCheck the folderexamples/delta_extractionwith examples to reproduce the eBOSS analysisold delta field (deprecated)picca_deltas.py
--in-dir data/
--drq ../DR14Q_v1_1.fits
--dla-vac ../dlas/DLA_DR14_v1b.dat
--out-dir deltas/
--mode pixfor eBOSS, currently--modecan bespplate,spec,pix, orspcframe, all but the first 2 are about to be retiredNOTE: reading the spec files isveryslowfor DESI currently--modecan bedesi_mocks(for reading healpix based mocks),desi_survey_tilebased(for reading cumulative tiles directories and coadding data across tiles) ordesi_sv_no_coadd(for reading tile based directories without coadding, will probably be retired)--in-dirpoints to the directory containing the data (in case ofdesi_survey_tilebasedthe full path until and includingcumulativeis needed, in case ofdesi-mocksthe full path untilspectra-16)the--drqpoints towards a quasar catalog in either the DESI format or eBOSS formatcorrelation functionpicca_cf.py
--in-dirdeltas/
--outcf.fits.gz
--nside32nsidedetermines the healpixelization used for the subsamples.nside=32gives ~3200 subsamples for DR12.distortion matrixpicca_dmat.py
--in-dirdeltas/
--outdmat.fits.gz
--rej0.95--rejis 1-fraction of pairs used for the calculationwick covariance (optional)Only T123 implemented# first calculate cf_1d from datapicca_cf1d.py
--in-dirdeltas/
--outcf1d.fits.gz# then use it for wickpicca_wick.py
--in-dirdeltas/
--outt123.fits.gz
--rej0.999
--cf1dcf1d.fits.gz## use the export script to export to picca fitter formatpicca_export.py
--datacf.fits.gz
--dmatdmat.fits.gz
--outcf-exp.out.gzName of tagsThe tags name follow the names of the king of France:https://fr.wikipedia.org/wiki/Liste_des_monarques_de_France#Liste_des_monarques_de_FranceFor DevelopersBefore submitting a PR please make sure to:Check the tutorials. Update them if necessary (typically the tutorialpicca_delta_extraction_configuration_tutorialwill need to be updated.Update the data modelFor every file you have modified runyapf --style google file.py -ito ensure the coding styles are maintained.Consider using pylint to help in the debug process. From the repo folder runpylint py/picca/delta_extraction/
pylint py/picca/pk1d/depending on the module you are working on.When merging PRs (or committing to master directly):by default the patch version is increased via a github action, so every change of master will generate a new version
This behaviour can be changed by adding one of the following to the commit-msg of the merge commit:by specifying [bump minor] or [bump major] a new minor or major version will be generated instead, but tags and releases need to be created manually (and are auto-pushed to pypi when they are created)by specifying [no bump] the version bump can be circumvented altogether when some other behaviour is wanted, in that case bump2version should be run manually