Skip to content

compare_isobgd_data.m

Basic Information

  SYNTAX:  compare_isobgd_data

  PURPOSE:  To extract coil current and R,z-data from efit-generated
    g0-files, read isoflux/Bgrid Green functions, and compare EFIT response
    at control points with predicted values from rigid predictors
    generated by rzrig. Also does R,Z comparison from
    compare_efit_rig along the way.
 (Works only for D3D right now, but should be generalizable.)

  INPUT:
      shot = shot number of data to compare with model.
        Must agree with g0-files in default directory.
      model_shotnum = shot number of model (appearing in model data file
        names, e.g. out_objs_<shot>_<time>.mat)
      model_dir = directory where out_objs*, out2_objs*, drzdi* files located
      tref = reference time for EFIT data (in ms)
      model_tref = reference time for model files (in ms)
      t1ms = initial g0-file time (msec)
      t2ms = final g0-file time (msec)
      dtms = time interval (msec) between g0-file times
      eqdir = directory w/ eqdsk files (end with "/", eg '/matlab/plresp/')
      efit_times (optional) = vector of efit_times (if not supplied, constructs
        from t1ms,t2ms,dtms).
      create_plotfile = 1 if you want color postscript file of all plots
      ildefit = 1 to load EFIT data (0 to disable to save time for later runs)
      iloaddi = 1 to load model response files (0 to disable loading)
      ikillE = 1 to kill effect of E-coil currents in prediction (else incl)
      iuseIp = 1 to use drdip object in predicted response
      niso = index of isoflux segment to use for comparison
      nbgd = index of Bgrid row to use for comparison
      icompall = flag to enable comparison plotting of entire segments
            for all time points (scroll through with CR...)
            1=plot, 0=skip (if skip just compares average over
            the segment)
      create_plotfile = set to 1 to create *.psc file containing plots
                (optional, default = 0)

  OUTPUT:
     t = time vector (secs)
     zm_efit = vertical position data vector from EFIT g0-file data
     zo_efit = LCFS vertical position data vector from EFIT g0-file data
     z_rig = vertical position data vector from rigid predictor dzdis
     rm_efit = vertical position data vector from EFIT g0-file data
     ro_efit = LCFS vertical position data vector from EFIT g0-file data
     r_rig = vertical position data vector from vst predictor drdi
    Plots comparison of EFIT and corresponding R,Z predictor data in
         figures 1 and 2.

  RESTRICTIONS:
    Must have generated efits in eqdir from t1ms to t2ms

Dependencies