-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Ability to Write Boozmn.nc style output files #680
Conversation
…t the non-sym modes
make a norm name in data index |
… on the grids (calcuated with cos sym transforms)
…, add test for the quantities saved in boozmn.nc file
…ELIOTRON from scratch
notes to self on Booz_xform modenumbers are defined here:
|
| benchmark_name | dt(%) | dt(s) | t_new(s) | t_old(s) |
| -------------------------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- |
test_build_transform_fft_lowres | +0.64 +/- 2.10 | +9.97e-05 +/- 3.25e-04 | 1.56e-02 +/- 2.9e-04 | 1.55e-02 +/- 1.5e-04 |
test_build_transform_fft_midres | +0.16 +/- 1.35 | +1.55e-04 +/- 1.29e-03 | 9.51e-02 +/- 1.2e-03 | 9.50e-02 +/- 4.9e-04 |
test_build_transform_fft_highres | +1.14 +/- 0.84 | +5.29e-03 +/- 3.88e-03 | 4.69e-01 +/- 3.3e-03 | 4.63e-01 +/- 2.1e-03 |
test_equilibrium_init_lowres | +0.48 +/- 1.46 | +3.14e-03 +/- 9.60e-03 | 6.61e-01 +/- 7.5e-03 | 6.58e-01 +/- 6.0e-03 |
test_equilibrium_init_medres | -0.17 +/- 0.92 | -1.74e-03 +/- 9.23e-03 | 1.00e+00 +/- 5.7e-03 | 1.01e+00 +/- 7.2e-03 |
test_equilibrium_init_highres | +0.41 +/- 1.07 | +1.04e-02 +/- 2.74e-02 | 2.57e+00 +/- 1.6e-02 | 2.56e+00 +/- 2.2e-02 |
test_objective_compile_dshape_current | -1.97 +/- 6.87 | -8.34e-02 +/- 2.91e-01 | 4.16e+00 +/- 2.1e-01 | 4.24e+00 +/- 2.0e-01 |
test_objective_compile_atf | -3.31 +/- 4.88 | -3.18e-01 +/- 4.69e-01 | 9.29e+00 +/- 3.4e-01 | 9.61e+00 +/- 3.2e-01 |
test_objective_compute_dshape_current | +0.07 +/- 2.30 | +1.56e-06 +/- 5.03e-05 | 2.19e-03 +/- 3.3e-05 | 2.19e-03 +/- 3.8e-05 |
test_objective_compute_atf | -1.34 +/- 2.16 | -1.04e-04 +/- 1.67e-04 | 7.63e-03 +/- 1.0e-04 | 7.73e-03 +/- 1.3e-04 |
test_objective_jac_dshape_current | -6.37 +/- 7.16 | -3.01e-03 +/- 3.38e-03 | 4.42e-02 +/- 1.5e-03 | 4.72e-02 +/- 3.0e-03 |
test_objective_jac_atf | -7.77 +/- 4.22 | -1.86e-01 +/- 1.01e-01 | 2.21e+00 +/- 5.0e-02 | 2.39e+00 +/- 8.8e-02 |
test_perturb_1 | -1.10 +/- 11.89 | -9.66e-02 +/- 1.04e+00 | 8.67e+00 +/- 7.6e-01 | 8.77e+00 +/- 7.2e-01 |
test_perturb_2 | -2.40 +/- 5.40 | -3.52e-01 +/- 7.91e-01 | 1.43e+01 +/- 6.2e-01 | 1.47e+01 +/- 4.9e-01 | |
| benchmark_name | dt(%) | dt(s) | t_new(s) | t_old(s) |
| -------------------------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- |
test_build_transform_fft_lowres | +0.74 +/- 1.72 | +1.13e-04 +/- 2.63e-04 | 1.54e-02 +/- 2.1e-04 | 1.53e-02 +/- 1.5e-04 |
test_build_transform_fft_midres | +0.54 +/- 1.12 | +5.06e-04 +/- 1.06e-03 | 9.44e-02 +/- 8.6e-04 | 9.39e-02 +/- 6.1e-04 |
test_build_transform_fft_highres | +0.73 +/- 0.94 | +3.36e-03 +/- 4.34e-03 | 4.65e-01 +/- 3.9e-03 | 4.62e-01 +/- 2.0e-03 |
test_equilibrium_init_lowres | +2.80 +/- 2.13 | +1.84e-02 +/- 1.40e-02 | 6.75e-01 +/- 1.3e-02 | 6.57e-01 +/- 5.4e-03 |
test_equilibrium_init_medres | +0.00 +/- 2.85 | +3.23e-05 +/- 2.83e-02 | 9.94e-01 +/- 2.6e-02 | 9.94e-01 +/- 1.2e-02 |
test_equilibrium_init_highres | +0.07 +/- 0.69 | +1.89e-03 +/- 1.78e-02 | 2.56e+00 +/- 1.1e-02 | 2.56e+00 +/- 1.4e-02 |
test_objective_compile_dshape_current | -1.40 +/- 6.95 | -5.85e-02 +/- 2.91e-01 | 4.14e+00 +/- 2.5e-01 | 4.19e+00 +/- 1.6e-01 |
test_objective_compile_atf | -0.55 +/- 8.21 | -5.14e-02 +/- 7.62e-01 | 9.22e+00 +/- 5.6e-01 | 9.27e+00 +/- 5.2e-01 |
test_objective_compute_dshape_current | +0.83 +/- 2.06 | +1.80e-05 +/- 4.48e-05 | 2.19e-03 +/- 2.5e-05 | 2.17e-03 +/- 3.7e-05 |
test_objective_compute_atf | -1.90 +/- 1.03 | -1.45e-04 +/- 7.82e-05 | 7.48e-03 +/- 4.9e-05 | 7.62e-03 +/- 6.1e-05 |
test_objective_jac_dshape_current | +5.20 +/- 10.14 | +2.31e-03 +/- 4.51e-03 | 4.68e-02 +/- 3.6e-03 | 4.45e-02 +/- 2.8e-03 |
test_objective_jac_atf | -0.24 +/- 6.29 | -5.71e-03 +/- 1.47e-01 | 2.34e+00 +/- 5.8e-02 | 2.34e+00 +/- 1.4e-01 |
test_perturb_1 | -1.35 +/- 12.01 | -1.16e-01 +/- 1.03e+00 | 8.45e+00 +/- 7.3e-01 | 8.57e+00 +/- 7.3e-01 |
test_perturb_2 | -1.29 +/- 3.45 | -1.85e-01 +/- 4.95e-01 | 1.42e+01 +/- 4.1e-01 | 1.44e+01 +/- 2.8e-01 | |
| benchmark_name | dt(%) | dt(s) | t_new(s) | t_old(s) |
| -------------------------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- |
test_build_transform_fft_lowres | +2.27 +/- 9.81 | +3.48e-04 +/- 1.50e-03 | 1.56e-02 +/- 1.5e-03 | 1.53e-02 +/- 2.7e-04 |
test_build_transform_fft_midres | +2.74 +/- 1.39 | +2.54e-03 +/- 1.29e-03 | 9.53e-02 +/- 1.2e-03 | 9.28e-02 +/- 3.1e-04 |
test_build_transform_fft_highres | +0.95 +/- 1.08 | +4.36e-03 +/- 4.96e-03 | 4.62e-01 +/- 3.9e-03 | 4.58e-01 +/- 3.0e-03 |
test_equilibrium_init_lowres | -0.12 +/- 1.35 | -7.75e-04 +/- 8.80e-03 | 6.49e-01 +/- 6.6e-03 | 6.50e-01 +/- 5.8e-03 |
test_equilibrium_init_medres | -0.04 +/- 0.92 | -3.69e-04 +/- 9.11e-03 | 9.88e-01 +/- 5.7e-03 | 9.89e-01 +/- 7.1e-03 |
test_equilibrium_init_highres | +1.01 +/- 1.18 | +2.56e-02 +/- 2.98e-02 | 2.56e+00 +/- 2.6e-02 | 2.53e+00 +/- 1.5e-02 |
test_objective_compile_dshape_current | +4.79 +/- 7.87 | +1.96e-01 +/- 3.22e-01 | 4.29e+00 +/- 2.2e-01 | 4.10e+00 +/- 2.3e-01 |
test_objective_compile_atf | +2.39 +/- 5.66 | +2.23e-01 +/- 5.27e-01 | 9.54e+00 +/- 4.4e-01 | 9.31e+00 +/- 2.9e-01 |
test_objective_compute_dshape_current | +1.45 +/- 2.72 | +3.17e-05 +/- 5.94e-05 | 2.22e-03 +/- 3.3e-05 | 2.19e-03 +/- 5.0e-05 |
test_objective_compute_atf | +0.33 +/- 1.33 | +2.55e-05 +/- 1.02e-04 | 7.71e-03 +/- 9.5e-05 | 7.69e-03 +/- 3.7e-05 |
test_objective_jac_dshape_current | +1.53 +/- 12.32 | +7.10e-04 +/- 5.72e-03 | 4.71e-02 +/- 2.4e-03 | 4.64e-02 +/- 5.2e-03 |
test_objective_jac_atf | -0.09 +/- 7.71 | -2.06e-03 +/- 1.80e-01 | 2.33e+00 +/- 1.5e-01 | 2.33e+00 +/- 9.3e-02 |
test_perturb_1 | -1.74 +/- 11.99 | -1.53e-01 +/- 1.05e+00 | 8.63e+00 +/- 7.9e-01 | 8.78e+00 +/- 7.0e-01 |
test_perturb_2 | -1.60 +/- 5.50 | -2.31e-01 +/- 7.93e-01 | 1.42e+01 +/- 5.6e-01 | 1.44e+01 +/- 5.6e-01 | |
| benchmark_name | dt(%) | dt(s) | t_new(s) | t_old(s) |
| -------------------------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- |
test_build_transform_fft_lowres | -0.13 +/- 1.07 | -1.98e-05 +/- 1.65e-04 | 1.54e-02 +/- 1.2e-04 | 1.54e-02 +/- 1.1e-04 |
test_build_transform_fft_midres | -0.83 +/- 1.27 | -7.86e-04 +/- 1.20e-03 | 9.39e-02 +/- 9.1e-04 | 9.47e-02 +/- 7.9e-04 |
test_build_transform_fft_highres | +0.10 +/- 0.70 | +4.55e-04 +/- 3.24e-03 | 4.66e-01 +/- 2.1e-03 | 4.66e-01 +/- 2.5e-03 |
test_equilibrium_init_lowres | +0.50 +/- 1.37 | +3.26e-03 +/- 8.88e-03 | 6.53e-01 +/- 5.3e-03 | 6.50e-01 +/- 7.2e-03 |
test_equilibrium_init_medres | -0.57 +/- 1.52 | -5.75e-03 +/- 1.52e-02 | 9.96e-01 +/- 1.2e-02 | 1.00e+00 +/- 9.5e-03 |
test_equilibrium_init_highres | -0.26 +/- 0.75 | -6.71e-03 +/- 1.92e-02 | 2.55e+00 +/- 1.5e-02 | 2.56e+00 +/- 1.2e-02 |
test_objective_compile_dshape_current | +0.15 +/- 8.35 | +6.09e-03 +/- 3.46e-01 | 4.15e+00 +/- 2.2e-01 | 4.14e+00 +/- 2.6e-01 |
test_objective_compile_atf | +0.66 +/- 5.56 | +6.07e-02 +/- 5.10e-01 | 9.24e+00 +/- 4.2e-01 | 9.18e+00 +/- 2.9e-01 |
test_objective_compute_dshape_current | +0.01 +/- 2.04 | +3.11e-07 +/- 4.44e-05 | 2.18e-03 +/- 3.1e-05 | 2.18e-03 +/- 3.2e-05 |
test_objective_compute_atf | -1.51 +/- 0.90 | -1.16e-04 +/- 6.93e-05 | 7.55e-03 +/- 4.1e-05 | 7.67e-03 +/- 5.6e-05 |
test_objective_jac_dshape_current | -5.38 +/- 11.78 | -2.56e-03 +/- 5.60e-03 | 4.50e-02 +/- 4.3e-03 | 4.75e-02 +/- 3.6e-03 |
test_objective_jac_atf | -3.50 +/- 5.85 | -8.40e-02 +/- 1.40e-01 | 2.32e+00 +/- 6.8e-02 | 2.40e+00 +/- 1.2e-01 |
test_perturb_1 | +0.24 +/- 13.29 | +2.04e-02 +/- 1.14e+00 | 8.58e+00 +/- 8.3e-01 | 8.56e+00 +/- 7.8e-01 |
test_perturb_2 | -0.62 +/- 5.57 | -8.88e-02 +/- 8.03e-01 | 1.43e+01 +/- 7.0e-01 | 1.44e+01 +/- 4.0e-01 | |
… boozmn output function
…to zernike_to_fourier to use input basis sym
| benchmark_name | dt(%) | dt(s) | t_new(s) | t_old(s) |
| -------------------------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- |
test_build_transform_fft_lowres | -1.60 +/- 1.92 | -3.65e-04 +/- 4.37e-04 | 2.24e-02 +/- 3.2e-04 | 2.28e-02 +/- 2.9e-04 |
test_build_transform_fft_midres | +1.25 +/- 0.85 | +1.65e-03 +/- 1.13e-03 | 1.34e-01 +/- 8.3e-04 | 1.32e-01 +/- 7.7e-04 |
test_build_transform_fft_highres | +0.55 +/- 0.86 | +3.35e-03 +/- 5.19e-03 | 6.10e-01 +/- 3.7e-03 | 6.06e-01 +/- 3.7e-03 |
test_equilibrium_init_lowres | -1.47 +/- 1.22 | -1.48e-02 +/- 1.22e-02 | 9.89e-01 +/- 6.6e-03 | 1.00e+00 +/- 1.0e-02 |
test_equilibrium_init_medres | -1.76 +/- 1.06 | -2.64e-02 +/- 1.59e-02 | 1.48e+00 +/- 1.3e-02 | 1.50e+00 +/- 8.6e-03 |
test_equilibrium_init_highres | -0.41 +/- 0.74 | -1.47e-02 +/- 2.65e-02 | 3.56e+00 +/- 1.9e-02 | 3.57e+00 +/- 1.8e-02 |
test_objective_compile_dshape_current | -1.90 +/- 6.58 | -1.22e-01 +/- 4.22e-01 | 6.29e+00 +/- 2.8e-01 | 6.42e+00 +/- 3.2e-01 |
test_objective_compile_atf | -0.55 +/- 3.67 | -1.04e-01 +/- 6.89e-01 | 1.87e+01 +/- 4.4e-01 | 1.88e+01 +/- 5.3e-01 |
test_objective_compute_dshape_current | -2.77 +/- 3.84 | -1.13e-04 +/- 1.56e-04 | 3.96e-03 +/- 1.3e-04 | 4.07e-03 +/- 9.2e-05 |
test_objective_compute_atf | -0.89 +/- 2.60 | -1.21e-04 +/- 3.52e-04 | 1.34e-02 +/- 2.7e-04 | 1.35e-02 +/- 2.2e-04 |
test_objective_jac_dshape_current | +2.84 +/- 11.42 | +4.67e-03 +/- 1.87e-02 | 1.69e-01 +/- 9.0e-03 | 1.64e-01 +/- 1.6e-02 |
test_objective_jac_atf | -3.27 +/- 2.77 | -2.79e-01 +/- 2.37e-01 | 8.26e+00 +/- 1.9e-01 | 8.54e+00 +/- 1.5e-01 |
test_perturb_1 | -0.88 +/- 10.48 | -1.15e-01 +/- 1.36e+00 | 1.29e+01 +/- 8.9e-01 | 1.30e+01 +/- 1.0e+00 |
test_perturb_2 | -1.54 +/- 6.16 | -3.49e-01 +/- 1.40e+00 | 2.23e+01 +/- 1.0e+00 | 2.27e+01 +/- 9.7e-01 | |
Co-authored-by: Yigit Gunsur Elmacioglu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor comments
desc/compute/_omnigenity.py
Outdated
label="", | ||
units="~", | ||
units_long="None", | ||
description="Inner product norm for boozer modes basis.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know what this is, but it's not obvious from the name/description. Is this something that has to be its own compute quantity? It's really just a weighting used for other calculations, and it's a constant determined by the basis modes. I think it would make more sense to have it passed in with the transforms
(or even add it as an attribute to the Basis class?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a constant which has to be re-calculated for a few other things, so to me makes sense to ahve it computed once and stored. Whether that is here or elsewhere does not really matter, but to pass it in transforms I would need to compute it in like get_transforms or something, and that will require other special logic as well. If possible I'd like to keep it as is here, if people are curious they can check the source code like the other stuff in our list of variables.
This also could be used to transform other quantities to Boozer as well, so it is useful to have as a compute quantiity I think.
For future reference, the If you consider the So for the For So for the |
Add
make_boozmn_output
utility function tovmec_utils
, which allows DESC to write boozmn.nc style output files containing Boozer harmonics. I/O based heavily off of the hidden symmetries version of booz_xform"|B|_mn_B"
and how to get into the familiar double angle form - make issue|B|_mn
numnc
from the DESC-savedboozmn
is the opposite sign to the C++ savedboozmn
. Not sure what the issue is... the DESC-savednu
agrees better with the DESCnu
, and the other quantities are all in agreement from both C++ and DESC, so it is something subtle