csiborgtools/scripts/test_paths.ipynb

353 lines
7 KiB
Text
Raw Normal View History

2022-10-20 22:37:33 +00:00
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"id": "5a38ed25",
"metadata": {
"ExecuteTime": {
"end_time": "2022-10-20T21:53:10.387523Z",
"start_time": "2022-10-20T21:53:08.558627Z"
}
},
"outputs": [],
"source": [
"import numpy as np\n",
"try:\n",
" import csiborgtools\n",
"except ModuleNotFoundError:\n",
" import sys\n",
" sys.path.append(\"../\")\n",
" import csiborgtools\n",
" \n",
" \n",
"%load_ext autoreload\n",
"%autoreload 2"
]
},
{
"cell_type": "code",
"execution_count": 23,
"id": "7accd798",
"metadata": {
"ExecuteTime": {
"end_time": "2022-10-20T22:00:25.350404Z",
"start_time": "2022-10-20T22:00:24.775748Z"
}
},
"outputs": [],
"source": [
"simpath = csiborgtools.io.get_sim_path(9844)\n",
"Nsnap = 1016\n",
"# csiborgtools.io.read_info(1016, simpath)"
]
},
{
"cell_type": "code",
"execution_count": 59,
"id": "131c3107",
"metadata": {
"ExecuteTime": {
"end_time": "2022-10-20T22:25:59.104572Z",
"start_time": "2022-10-20T22:25:59.074460Z"
}
},
"outputs": [],
"source": [
"box = csiborgtools.units.BoxUnits(Nsnap, simpath)"
]
},
{
"cell_type": "code",
"execution_count": 61,
"id": "b1a11aa6",
"metadata": {
"ExecuteTime": {
"end_time": "2022-10-20T22:26:12.931468Z",
"start_time": "2022-10-20T22:26:12.671686Z"
}
},
"outputs": [
{
"data": {
"text/plain": [
"3.765003070876428e+19"
]
},
"execution_count": 61,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"box.box2solarmass(1)"
]
},
{
"cell_type": "code",
"execution_count": 55,
"id": "19f39a80",
"metadata": {
"ExecuteTime": {
"end_time": "2022-10-20T22:24:59.563137Z",
"start_time": "2022-10-20T22:24:59.530173Z"
}
},
"outputs": [
{
"data": {
"text/plain": [
"3.749e+19"
]
},
"execution_count": 55,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"3.749e19"
]
},
{
"cell_type": "code",
"execution_count": 57,
"id": "5d1413fd",
"metadata": {
"ExecuteTime": {
"end_time": "2022-10-20T22:25:17.251057Z",
"start_time": "2022-10-20T22:25:17.223543Z"
}
},
"outputs": [
{
"data": {
"text/plain": [
"0.9957495198343349"
]
},
"execution_count": 57,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"box.solarmass2box(3.749e19)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "90cf9d61",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "b53e8166",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "b3eeca5b",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 49,
"id": "93d32800",
"metadata": {
"ExecuteTime": {
"end_time": "2022-10-20T22:09:12.915516Z",
"start_time": "2022-10-20T22:09:12.856213Z"
}
},
"outputs": [
{
"data": {
"text/plain": [
"0.9988759675724455"
]
},
"execution_count": 49,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"box.kpc2box(677.7 / 0.705 * 1000)"
]
},
{
"cell_type": "code",
"execution_count": 43,
"id": "66d3e98f",
"metadata": {
"ExecuteTime": {
"end_time": "2022-10-20T22:06:46.471218Z",
"start_time": "2022-10-20T22:06:46.437023Z"
}
},
"outputs": [
{
"data": {
"text/plain": [
"678.4626139789958"
]
},
"execution_count": 43,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"box.box2kpc(1) / 1000 * 0.705"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ef00a04c",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "d201838b",
"metadata": {},
"outputs": [],
"source": [
"filename = \"/mnt/extraspace/hdesmond/ramses_out_9844/output_01016/info_01016.txt\""
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d012a21b",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "547f7944",
"metadata": {
"ExecuteTime": {
"end_time": "2022-10-20T19:52:22.548299Z",
"start_time": "2022-10-20T19:52:22.544342Z"
}
},
"outputs": [],
"source": [
"results_filepath = '/mnt/extraspace/deaglan/H-AGN/'\n",
"sugata_filepath = '/mnt/extraspace/jeg/greenwhale/Sugata/'\n",
"\n",
"def info_dir():\n",
" return sugata_filepath + 'INFO/'\n",
"\n",
"def info_file(nout):\n",
" return info_dir() + 'info_' + str(nout).zfill(5) + '.txt'\n",
"\n",
"def h_agn_particle_directory(nout):\n",
" return sugata_filepath + 'H-AGN/output_' + str(nout).zfill(5) + '/'\n",
"\n",
"def cosmo_dir():\n",
" return './data/'\n",
"\n",
"def cosmo_file(nout):\n",
" return cosmo_dir() + 'cosmo_table_' + str(nout).zfill(5) + '.txt'"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "30630635",
"metadata": {
"ExecuteTime": {
"end_time": "2022-10-20T19:52:22.777853Z",
"start_time": "2022-10-20T19:52:22.774584Z"
}
},
"outputs": [],
"source": [
"info_dir()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a3fc21b2",
"metadata": {
"ExecuteTime": {
"end_time": "2022-10-20T19:56:35.946185Z",
"start_time": "2022-10-20T19:56:35.943643Z"
}
},
"outputs": [],
"source": [
"filename = \"/mnt/extraspace/hdesmond/ramses_out_9844/output_01016/info_01016.txt\""
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fae40a32",
"metadata": {
"ExecuteTime": {
"end_time": "2022-10-20T20:05:04.410987Z",
"start_time": "2022-10-20T20:05:04.403721Z"
},
"scrolled": false
},
"outputs": [],
"source": [
"e"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "de7e3ae7",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.8.0 ('venv_galomatch': virtualenv)",
"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.8.0"
},
"vscode": {
"interpreter": {
"hash": "f29d02a8350410abc2a9fb79641689d10bf7ab64afc03ec87ca3cf6ed2daa499"
}
}
},
"nbformat": 4,
"nbformat_minor": 5
}