omfit_eqdsk公司

omfit-eqdsk的Python项目详细描述


EQDSK用作OMFIT项目一部分的文件:https://omfit.io/

提供:

  • 从mds中读取基本公式
  • 从\u mds\u plus
  • OMFIT_pcs_形状
  • 从你的搜索中读到基本的均衡
  • x点搜索
  • x点快速搜索
  • gEQDSK_COCOS_识别
  • 奥姆菲特克德斯克
  • 奥姆菲塔伊德斯克
  • 乌姆菲茨克
  • 乌姆菲特克德斯克
  • 奥菲特梅奇德斯克
  • OMFITseqdsk公司
  • 通量表面
  • fluxSurfaceTraces公司
  • 边界形状
  • 边界形状
  • 磁通量
  • 罗兹米勒
  • miller_衍生

要求:

  • fortranformat>;=0.2
  • matplotlib>;=3.1,!=3.2.1,!=3.2.2
  • 数量=1.12
  • omas>;=0.67.0
  • 0.0英寸=1英寸
  • 不确定性>;=3
  • xarray>;=0.10.8
  • omfit_ascii==2020.12.2.22.59
  • omfit_路径==2020.12.2.22.59
  • omfit_nc==2020.12.2.22.59
  • omfit_namelist==2020.12.2.22.59
  • omfit_mds==2020.12.2.22.59
  • omfit_数据==2020.12.2.22.59
  • omfit_错误==2020.12.2.22.59
  • omfit_commonclasses==2020.12.2.22.59

作者:

https://omfit.io/contributors.html

文件:

从mds中读取基本公式

Read basic equilibrium data from MDSplus
This is a lightweight function for reading simple data from all EFIT slices at once without making g-files.

:param device: str
    The tokamak that the data correspond to ('DIII-D', 'NSTX', etc.)

:param server: str [Optional, special purpose]
    MDSplus server to draw data from. Use this if you are connecting to a
    server that is not recognized by the tokamak() command, like vidar,
    EAST_US, etc. If this is None, it will be copied from device.

:param shot: int
    Shot number from which to read data

:param tree: str
    Name of the MDSplus tree to connect to, like 'EFIT01', 'EFIT02', 'EFIT03', ...

:param g_file_quantities: list of strings
    Quantities to read from the sub-tree corresponding with the EFIT g-file.
    Example: ['r', 'z', 'rhovn']

:param a_file_quantities: list of strings
    Quantities to read from the sub-tree corresponding with the EFIT a-file.
    Example: ['area']

:param measurements: list of strings
    Quantities to read from the MEASUREMENTS tree.
    Example: ['fccurt']

:param derived_quantities: list of strings
    Derived quantities to be calculated and returned.
    This script understands a limited set of simple calculations: 'time', 'psin', 'psin1d'
    Example: ['psin', 'psin1d', 'time']

:param other_results: list of strings
    Other quantities to be gathered from the parent tree that holds gEQDSK and aEQDSK.
    Example: ['DATE_RUN']

:param quiet: bool

:param get_all_meas: bool
    Fetch measurement signals according to its time basis which includes extra time slices that failed to fit.
    The time 'axis' will be avaliabe in ['mtimes']

:param toksearch_mds: OMFITtoksearch instance
    An already fetched and loaded OMFITtoksearch object, expected to have
    fetched all of the signals for the mdsValues in this file.

:param allow_shot_tree_translation: bool
    Allow the real shot and tree to be translated to the fake shot stored in the EFIT tree

:return: dict

从\u mds\u plus

^{pr2}$

OMFIT_pcs_形状

药方

从你的搜索中读到基本的均衡

药方

x点搜索

Improve accuracy of X-point coordinates by upsampling a region of the fluxmap around the initial estimate

Needs some sort of initial estimate to define a search region

:param rgrid: 1d float array
    R coordinates of the grid
:param zgrid: 1d float array
    Z coordinates of the grid
:param psigrid: 2d float array
    psi values corresponding to rgrid and zgrid
