Example #1
0
def load(dimension,tstart,tend,tstep,full_load,fluc_only,eq_only):
    time_steps = np.arange(tstart,tend+1,tstep)
    if dimension == 3:
        xgc_nstx_139047 = xgc.XGC_Loader(xgc_path,grid3D,time_steps,dn_amplifier = 1,n_cross_section = 16, Equilibrium_Only = eq_only,Full_Load = full_load, Fluc_Only = fluc_only)
    elif dimension == 2:
        xgc_nstx_139047 = xgc.XGC_Loader(xgc_path,grid2D,time_steps,dn_amplifier = 1,n_cross_section = 1, Full_Load = full_load, Fluc_Only = fluc_only)
        
    return xgc_nstx_139047
def single_load(t):
    try:
        import sys
        sys.path.append('/p/gkp/lshi/')
        import sdp.plasma.xgc.loader as xgc
        import sdp.geometry.grid as Grid
        grid3D = Grid.Cartesian3D(Xmin=1.25,
                                  Xmax=1.6,
                                  Ymin=-0.5,
                                  Ymax=0.5,
                                  Zmin=-0.35,
                                  Zmax=0.35,
                                  NX=100,
                                  NY=300,
                                  NZ=100)
        xgc_nstx = xgc.XGC_Loader(xgc_path,
                                  grid3D,
                                  t,
                                  t + 1,
                                  2,
                                  dn_amplifier=1,
                                  n_cross_section=16,
                                  Equilibrium_Only=False,
                                  Full_Load=True,
                                  Fluc_Only=False)
        xgc_nstx.cdf_output(output_path, eq_file='eqfile{0}.cdf'.format(t))
    except Exception as e:
        return str(e)
    return 0
Example #3
0
def single_load_2d(t):
    try:
        import sys
        sys.path.append('/p/gkp/lshi/')
        import sdp.plasma.xgc.loader as xgc
        import sdp.geometry.grid as Grid
        grid2D = Grid.Cartesian2D(DownLeft = (-0.5,1.25),UpRight = (0.5,1.6),NR = 256, NZ = 512)
        xgc_nstx = xgc.XGC_Loader(xgc_path,grid2D,t,t+1,2,dn_amplifier = 1,n_cross_section = 32, Equilibrium_Only = False,Full_Load = True, Fluc_Only = False)
        xgc_nstx.cdf_output(output_path,eq_file = 'eqfile{0}.cdf'.format(t))
    except Exception as e:
        return str(e)
    return 0