Update README.md
Browse files
README.md
CHANGED
|
@@ -764,23 +764,24 @@ Boundary | Cross-sections
|
|
| 764 |
|
| 765 |
Stream and instantiate the VMEC ideal MHD equilibria:
|
| 766 |
```python
|
| 767 |
-
import datasets
|
| 768 |
from constellaration.mhd import vmec_utils
|
| 769 |
-
from constellaration.geometry import surface_rz_fourier
|
| 770 |
|
| 771 |
-
|
| 772 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 773 |
|
| 774 |
-
row = next(
|
| 775 |
|
| 776 |
-
vmecpp_wout_json = row["
|
| 777 |
vmecpp_wout = vmec_utils.VmecppWOut.model_validate_json(vmecpp_wout_json)
|
|
|
|
| 778 |
|
| 779 |
# Fetch corresponding boundary
|
| 780 |
-
full_json_ds = datasets.load_dataset("proxima-fusion/constellaration", "full_json")["train"]
|
| 781 |
-
full_json_df = full_json_ds.to_pandas().set_index("plasma_config_id")
|
| 782 |
plasma_config_id = row["plasma_config_id"]
|
| 783 |
-
boundary_json =
|
| 784 |
boundary = surface_rz_fourier.SurfaceRZFourier.model_validate_json(boundary_json)
|
| 785 |
```
|
| 786 |
Plot flux surfaces:
|
|
|
|
| 764 |
|
| 765 |
Stream and instantiate the VMEC ideal MHD equilibria:
|
| 766 |
```python
|
|
|
|
| 767 |
from constellaration.mhd import vmec_utils
|
|
|
|
| 768 |
|
| 769 |
+
wout_ds = datasets.load_dataset(
|
| 770 |
+
"proxima-fusion/constellaration",
|
| 771 |
+
"vmecpp_wout",
|
| 772 |
+
split="train",
|
| 773 |
+
streaming=True,
|
| 774 |
+
)
|
| 775 |
|
| 776 |
+
row = next(wout_ds.__iter__())
|
| 777 |
|
| 778 |
+
vmecpp_wout_json = row["json"]
|
| 779 |
vmecpp_wout = vmec_utils.VmecppWOut.model_validate_json(vmecpp_wout_json)
|
| 780 |
+
```
|
| 781 |
|
| 782 |
# Fetch corresponding boundary
|
|
|
|
|
|
|
| 783 |
plasma_config_id = row["plasma_config_id"]
|
| 784 |
+
boundary_json = pandas_ds.loc[plasma_config_id]["boundary.json"]
|
| 785 |
boundary = surface_rz_fourier.SurfaceRZFourier.model_validate_json(boundary_json)
|
| 786 |
```
|
| 787 |
Plot flux surfaces:
|