Skip to content

Commit d1b6670

Browse files
authored
Merge pull request #30 from nvaytet/new_test_data
Update notebooks for new test data
2 parents e9064a8 + 17b9155 commit d1b6670

File tree

6 files changed

+130
-72
lines changed

6 files changed

+130
-72
lines changed

docs/basics.ipynb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
"source": [
1818
"## Reading a RAMSES output\n",
1919
"\n",
20-
"Import the `osyris` module and load the output of your choice (this will be output number `71` in this example)."
20+
"Import the `osyris` module and load the output of your choice.\n",
21+
"We are loading output number `8` from a simulation of a collapsing system of gas,\n",
22+
"that is forming young stars in its core."
2123
]
2224
},
2325
{
@@ -53,7 +55,7 @@
5355
"metadata": {},
5456
"outputs": [],
5557
"source": [
56-
"data = osyris.Dataset(71, scale=\"au\", path=\"osyrisdata\")"
58+
"data = osyris.Dataset(8, scale=\"au\", path=\"osyrisdata/starformation\")"
5759
]
5860
},
5961
{
@@ -127,9 +129,9 @@
127129
"\n",
128130
"## Creating a 2D histogram\n",
129131
"\n",
130-
"We now wish to plot a 2d histogram of the logarithm of density versus logarithm of gas temperature,\n",
132+
"We now wish to plot a 2d histogram of the logarithm of density versus logarithm of magnetic field magnitude,\n",
131133
"for all the cells inside the computational domain.\n",
132-
"We also use a logarithmic colormap which represents the cell counts in the $(\\rho,T)$ plane"
134+
"We also use a logarithmic colormap which represents the cell counts in the $(\\rho,B)$ plane"
133135
]
134136
},
135137
{
@@ -138,7 +140,7 @@
138140
"metadata": {},
139141
"outputs": [],
140142
"source": [
141-
"osyris.histogram(data[\"hydro\"][\"density\"], data[\"hydro\"][\"temperature\"],\n",
143+
"osyris.histogram(data[\"hydro\"][\"density\"], data[\"hydro\"][\"B_field\"],\n",
142144
" norm=\"log\", loglog=True)"
143145
]
144146
},
@@ -148,7 +150,7 @@
148150
"source": [
149151
"## Simple cut plane\n",
150152
"\n",
151-
"The goal here is to create a 2D gas density slice, 100 au wide, through the plane normal to `z`,\n",
153+
"The goal here is to create a 2D gas density slice, 2000 au wide, through the plane normal to `z`,\n",
152154
"that passes through the center of the young star forming system.\n",
153155
"\n",
154156
"We first need to define where the center of the system is.\n",
@@ -180,7 +182,7 @@
180182
"outputs": [],
181183
"source": [
182184
"osyris.plane({\"data\": data[\"hydro\"][\"density\"], \"norm\": \"log\"},\n",
183-
" dx=100 * osyris.units('au'),\n",
185+
" dx=2000 * osyris.units('au'),\n",
184186
" origin=center,\n",
185187
" direction=\"z\")"
186188
]

docs/data_structures.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"metadata": {},
4141
"outputs": [],
4242
"source": [
43-
"data = osyris.Dataset(71, scale=\"au\", path=\"osyrisdata\").load()"
43+
"data = osyris.Dataset(8, scale=\"au\", path=\"osyrisdata/starformation\").load()"
4444
]
4545
},
4646
{

docs/loading_data.ipynb

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
"metadata": {},
3333
"outputs": [],
3434
"source": [
35-
"data = osyris.Dataset(71, scale=\"au\", path=\"osyrisdata\").load()"
35+
"path = \"osyrisdata/starformation\"\n",
36+
"data = osyris.Dataset(8, scale=\"au\", path=path).load()"
3637
]
3738
},
3839
{
@@ -62,7 +63,7 @@
6263
"\n",
6364
"It is possible to load only a subset of the cells, by using custom functions to perform the selection.\n",
6465
"\n",
65-
"As an example, to load all the cells with $\\rho > 10^{-13}~{\\rm g~cm}^{-3}$, we use a selection criterion"
66+
"As an example, to load all the cells with $\\rho > 10^{-15}~{\\rm g~cm}^{-3}$, we use a selection criterion"
6667
]
6768
},
6869
{
@@ -71,8 +72,8 @@
7172
"metadata": {},
7273
"outputs": [],
7374
"source": [
74-
"data = osyris.Dataset(71, scale=\"au\", path=\"osyrisdata\").load(\n",
75-
" select={\"hydro\": {\"density\": lambda d : d > 1.0e-13 * osyris.units('g/cm**3')}})"
75+
"data = osyris.Dataset(8, scale=\"au\", path=path).load(\n",
76+
" select={\"hydro\": {\"density\": lambda d : d > 1.0e-15 * osyris.units('g/cm**3')}})"
7677
]
7778
},
7879
{
@@ -105,9 +106,9 @@
105106
"metadata": {},
106107
"outputs": [],
107108
"source": [
108-
"data = osyris.Dataset(71, scale=\"au\", path=\"osyrisdata\").load(\n",
109-
" select={\"hydro\": {\"density\": lambda d : d > 1.0e-13 * osyris.units('g/cm**3')},\n",
110-
" \"amr\": {\"xyz_x\": lambda x : x > 5500. * osyris.units('au')}})"
109+
"data = osyris.Dataset(8, scale=\"au\", path=path).load(\n",
110+
" select={\"hydro\": {\"density\": lambda d : d > 1.0e-16 * osyris.units('g/cm**3')},\n",
111+
" \"amr\": {\"xyz_x\": lambda x : x > 1500. * osyris.units('au')}})"
111112
]
112113
},
113114
{
@@ -117,7 +118,7 @@
117118
"outputs": [],
118119
"source": [
119120
"osyris.plane({\"data\": data[\"hydro\"][\"density\"], \"norm\": \"log\"},\n",
120-
" dx=200 * osyris.units('au'),\n",
121+
" dx=1000 * osyris.units('au'),\n",
121122
" origin=data[\"amr\"][\"xyz\"][np.argmax(data[\"hydro\"][\"density\"]).values],\n",
122123
" direction='z')"
123124
]
@@ -137,7 +138,7 @@
137138
"metadata": {},
138139
"outputs": [],
139140
"source": [
140-
"data = osyris.Dataset(71, scale=\"au\", path=\"osyrisdata\").load(\n",
141+
"data = osyris.Dataset(8, scale=\"au\", path=path).load(\n",
141142
" select={\"hydro\": {\"density\": False}})\n",
142143
"\"density\" in data[\"hydro\"]"
143144
]
@@ -158,7 +159,7 @@
158159
"metadata": {},
159160
"outputs": [],
160161
"source": [
161-
"data = osyris.Dataset(71, scale=\"au\", path=\"osyrisdata\").load(\n",
162+
"data = osyris.Dataset(8, scale=\"au\", path=path).load(\n",
162163
" select={\"hydro\": False})\n",
163164
"data"
164165
]
@@ -184,16 +185,16 @@
184185
"metadata": {},
185186
"outputs": [],
186187
"source": [
187-
"data = osyris.Dataset(71, scale=\"au\", path=\"osyrisdata\").load(\n",
188-
" select={\"amr\": {\"level\": lambda l : l < 10}})\n",
188+
"data = osyris.Dataset(8, scale=\"au\", path=path).load(\n",
189+
" select={\"amr\": {\"level\": lambda l : l < 7}})\n",
189190
"data[\"amr\"][\"level\"]"
190191
]
191192
},
192193
{
193194
"cell_type": "markdown",
194195
"metadata": {},
195196
"source": [
196-
"will only read levels 1 to 9, while"
197+
"will only read levels 1 to 6, while"
197198
]
198199
},
199200
{
@@ -202,16 +203,16 @@
202203
"metadata": {},
203204
"outputs": [],
204205
"source": [
205-
"data = osyris.Dataset(71, scale=\"au\", path=\"osyrisdata\").load(\n",
206-
" select={\"amr\": {\"level\": lambda l : np.logical_and(l > 9, l < 13)}})\n",
206+
"data = osyris.Dataset(8, scale=\"au\", path=path).load(\n",
207+
" select={\"amr\": {\"level\": lambda l : np.logical_and(l > 5, l < 9)}})\n",
207208
"data[\"amr\"][\"level\"]"
208209
]
209210
},
210211
{
211212
"cell_type": "markdown",
212213
"metadata": {},
213214
"source": [
214-
"will read levels 1 to 12, but will then discard all cells with `level` < 10.\n",
215+
"will read levels 1 to 8, but will then discard all cells with `level` < 6.\n",
215216
"\n",
216217
"### Loading only selected CPU outputs\n",
217218
"\n",
@@ -224,7 +225,7 @@
224225
"metadata": {},
225226
"outputs": [],
226227
"source": [
227-
"data = osyris.Dataset(71, scale=\"au\", path=\"osyrisdata\").load(\n",
228+
"data = osyris.Dataset(8, scale=\"au\", path=path).load(\n",
228229
" cpu_list=[1, 2, 10, 4, 5])"
229230
]
230231
},
@@ -235,7 +236,7 @@
235236
"outputs": [],
236237
"source": [
237238
"osyris.plane({\"data\": data[\"hydro\"][\"density\"], \"norm\": \"log\"},\n",
238-
" dx=400 * osyris.units(\"au\"),\n",
239+
" dx=2000 * osyris.units(\"au\"),\n",
239240
" origin=data[\"amr\"][\"xyz\"][np.argmax(data[\"hydro\"][\"density\"]).values],\n",
240241
" direction='z')"
241242
]

0 commit comments

Comments
 (0)