:param r_center: float
    Center of search region in r; units should match rgrid. Defaults to result of x_point_quick_search()
:param z_center: float
    Center of the search region in z.
:param dr: float
    Half width of the search region in r. Defaults to about 5 grid cells.
:param dz:
    Half width of the search region in z. Defaults to about 5 grid cells.
:param zoom: int
    Scaling factor for upsample
:param kw: additional keywords passed to x_point_quick_search r_center and z_center are not given.
:return: two element float array
    Higher quality estimate for the X-point R,Z coordinates with units matching rgrid

x点快速搜索

Make a quick and dirty estimate for x-point position to guide higher quality estimation

The goal is to identify the primary x-point to within a grid cell or so

:param rgrid: 1d float array
    R coordinates of the grid

:param zgrid: 1d float array
    Z coordinates of the grid

:param psigrid: 2d float array
    psi values corresponding to rgrid and zgrid

:param psi_boundary: float [optional]
    psi value on the boundary; helps distinguish the primary x-point from other field nulls
    If this is not provided, you may get the wrong x-point.

:param psi_boundary_weight: float
    Sets the relative weight of matching psi_boundary compared to minimizing B_pol.
    1 gives ~equal weight after normalizing Delta psi by grid spacing and r (to make it comparable to B_pol in
    the first place)
    10 gives higher weight to psi_boundary, which might be nice if you keep locking onto the secondary x-point.
    Actually, it seems like the outcome isn't very sensitive to this weight. psi_boundary is an adequate tie
    breaker between two B_pol nulls with weights as low as 1e-3 for some cases, and it's not strong enough to move
    the quick estiamte to a different grid cell on a 65x65 with weights as high as 1e2. Even then, the result is
    still close enough to the True X-point that the higher quality algorithm can find the same answer. So, just
    leave this at 1.

:param zsign: int
    If you know the X-point you want is on the top or the bottom, you can pass in 1 or -1 to exclude
    the wrong half of the grid.

:return: two element float array
    Low quality estimate for the X-point R,Z coordinates with units matching rgrid

gEQDSK_COCOS_识别

Returns the native COCOS that an unmodified gEQDSK would obey, defined by sign(Bt) and sign(Ip)
In order for psi to increase from axis to edge and for q to be positive:
All use sigma_RpZ=+1 (phi is counterclockwise) and exp_Bp=0 (psi is flux/2.*pi)
We want
sign(psi_edge-psi_axis) = sign(Ip)*sigma_Bp > 0  (psi always increases in gEQDSK)
sign(q) = sign(Ip)*sign(Bt)*sigma_rhotp > 0      (q always positive in gEQDSK)
::
    ============================================
    Bt    Ip    sigma_Bp    sigma_rhotp    COCOS
    ============================================
    +1    +1       +1           +1           1
    +1    -1       -1           -1           3
    -1    +1       +1           -1           5
    -1    -1       -1           +1           7

奥姆菲特克德斯克

Automatically determine the type of an EFIT file and parse it with the appropriate class.
It is faster to just directly use the appropriate class. Using the right class also avoids problems because some
files technically can be parsed with more than one class (no exceptions thrown), giving junk results.

:param filename: string
    Name of the file on disk, including path

:param EFITtype: string
    Letter giving the type of EFIT file, like 'g'. Should be in 'gamks'.
    If None, then the first letter in the filename is used to determine the file type
    If this is also not helping, then a brute-force load is attempted

:param strict: bool
    Filename (not including path) must include the letter giving the file type.
    Prevents errors like using sEQDSK to parse g133221.01000, which might otherwise be possible.

:param \**kw: Other keywords to pass to the class that is chosen.

:return: OMFIT*eqdsk instance

奥姆菲塔伊德斯克

class used to interface A files generated by EFIT

:param filename: filename passed to OMFITascii class

:param \**kw: keyword dictionary passed to OMFITascii class

乌姆菲茨克

class used to interface G files generated by EFIT

:param filename: filename passed to OMFITascii class

