change_profile_coords.m
SYNTAX: profile_data = change_profile_coords(prof_data_in,coord,options)
PURPOSE: Perform transformation of profile data to user-selected coordinate.
INPUT:
prof_data_in = data structure, which must contain the fields:
time: column vector of profile times
coord_vals: row vector of profile independent coordinate (normalized psi) values
data: profile data, with each row a profile and time increasing down columns
psimag: column vector containing psi value at magnetic axis for each time
psibry: column vector containing psi value at boundary for each time
coord = radial coordinates to convert to. One of:
'psi' (total poloidal flux)
'Phi' (total toroidal flux)
'rho' (GA defn of toroidal flux: sqrt(Phi^2/(pi*BT0) )
'theta' (Lehigh coordinate: BT0*rho_bdry*rho/q )
options = structure containing optional or additional data:
normalize = if 1, divide coord vals by boundary value, default 0
q_profiles = q-profile structure, needed if Phi, rho, or theta requested
BT0 = Toroidal field in T at magnetic axis needed for Phi, rho, and theta, at times
contained in prof_data_in.
OUTPUT:
profile_data = data structure, with same structure as prof_data_in
RESTRICTIONS:
(1) Most conversions require q profile (code complains if required).
(2) Function now assumes that prof_data_in has coordinates of psinorm.
This can be generalized later.