{"id":34063058,"url":"https://github.com/paulassoares/gpr4im","last_synced_at":"2025-12-14T05:04:16.301Z","repository":{"id":41183643,"uuid":"304049057","full_name":"paulassoares/gpr4im","owner":"paulassoares","description":"Using GPR as a foreground removal technique for single-dish 21cm intensity mapping.","archived":false,"fork":false,"pushed_at":"2022-02-04T09:36:30.000Z","size":135961,"stargazers_count":8,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-27T03:25:18.653Z","etag":null,"topics":["cosmology","foreground-removal","gaussian-processes","intensity-maps","large-scale-structure-cosmology","nested-sampling","simulations"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paulassoares.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-14T14:57:39.000Z","updated_at":"2023-11-30T07:49:05.000Z","dependencies_parsed_at":"2022-08-30T10:00:44.131Z","dependency_job_id":null,"html_url":"https://github.com/paulassoares/gpr4im","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/paulassoares/gpr4im","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulassoares%2Fgpr4im","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulassoares%2Fgpr4im/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulassoares%2Fgpr4im/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulassoares%2Fgpr4im/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paulassoares","download_url":"https://codeload.github.com/paulassoares/gpr4im/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulassoares%2Fgpr4im/sbom","scorecard":{"id":722914,"data":{"date":"2025-08-11","repo":{"name":"github.com/paulassoares/gpr4im","commit":"980097bfc606919ddb03edb2cc0a7bbf56045fdf"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}}]},"last_synced_at":"2025-08-22T11:54:38.568Z","repository_id":41183643,"created_at":"2025-08-22T11:54:38.568Z","updated_at":"2025-08-22T11:54:38.568Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27717911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-14T02:00:11.348Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cosmology","foreground-removal","gaussian-processes","intensity-maps","large-scale-structure-cosmology","nested-sampling","simulations"],"created_at":"2025-12-14T05:04:15.733Z","updated_at":"2025-12-14T05:04:16.284Z","avatar_url":"https://github.com/paulassoares.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/paulassoares/gpr4im/blob/main/Jupyter%20Notebooks/images/logo.png?raw=true\" width=300 /\u003e\n\u003c/p\u003e\n\n# gpr4im\n\nThis package uses Gaussian Process Regression (GPR) as a foreground removal technique in the context single-dish 21cm intensity mapping. This user-friendly code shows you how to do this in the context of MeerKAT-like simulations, but any intensity mapping data in real space can be used. This is the accompaying code to the paper `(https://arxiv.org/abs/2105.12665)`, where we look at how GPR performs as a foreground removal technique in our simulations in comparison with Principal Component Analysis.\n\n## Installation\n\nTo install this package, follow these instructions on a terminal:\n\n```\npip install gpr4im\n```\n\nor if you prefer:\n\n```\ngit clone https://github.com/paulassoares/gpr4im.git\ncd gpr4im\npip install .\n```\n\nIf using the second option, make sure you do `pip install .` in the gpr4im folder, where the `setup.py` file is.\n\nInstalling `gpr4im` will also automatically install:\n\n- `numpy`\n- `matplotlib`\n- `pandas`\n- `GPy` (see https://github.com/SheffieldML/GPy)\n- `scipy`\n- `getdist`\n- `astropy`\n- `jupyter`\n\nIt will *not* install `pymultinest`, which is required for the `Nested sampling.ipynb` notebook. If you would like to run that notebook, please see http://johannesbuchner.github.io/PyMultiNest/install.html for details on installation.\n\n## Quickstart\n\nAn very quick example of how to run GPR foreground removal using our code is shown below, but please see the Jupyter notebooks for further explanation:\n\n```\nimport pandas as pd\nimport GPy\nfrom gpr4im import fg_tools as fg\n\ndata = pd.read_pickle('example_data.pkl')\ndirty_map = data.beam.FGnopol_HI_noise\n\nkern_fg = GPy.kern.RBF(1)\nkern_fg.variance.constrain_bounded(1000,100000000)\nkern_fg.lengthscale.constrain_bounded(200,10000)\nkern_21 = GPy.kern.Exponential(1)\nkern_21.variance.constrain_bounded(0.000001,0.5)\nkern_21.lengthscale.constrain_bounded(0.01,15)\n\ngpr_result = fg.GPRclean(dirty_map, data.freqs, kern_fg, kern_21, \n                         NprePCA=0, num_restarts=10, noise_data=None, \n                         heteroscedastic=False, zero_noise=True, invert=False)\n\ncleaned_map = gpr_result.res\n```\n\n## Introductory notebooks\n\nFor a quick introduction on how to run the code, please see `Running GPR.ipynb`. For a more thorough run through of how the code works, please see `Understanding GPR.ipynb`. The Jupyter Notebooks folder contains other introductory notebooks for how all the aspects of our code and data work, and are all user friendly. These use the data set `example_data.pkl`, which is described in the Data folder's README.\n\nThe Reproducible paper plots folder contains the notebooks showing how we obtained the analysis results for our companion paper (these are less introductory, but useful for those trying to understand how our analysis was done). The code here requires the `multinest_results.pkl` file, as well as the full data used in our analysis, `data.pkl`, which can be obtained from this link (but beware, it is 2.84 GB):\n\n\u003e https://www.dropbox.com/sh/9zftczeypu7xgt3/AABiiBw_0SBPrLgSHsjiISz8a?dl=0\n\nThe `Nested sampling.ipynb` notebook also uses this data, and requires `pymultinest` to be installed.\n\n## Acknowledgment\n\nIf you make use of this code, please cite:\n\n```\n@article{2021,\n   title={Gaussian Process Regression for foreground removal in H i Intensity Mapping experiments},\n   volume={510},\n   ISSN={1365-2966},\n   url={http://dx.doi.org/10.1093/mnras/stab2594},\n   DOI={10.1093/mnras/stab2594},\n   number={4},\n   journal={Monthly Notices of the Royal Astronomical Society},\n   publisher={Oxford University Press (OUP)},\n   author={Soares, Paula S and Watkinson, Catherine A and Cunnington, Steven and Pourtsidou, Alkistis},\n   year={2021},\n   month={Sep},\n   pages={5872–5890} \n}\n```\n\nThis code is heavily based on the publicly available `ps_eor` code (https://gitlab.com/flomertens/ps_eor), so if you use our code please also acknowledge:\n\n```\n@article{Mertens2018,\n   title={Statistical 21-cm Signal Separation via Gaussian Process Regression Analysis},\n   ISSN={1365-2966},\n   url={http://dx.doi.org/10.1093/mnras/sty1207},\n   DOI={10.1093/mnras/sty1207},\n   journal={Monthly Notices of the Royal Astronomical Society},\n   publisher={Oxford University Press (OUP)},\n   author={Mertens, F G and Ghosh, A and Koopmans, L V E},\n   year={2018},\n   month={May}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulassoares%2Fgpr4im","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaulassoares%2Fgpr4im","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulassoares%2Fgpr4im/lists"}