{"id":21490478,"url":"https://github.com/image357/corsika-7-python-interface","last_synced_at":"2025-08-30T17:13:33.108Z","repository":{"id":93290168,"uuid":"335095866","full_name":"image357/CORSIKA-7-Python-Interface","owner":"image357","description":"CORSIKA 7 interface using COAST to extract shower information with python","archived":false,"fork":false,"pushed_at":"2021-02-01T22:08:44.000Z","size":45,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T11:13:02.647Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/image357.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-01T22:01:21.000Z","updated_at":"2023-03-10T22:02:44.000Z","dependencies_parsed_at":"2023-03-15T11:15:38.335Z","dependency_job_id":null,"html_url":"https://github.com/image357/CORSIKA-7-Python-Interface","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/image357/CORSIKA-7-Python-Interface","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/image357%2FCORSIKA-7-Python-Interface","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/image357%2FCORSIKA-7-Python-Interface/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/image357%2FCORSIKA-7-Python-Interface/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/image357%2FCORSIKA-7-Python-Interface/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/image357","download_url":"https://codeload.github.com/image357/CORSIKA-7-Python-Interface/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/image357%2FCORSIKA-7-Python-Interface/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272878320,"owners_count":25008336,"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-08-30T02:00:09.474Z","response_time":77,"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":[],"created_at":"2024-11-23T14:38:05.606Z","updated_at":"2025-08-30T17:13:33.092Z","avatar_url":"https://github.com/image357.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CORSIKA interface\n\nCORSIKA interface using COAST to extract shower information within python.\n\n---\n\nThis piece of code is an implementation of the\n[COAST interface](https://web.ikp.kit.edu/rulrich/coast.html) in order to link\nCORSIKA air-shower information handling to a python interpreter.\nIt will enable you to write, extract, modify, etc. air-shower data on the fly\nwithin the scope of python scripts. It is a 1-to-1 map of the functionality of the\nCOAST interface mode.\n\n\n# Prerequisites\n\n* [CORSIKA](https://www.ikp.kit.edu/corsika/)\n* [COAST](https://web.ikp.kit.edu/rulrich/coast.html)\n* python3 development files (e.g. python3-dev or python3-devel packages for\n  your distribution)\n* (g)make\n* gcc\n* doxygen\n\n\n# Installation\n\nFirst clone the repository:\n```bash\ngit clone https://github.com/image357/corsika-interface\n```\n\nNext, point your `COAST_USER_LIB` environment variable to the git repository.\nFor instance, add the following to your `.bashrc`:\n```bash\nCOAST_USER_LIB=\"/path/to/corsika-interface\"; export COAST_USER_LIB\nLD_LIBRARY_PATH=\"${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}$COAST_USER_LIB\"; export LD_LIBRARY_PATH\n```\n\nMake sure that you have the following environment variables:\n* `CORSIKA_DIR`\n* `COAST_DIR`\n\nE.g. in your `.bashrc` file:\n```bash\nCORSIKA_DIR=\"/path/to/corsika/install/corsika-76900\"; export CORSIKA_DIR\nCOAST_DIR=\"/path/to/coast/install/coast-v4r5\"; export COAST_DIR\nLD_LIBRARY_PATH=\"${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}$COAST_DIR/lib\"; export LD_LIBRARY_PATH\n```\n\nOnce your environment is ready, compile the project within your git repository:\n```bash\nmake release docs\n```\n\nGo to your CORSIKA installation folder and run the `./coconut` script. Choose\nwhatever options you want but make sure that you at least select\n```\nd3 - Use an external COAST user library (COrsika data AccesS Tool)\n```\n\nOnce the compilation of CORSIKA is done you are ready to create your python\nanalysis code. First, create a new folder (for instance `/path/to/python/code`).\nThen copy the file named `override_example.py` from your git repository to this\nnew folder such that it is called `override.py`:\n```bash\ncp /path/to/corsika-interface/override_example.py /path/to/python/code/override.py\n```\nAt last, you have to define another environment variable, because CORSIKA needs\nto know where you have your python code. Add the following to your `.bashrc`:\n```bash\nCORSIKA_PYTHON_INTERFACE=\"/path/to/python/code\"; export CORSIKA_PYTHON_INTERFACE\n```\n\nThat's it! When you now run your CORSIKA binary you should see the following\ntwo additional outputs:\n```bash\npatched interface\nrunning interface tests\n```\n\n\n# Usage\n\nYou control the python interface with your `override.py` file. It is the main\nentrance file that will be executed by the CORSIKA binary. In order to use the\nlink to the COAST interface you have to inherit from a specific class:\n```python\ninterface.Override\n```\nThis class is an abstract interface class for which you will have to implement\n5 methods:\n* `init`: Used to do some initialization tasks\n* `close`: Used to do some some finalization tasks\n* `write`: Will give you CORSIKA block-data whenever it is ready to be written\n  to disk.\n* `interaction`: Will be called when there is interaction information available.\n* `track`: Will give you information about particle tracks.\n\nOnce you have implemented your personal interface class, you have to call\n```python\ninterface.patch(MyInterfaceClass)\n```\nin order to override the default interface behavior.\n\nEvery user-accessible method is documented and you should be able to\nexplore the functionality via autocompletion features of your editor or you can\nhave a look at the official documentation in the `html` folder in your git\nrepository.\n\n\n# Contributing\n\nFeel free to fork the project, create pull requests and open issues if you encouter problems or if you have questions.\n\n\n# Disclaimer\n\nThe source code can be found here: https://github.com/image357/CORSIKA-7-Python-Interface\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimage357%2Fcorsika-7-python-interface","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimage357%2Fcorsika-7-python-interface","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimage357%2Fcorsika-7-python-interface/lists"}