{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "XATOMPATH = \"YOURPATH_TO_XATOM_BINARY\" # enter your path to the xatom binary" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2022-06-09T09:33:24.410077Z", "start_time": "2022-06-09T09:33:24.405613Z" } }, "outputs": [], "source": [ "import subprocess" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2022-06-09T09:33:24.972830Z", "start_time": "2022-06-09T09:33:24.965860Z" } }, "outputs": [], "source": [ "system = 'O'\n", "photonEnergy = 750\n", "configurations = [\n", " \"1s\" + str(n1) + \"_2s\" + str(n2) + \"_2p\" + str(n3) for n1 in range(3)\n", " for n2 in range(3) for n3 in range(5)\n", "]" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2022-06-09T09:33:48.806084Z", "start_time": "2022-06-09T09:33:25.805055Z" }, "scrolled": true }, "outputs": [], "source": [ "with open(f\"results_{system}_{photonEnergy}.dat\", 'w') as f:\n", " for c in configurations:\n", " print(c)\n", " sp = subprocess.run([\n", " XATOMPATH, \"-s\", system, \"-conf\", c, \"-pcs\", \"-PE\",\n", " str(photonEnergy), \"-decay\", \"-xmdyn\", \"-silent\"\n", " ],\n", " stdout=subprocess.PIPE,\n", " stderr=subprocess.PIPE,\n", " stdin=subprocess.PIPE)\n", " #print(sp.stderr)\n", " for line in sp.stdout.decode('utf8').split('\\n'):\n", " #print(line)\n", " if '#' in line:\n", " f.write(line + '\\n')\n", " f.close()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.12" } }, "nbformat": 4, "nbformat_minor": 4 }