{"id":37563733,"url":"https://github.com/stefsmeets/topas_tools","last_synced_at":"2026-01-16T09:11:44.208Z","repository":{"id":65902093,"uuid":"42732485","full_name":"stefsmeets/topas_tools","owner":"stefsmeets","description":"Set of scripts for working with Topas","archived":false,"fork":false,"pushed_at":"2025-04-16T14:07:00.000Z","size":313,"stargazers_count":16,"open_issues_count":2,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-09-05T06:26:25.039Z","etag":null,"topics":["powder-diffraction","profile-refinement","structure-refinement","topas"],"latest_commit_sha":null,"homepage":"","language":"Python","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/stefsmeets.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-09-18T16:05:28.000Z","updated_at":"2025-04-16T14:06:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"b22df668-7014-433a-b559-c90aa8540d90","html_url":"https://github.com/stefsmeets/topas_tools","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/stefsmeets/topas_tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefsmeets%2Ftopas_tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefsmeets%2Ftopas_tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefsmeets%2Ftopas_tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefsmeets%2Ftopas_tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stefsmeets","download_url":"https://codeload.github.com/stefsmeets/topas_tools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefsmeets%2Ftopas_tools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["powder-diffraction","profile-refinement","structure-refinement","topas"],"created_at":"2026-01-16T09:11:44.067Z","updated_at":"2026-01-16T09:11:44.181Z","avatar_url":"https://github.com/stefsmeets.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/topas_tools)](https://pypi.org/project/topas_tools/)\n[![PyPI](https://img.shields.io/pypi/v/topas_tools.svg?style=flat)](https://pypi.org/project/topas_tools/)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4719228.svg)](https://doi.org/10.5281/zenodo.4719228)\n\n# Topas tools\n\nThese are set of small scripts and tools that were developed to help with structure refinement (of zeolites in particular) using the program [TOPAS](http://topas-academic.net/).\n\n## topasdiff\n\nTopasdiff is a tool to generate nice looking difference maps. First, output the observed structure factors, and structure in cif format from Topas:\n\n    Out_fobs(fobs.hkl)\n    Out_CIF_STR(structure.cif)\n\nObserved structure factors can be generated using this macro (add this to `C:/topas5/local.inc`):\n\n    macro Out_fobs(file)\n    {\n       phase_out file load out_record out_fmt out_eqn\n       {\n           \"%4.0f\" = H;\n           \"%4.0f\" = K;\n           \"%4.0f\" = L;\n           '\"%4.0f\" = M;\n           \"%12.4f\\n\" = (Iobs_no_scale_pks / M)^(0.5);\n       }\n    }\n\nThen to calculate the difference map, run the command:\n\n    topasdiff structure.cif --diff fobs.hkl\n\nor use the GUI, accessible available via `topasdiff.bat` (Windows). The program will ask for the scale factor provided by TOPAS, and generates an input file for the program superflip (http://superflip.fzu.cz/). Superflip is then used to perform the fourier transform, and generates an `.XPLOR` file that can be visualized using Chimera or VESTA.\n\nNote: There is a bug in Topas where the cif files it outputs cannot be read using CCTBX, because they lack the data header. A work-around is to open `C:/topas5/topas.inc` and modify all instances of:\n\n    Out_String(\"\\ndata_\")\n\nby:\n\n    Out_String(\"\\ndata_topas_cif_out\")\n\n![topasdiff gui](https://cloud.githubusercontent.com/assets/873520/14959028/c68ba2e4-108d-11e6-9942-f8e6acc1559f.png)\n\n## cif2topas\n\ncif2topas transforms a crystal structure into cif format into the corresponding TOPAS code.\n\nUsage:\n\n    cif2topas structure.cif\n\n\n## fh2topas\n\nfh2topas is a script that converts from Fenske-Hall z-matrix to TOPAS code\n\nUsage:\n\n    fh2topas zmatrix.fh [n]\n\nHere, `n` is an optional parameter to give the number of molecules to generate. fh2topas will automatically number them to avoid naming conflicts.\n\n\n## topasrestraints\n\ntopasrestraints is a tool that can help with the generation of bond and angle restraints for structure refinement of zeolites with TOPAS. First, generate all bonds by using the TOPAS instruction:\n\n    append_bond_lengths\n\nto generate all bonds and angles, including their symmetry codes for the current structure. Copy everything between the curly brackets to a new file called `bonds.txt`, and run:\n\n    topasrestraints bonds.txt\n\nThis generates a file called restraints.out that contains the restraints that can be added to TOPAS. The script checks for all distances of `1.61 +- 0.4` Angstrom to identify T-O bonds. The program checks the connectivity for every atom, and reports if there is a problem (too many / not enough distances per T-atom). There is no check for symmetrically equivalent connections, so some restraints may be redundant.\n\n## stripcif\n\nstripcif is a tool to clean a cif file from all extra metadata. Essentially it reads a cif file and writes it back to `structure_simple.cif` with just the cell parameters and atomic coordinates.\n\nUsage:\n\n    stripcif structure.cif\n\n## expandcell\n\nexpandcell is a tool to take a cif file and expand the axes along different directions to form a supercell.\n\nFor example:\n\n    expandcell structure.cif -z2\n\nwill write a cif in `P1` the *z* axis doubled. You can then use a tool like [PLATON](http://www.platonsoft.nl/platon/pl000000.html) to find the right symmetry for this structure (if needed). You can use:\n\n    expandcell structure.cif -z2 -s SPGR --shift X Y Z\n\nto force the new a new symmetry on the output. Here `SPGR` is the space group suggested by platon, and `--shift X Y Z` is the suggested origin shift.\n\nThe option `-e` can be used to exclude elements from the result.\n\n## make_superflip\n\nThis is a very simple tool that asks a couple of questions and writes an input file for superflip.\n\nUsage:\n\n    make_superflip\n\n## Requirements\n\n- Python\u003e=3.9\n- numpy\n- matplotlib\n- pandas\n- [CCTBX](https://github.com/cctbx/cctbx_project)\n- superflip ([superflip.fzu.cz/](http://superflip.fzu.cz/))\n\n## Installation\n\n1. Install [miniconda](https://docs.conda.io/en/latest/miniconda.html) (pick the one suitable for your platform, Python version does not matter here).\n\n2. Install using:\n\n```bash\nconda create -n topas_tools -c conda-forge cctbx-base\nconda activate topas_tools\npip install topas_tools\n```\n\nOr use the environment file:\n\n```bash\nconda env create -f environment.yml\nconda activate topas_tools\npip install -e .\n```\n\n(note that every time you want to use `topas_tools`, you must always activate the environment using `conda activate topas_tools`)\n\n## How to Cite\n\nIf you find this software useful, please consider citing it:\n\n- Smeets, S. (2021). topas_tools (Version 1.1.0) [Computer software]. https://doi.org/10.5281/zenodo.4719229\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefsmeets%2Ftopas_tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefsmeets%2Ftopas_tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefsmeets%2Ftopas_tools/lists"}