:param \**kw: keyword dictionary passed to OMFITascii class

乌姆菲特克德斯克

class used to interface with K files used by EFIT

:param filename: filename passed to OMFITascii class

:param \**kw: keyword dictionary passed to OMFITascii class

奥菲特梅奇德斯克

class used to interface M files generated by EFIT
:param filename: filename passed to OMFITascii class

:param \**kw: keyword dictionary passed to OMFITascii class

OMFITseqdsk公司

class used to interface S files generated by EFIT

:param filename: filename passed to OMFITascii class

:param \**kw: keyword dictionary passed to OMFITascii class

通量表面

Trace flux surfaces and calculate flux-surface averaged and geometric quantities
Inputs can be tables of PSI and Bt or an OMFITgeqdsk file

fluxSurfaceTraces公司

药方

边界形状

Function used to generate boundary shapes based on `T. C. Luce, PPCF, 55 9 (2013)`
Direct Python translation of the IDL program /u/luce/idl/shapemaker3.pro

:param a: minor radius

:param eps: aspect ratio

:param kapu: upper elongation

:param lkap: lower elongation

:param delu: upper triangularity

:param dell: lower triangularity

:param zetaou: upper outer squareness

:param zetaiu: upper inner squareness

:param zetail: lower inner squareness

:param zetaol: lower outer squareness

:param zoffset: z-offset

:param upnull: toggle upper x-point

:param lonull: toggle lower x-point

:param npts: int
    number of points (per quadrant)

:param doPlot: plot boundary shape construction

:param newsq: A 4 element array, into which the new squareness values are stored

:return: tuple with arrays of r,z,zref

>> boundaryShape(a=0.608,eps=0.374,kapu=1.920,kapl=1.719,delu=0.769,dell=0.463,zetaou=-0.155,zetaiu=-0.255,zetail=-0.174,zetaol=-0.227,zoffset=0.000,upnull=False,lonull=False,doPlot=True)

边界形状

Class used to generate boundary shapes based on `T. C. Luce, PPCF, 55 9 (2013)`

磁通量

Calculate geometric properties of a single flux surface

:param inputR: R points

:param inputZ: Z points

:param lcfs: whether this is the last closed flux surface (for sharp feature of x-points)

:param doPlot: plot geometric measurements

:return: dictionary with geometric quantities

罗兹米勒

return R,Z coordinates for all flux surfaces from miller geometry coefficients in input.profiles file
based on gacode/gapy/src/gapy_geo.f90

:param a: minor radius

:param R: major radius

:param kappa: elongation

:param delta: triandularity

:param zeta: squareness

:param zmag: z offset

:param poloidal_resolution: integer with number of equispaced points in toroidal angle, or array of toroidal angles

:return: 1D arrays with (R, Z) flux surface coordinates

miller_衍生

Originally adapted by A. Tema from FORTRAN of gacode/shared/GEO/GEO_do.f90

:param rmin: minor radius

:param rmaj: major radius

:param kappa: elongation

:param delta: triangularity

:param zeta: squareness

:param zmag: z magnetic axis

:param q: safety factor

:return: dictionary with volume, grad_r0, bp0, bt0

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何在没有代码气味的情况下编写遵循Liskov替代和其他可靠原则的不可变映射?   java最新jre上的压缩字符串对旧编译代码有好处吗?   java是否可以在javascript中取消PrimeFaces menuitem onclick函数   mysql从SQL数据库中访问java中xml名称空间标记的值   从java程序打开excel文件   java在方法中使用“var”是否会使执行(并发)线程不安全?   java使搜索视图以一种关于AndroidManifest的通用方式可用。xml   java对如何准确使用正则表达式感到困惑?   mule如何访问java文件中的记录变量   java在从2D数组引发异常后继续   枚举当前设置为的java值   java当listview只有几个项目时,如何使alert对话框显示listview的所有项目?   java getTableRow()返回大于项大小的索引   c用java传输二进制文件(数据)   java更改多选列表项复选框颜色