Default options#
The code uses two input decks, which are located in configs/1d. The primary input deck, inputs.yaml, contains the parameters that are most likely to be changed on a shot-to-shot basis. The secondary input deck, defaults.yaml, contains all parameters. This includes the parameters in the primary input deck, but also includes all other parameters that can be modified externally to the code. When running the code, the inputs.yaml deck will override any conflicting values in the defaults.yaml deck, allowing for quick changes to commonly modified parameters without needing to change the defaults.yaml deck.
This page contains a detailed description of the parameters in the defaults.yaml deck. For a more concise description of the parameters that are most commonly modified, see the inputs page.
Parameters#
All fitting parameters are found in the parameters: section of the input decks. The fitting parameters are broken up based off their scope.
There must be at least 3 subfields referencing the different species in parameters called electron,
ion-1, and general. If the problem has multiple ion species additional ion species fields can be added
with increasing index numbers, i.e. ion-2, ion-3.
Each species has associated fitting parameters which generally have 4 attributes: val, active,
lb, and ub. val is the initial value for a fitted parameter or the constant value for a
static parameter. active is a boolean determining if the parameter is being fit, so parameters with active: False will be held at the value in val. ub and lb are upper and lower bounds respectively for the parameter and are generally hard constraints on the values.
If fields require inputs other than the standard 4 attributes, the additional attributes will be described in the documentation for that field.
Electron Parameters#
These parameters are found in the parameters:electron section of the input deck and describe various properties of the electrons.
Teis the electron temperature in keVneis the electron density in \(10^{20}\) cm-3feis the electron velocity distribution function. Like other parameters it has an active flag which controls whether it is being fit, but the other fields function differently.dimspecifies the dimensionality of the distribution function. Options are 1 for a distribution function that is spherically symmetric in velocity space and 2 for a distribution function that has x and y dependence but is integrated along z where z is the probe’s polarization direction. 2D options are very computationally expensive and most 2D effects are not visible in standard Thomson scattering, therefore 2D should only be used in forward modeling.typespecifies the class of distribution function. 1D Options aredlmfor a Dum-Langdon-Matte distribution also known as a super-gaussian,mxfor a Maxwellian distribution, andarbitraryfor an arbitrary numerically defined distribution. For most purposes thedlmoption is sufficient and recommended, while themxoption only works iffe:activeis set to False butdlmcan also produce a Maxwellian distribution if the super-Gaussian order is set to 2. Thearbitraryoption allows the code to alter the distribution function point by point and is only tractable for special cases. 2D options arearbitraryfor an arbitrary numerically defined distribution in 2D andsphericalfor a distribution based on spherical harmonics. Regardless of the dimensionality or model the distribution function is projected onto a Cartesian grid for use in the Thomson scattering calculations.nvxis the number of velocity points along each direction of the final velocity gridparamsis the container for various model specific parameters.Nlis the number of Legendre polynomials used to define the distribution function when thesphericalmodel is used. This parameter is only relevant iftype: sphericaland is ignored otherwise.dtxis the Knudsen number along the x direction for Spitzer-Harm type or the more general Mora-Yahi type distribution functions. This parameter set the amount of heat flux in this model. This parameter is only relevant ifflm_typeis set tomora-yahiand is ignored otherwise. See Mora and Yahi (2003).dtyis the Knudsen number along the y direction for the Mora-Yahi type distribution functions.flm_typespecifies the form of the spherical harmonic coefficients when thesphericalmodel is used. These coefficients are the standard harmonic decomposition of the distribtuion function. The options aremora-yahito generate the coefficients based on the Mora-Yahi distribution function (a generalization of the Spitzer-Harm distribution function that allows super-Gaussian distributions) andarbitraryto allow the coefficients to be fit with each velocity point being its own free parameter.mis the super-Gaussian order for the DLM distribution function. At m=2 this reduces to a Maxwellian distribution. When fitting the distribution function is activated withfe:activeandtype: dlmthen the super-Gaussian order will be fit as the free parameter of the distribution. theval,lb, andubfields for this parameter function the same as other parameters.matteis a boolean which determines if the DLM distribution function follow the Matte formula which specifies the super-Gaussian order based on the electron temperature, ionization state, and overlapped laser intensity. This is an alternative to fitting the super-Gaussian order and has been found to be a good model for many experiments. Ifmatteis set to True then themparameter will be ignored and the super-Gaussian order will be determined by the Matte formula and therefore is not compatible with fitting the super-Gaussian order. Whenmatteis used, the super-Gaussian will still evolve as the temperature and ionization state evolve to maintain consistency with the Matte formula. See Matte et al. (1988).intensis the \(3\omega\) laser intensity in units of \(10^{14}\) W/cm-2 and is used in the Matte formula to determine the super-Gaussian order. This is only relevant ifmatteis set to True.
nvris the number of velocity points in the radial direction for the spherical harmonic decomposition. This is only relevant iftype: sphericaland is ignored otherwise.smoothis a boolean which determines if the distribution function will be smoothed at every iteration of the fit. This is especially important if any of the distribution types are arbitrary as the large number of free parameters can lead to unphysical oscillations in the distribution function. Ifsmoothis set to True then the distribution function will be convolved with a window specified bywindowat every iteration of the fit.windowspecifies the type and size of the window used to smooth the distribution function ifsmoothis set to True.lendefines the number of points used in the smoothing window, and is submitted as a parameter to the window function specified bytype.typespecifies the type of window used for smoothing. Current options arehanningandbutterworthwhich are all standard smoothing functions.
Ion Parameters#
These parameters are found in the parameters:ion-1 section of the input deck and describe various properties of the ions. If multiple ion species are being fit additional sections such as parameters:ion-2 which have the same parameters as parameters:ion-1 can be appended.
Tiis the ion temperature in keVsameis a special field for ion temperature; if multiple ions are used subsequent ions can have this boolean set to True in order to use a single ion temperature for all ion species
Zis the average ionization state of the parent speciesAis the atomic mass number this should always be a constant and not fitfractis the element ratio for multispecies plasmas; the sum offractfor all species is held constant at 1. So if there are 2 ion species and the first hasfract: 0.3then 30% of the ions are of that species. If the sum of thefractfields for all species is not 1 then the code will automatically rescale them to sum to 1. It is possible to fit thefractfield for one or more species, but this parameter is self normalized between 0 and 1 so it does not have bounds.Vais the species flow velocity in 10^6 cm/s
Added in version 0.2.0: Va is now associated with indivdual ions allowing for counter-streaming plasmas or other complicated flow configurations. In previous versions the flow was a general parameter that was applied to all ions.
General parameters#
These parameters are found in the parameters:general section of the input deck and describe various properties of the plasma that are not specific to a single species.
amp1is the blue-shifted EPW amplitude multiplier with 1 being the maximum of the dataamp2is the red-shifted EPW amplitude multiplier with 1 being the maximum of the dataamp3is the IAW amplitude multiplier with 1 being the maximum of the datalamis the probe wavelength in nanometers; a small shift (<5 nm) can be used to mimic wavelength calibration uncertaintyTe_gradientis the electron temperature spatial gradient in % ofTe.Tewill take the formlinspace(Te-Te*Te_gradient.val/200, Te+Te*Te_gradient.val/200, Te_gradient.num_grad_points).num_grad_pointsis the number of points in the spatial gradient. A higher number of points allows for a smoother gradient but also increases the computational cost of the fit as a spectrum is calculated for each gradient point.num_grad_pointsshould be left at 1 if no gradient is desired.valis the value of the gradient in % ofTe. For example ifTeis 1 keV andvalis 50 then the gradient will go from 0.75 keV to 1.25 keV.
ne_gradientis the electron density spatial gradient in % ofne.newill take the formlinspace(ne-ne*ne_gradient.val/200, ne+ne*ne_gradient.val/200, ne_gradient.num_grad_points). This works the same asTe_gradientbut for the electron density instead of the temperature.udis the electron drift velocity (relative to the ions) in 10^6 cm/s
MLFlow#
When running all code output is managed by MLFlow. This included the fitted parameters as well as the automated plots.
A copy of the inputs decks will also be saved by MLFlow for easier reference. The MLFlow options can be found in the mlflow: section.
experimentis the name of the experiment folder that the run will be associated with. If running locally the experiment folder will be created in themlrunsfolder in the current directory but will be named with a UUID. The MLFlow UI will display the experiment name and run name for easier navigation.runis the name of the analysis or forward model run. Run names do not need to be unique as they are also associated with a UUID. It is recommended that this is changed before each run.
Data#
The data: section contains the specifics on which shot and what region of the shot should be analyzed. As well as all the extended options for how to process the data before fitting and how to apply background subtraction.
shotnumis the OMEGA shot number. For non-OMEGA data please contact the developers.load_ion_specis a boolean determining if IAW data will be loaded.load_ele_specis a boolean determining if EPW data will be loaded.fit_IAWis a boolean determining if IAW data will be fit by including it in the loss metric.fit_EPWbis a boolean determining if the blue shifted EPW data will be fit by including it in the loss metric.fit_EPWris a boolean determining if the red shifted EPW data will be fit by including it in the loss metric.absolute_timingis a boolean determining if the timing of the lineouts will be automatically determined based off the known relation fo the fiducials to t0 for the OMEGA data. This is recommended for time resolved data as long as the fiducials are visible in the raw data, as its the most accurate way of determining t0.lineoutsspecifies the region of the data to take lineouts from.typespecifies the units that the lineout locations are in. Options areumfor microns in imaging data,psfor picoseconds in time resolved data,pixelis the general option to specify locations in pixel numbers.startthe first location where a lineout will be taken.endthe last location where a lineout will be taken.skipthe distance between lineouts in the same units specified bytype.
backgroundspecifies the location and algorithm for background analysis.typethere are multiple background algorithms available. This field is used to select the appropriate one. The options areFitin order to fit a model to the background,Shotin order to subtract a background shot, andpixelto specify a location with background data to be subtracted.sliceis the location for the background algorithm. IfFitorpixelare used this is the pixel location for the background lineout. IfShotis used this is the shot number for the background shot.bg_algspecifies the simple function that is fit to the background whentypeis set toFit. The options arerat11,rat21,exp2andpower2following the naming convention of the Matlab functions with the same names. These functions are all simple 3 or 4 parameter functions.bg_alg_domainsets the domain over which the background is fit. This field has 4 values, and the domain is constructed as a linear domain between the first two pixel values and the second two. For example ifbg_alg_domainis [0, 100, 200, 300] then the background will be fit on a linear domain between pixels 0 and 100 and a linear domain between pixels 200 and 300. This allows for exclusion of regions with signal from the background fit. The algorithms other thanFitalso rescale the background to match the data in the same domain as specified bybg_alg_domain.
Hint
The most common reason fits look poor is due to a poor background subtraction which often results from a background domain that either includes signal or other features that are not representative of the true background such as fiducials of blocked regions.
bg_alg_paramsare the starting values for the model selected bybg_alg.power2andrat11take 3 arguments whileexp2andrat21take 4.bg_smothing_windowis the size of the smoothing window applied to the background whentypeis set topixel. A larger window will result in a smoother background but can smear features such as the notch filter often used for EPWs affecting the fit quality and potentially fitted parameters.bg_subtractis a boolean determining if the background will be subtracted from the data or if the background will be added to the fit model. Subtracting the background from the data is more common but can amplify noise and can affect statistical measures like chi-squared.report_backgroundis a boolean determining if the background will plotted with the data in its own plots. This is useful for diagnosing background subtraction issues but is not necessary for the fitting process.
bgshotmultmultiplier on all background from a separate data file; this is used to rescale the background shot whentypeis set toShot. This can be used to account for differences in laser energy or other factors between the main shot and the background shot.bgscaleEmultiplier on the background applied to EPW analysis.bgscaleImultiplier on the background applied to IAW analysis.dpixeldetermines the width of a lineout in pixels; the width of a lineout is 2*``dpixel`` + 1 centered about the values inlineouts. 2 or 3 is a common value for this parameter to help improve the signal to noise ratio of the lineouts that are being fit, but a larger value can be used for very noisy data at the cost of potentially smearing features in the data due to changing conditions as a function of time or space.ele_lam_shiftshifts the central frequency given bylamin the EPW spectrum, given in nm. This can be used to account for wavelength calibration uncertainty between different the electron and ion data.ele_t0shifts the time denoted as 0 for time resolved EPW data, given in the same units as the lineouts (ps or pixel). This can be used to set t0 to a specific location within the dataset.ion_t0_shiftshifts the time denoted as 0 for time resolved IAW data relative to the EPW’s zero, given in the same units as the lineouts (ps or pixel). This can be used to account for timing uncertainty between the electron and ion data.shotDaychanges the default search path for analysis on a shot day removal likelylaunch_data_visualizeris a boolean determining if plots will be produced of the entire data set with the fitting regions highlighted. This is useful for verifying fitting regions and is generally recommended.fit_rngspecifies the regions of the data to include in calculation of the fit metric (i.e. included in the fit)blue_minstarting wavelength for the analysis of the blue shifted EPW in nmblue_maxending wavelength for the analysis of the blue shifted EPW in nm, must be larger thanblue_minred_minstarting wavelength for the analysis of the red shifted EPW in nm, must be larger thanblue_maxred_maxending wavelength for the analysis of the red shifted EPW in nm, must be larger thanred_miniaw_minstarting wavelength for the analysis of the IAW in nmiaw_maxending wavelength for the analysis of the IAW in nm, must be larger thaniaw_minandiaw_cf_maxiaw_cf_minstarting wavelength for a central feature in the IAW that is to be excluded from analysis in nm. This can be used to exclude s stray light feature or other zero-frequency features between the IAWs. While its not possible to turn offiaw_cf_minandiaw_cf_maxcan be arbitrarily close together to effectively exclude a single pixel.iaw_cf_maxending wavelength for a central feature in the IAW that is to be excluded from analysis in nm, must be larger thaniaw_cf_minforward_epw_startstarting wavelength in nm for the EPW calculation for forward model onlyforward_epw_endending wavelength in nm for the EPW calculation for forward model onlyforward_iaw_startstarting wavelength in nm for the IAW calculation for forward model onlyforward_iaw_endending wavelength in nm for the IAW calculation for forward model only
ion_loss_scalemultiplier on the IAW component of the fit metric, allows for balancing of the electron and ion contribution to the total loss. This is useful for data with differing signal levels or to emphasize the fit quality of one feature over another.probe_beamidentifies the beam on OMEGA used as the probe, automatically adjusts the scattering angle and finite aperture calculations. Currently available options are P9 (standard for most experiments), B12, B15, B23, B26, B35, B42, B46, B58, and B62.
Optimizer#
The optimizer: section includes options specifying the behavior of the optimizer used to fit the data.
batch_sizenumber of lineouts to be fit simultaneously; the code is designed to fit multiple lineouts at once in order to speed up the fitting process by taking advantage of parallelization on a GPU. Selecting an appropriate batch size requires balancing speed with potential plasma condition changes from one lineout to another. For example, if the plasma conditions are changing rapidly as a function of time then it may be best to use a smaller batch size to avoid fitting lineouts with significantly different plasma conditions at the same time. On the other hand, if the plasma conditions are relatively constant across the lineouts being fit then a larger batch size can be used to speed up the fitting process. Generally, a batch size of 4 or 6 is best form the majority of cases.methodgradient descent algorithm employed by the minimizer; this can bel-bfgs-bin which case scipy’s implementation of the L-BFGS-B algorithm will be used, or almost any of the optimizers from the optax library which includeadam,sgd, andrmsprop. For a full list see the optax documentation. L-BFGS-B is recommended for simpler problems as its more efficient but the optax algorithms provide more control when needed andadamis usualy a good choice for IAW data and combined fits.moment_lossboolean, adds a penalty to maintain the moments of the EDF when fitting EDFs numerically needs more testingloss_methodmetric minimized in order to match data;l2is recommended butl1,log-cosh, andpoissonare also availablehessianboolean, determines if the hessian will be supplied to the minimizer (Not recommended; Likely to be removed)jitboolean, determines if just-in-time compilation will be used for the optimization; TSADAR is designed to be JITed and therefore it is always recommended to use JIT compilation.learning_rate_initinitial learning rate for the optimizers that require a learning rate, i.e. any of the optax optimizers. The learning rate is the scale factor for the step taken by the minimizer at each iteration, so a larger learning rate will result in larger steps and a faster but potentially more unstable fit while a smaller learning rate will result in smaller steps and a slower but potentially more stable fit. Each optimizer has a different interpretation of the learning rate and therefore the optimal learning rate can differ between optimizers. This parameter is used in conjunction with thelearning_rate_finalparameter to set the learning rate schedule for the fit. This schedule is a cosine decay from the initial learning rate to the final learning rate over the first 75% of the total number of epochs, after which the learning rate is held constant at the final learning rate for the remaining 25% of the epochs.learning_rate_finalfinal learning rate for the optimizers that require a learning rate, i.e. any of the optax optimizers. This is used in conjunction with thelearning_rate_initparameter to set the learning rate schedule for the fit.param_methoddetermines how the plasma parameters are updated during the fit. When an optax minimizer is used inmethodthen the plasma condition parameters are update based off this method while the distribution function is updated via themethodparameter. Options forparam_methodare the same as formethod. This allows for different learning rates or stepping algorithms between the distribtuion function and the plasma parameters which can be very useful due to the scale separation between the plasma parameters and the distribution function values. Whenmethodis set tol-bfgs-bthen the plasma parameters will always be updated with L-BFGS-B regardless of the value ofparam_method.param_learning_rateindependent learning rate for the plasma parameters when an optax minimizer is used inmethodandparam_methodis set to an optax method. This allows for a different learning rate between the plasma parameters.y_normboolean, normalizes data to a maximum value of 1 to improve minimizer behavior; true values are still used for error analysisx_normboolean, normalizes data to a maximum value of 1 as an input to the neural network deprecatedgrad_methodAD or FD determining if gradients are computed with automatic difference or finite difference, AD is always recommended but FD can be used for performance testingnum_epochsmax number of iterations of the minimizer for each batchlearning_ratescale factor for step sizes taken by the minimizerparameter_normboolean, determines if the fitted parameters will be rescaled to 0 to 1, this is always recommended as it improves the behavior of the minimizer by keeping all parameters on the same scale, but the true values of the parameters are still used for error analysis and plotting.refine_factorfactor used to rescale the EDF domain during multiple minimizations of ARTS datanum_minshow many times the minimization will be performed on ARTS data, does not effect non-ARTS datasave_stateboolean, determines if the state of the minimizer will be saved at some regular period during the minimization, primarily used for understanding the behavior of the minimizersave_state_freqhow often the state of the minimizer will be saved during the minimization in terms of number of epochs between saves, primarily used for understanding the behavior of the minimizersequentialboolean, if true the final parameters from each batch will be used as initial conditions for the following batch. If false, input deck initial conditions will be used for all lineouts.
Other options#
The other: section includes options specifying the types of data that are being fit and other options on how to perform the fit.
include_gainsis a boolean determining whether to compute the SRS and SBS amplification of the Thomson scattered light. Havinginclude_gainsset to True will require the pump intensity and beam diameter to be specified in theother:section of the input deck.Ipump_14is the intensity relevant to computing the SRS and SBS amplification in units of \(10^{14}\) W/cm-2. This is likely the probe beam intensity for most experiments at that is the beam that is overlapped with the scattering volume, but for some experiments it may differ.beam_diam_umis the beam diameter in microns of the beam that pumps SRS and SBS, again this is likely the probe beam diameter. This is used in conjunction with the scattering angle to compute the gain length for the SRS and SBS amplification.refitis a boolean determining if poor fits will attempt to be refit; it is recommended this is only turned on once most fits look good.refit_threshis the value of the loss metric above which refits will be performed; this threshold must be determined empirically from the other fits.calc_sigmasis a boolean determining if a Hessian will be computed to determine the uncertainty in fitted parameters.
Deprecated since version 0.2.0: calc_sigmas is currently deprecated. Implementation of uncertainty quantification is planned for a future release but the current method of computing sigmas from the Hessian is not robust and therefore has been deprecated until a more robust method can be implemented.
extraoptionsis a container for some additional optionsspectypespecifies the type of spectrum such as temporal or spatial, it is populated by the code based on the data file and does not need to be set.
expandedionsis a boolean determining if a non-linear wavelength grid will be used allowing IAW and EPW spectra to be resolved simultaneously currently deprecated.PhysParamsis a dictionary that is assigned within the code and stores detector information. Values modified within this dictionary will only apply to forward mode.iawoffis a boolean determining if the iaw will be suppressed in plotting of the EPW featureiawfilteris an alternative toiawoffthat suppresses the IAW with a notch filter. The list has 4 elements: boolean for on/off, OD of the filter, spectral width of the filter in nm, and central wavelength of the filter in nm.CCDsizesize of the CCD in pixelsflatbgflat (applied to all pixes) value added to the backgroundgainCCD counts per photo-electron; the standard OMEGA ROSS has a gain of 144. Gain must be accurate for appropriate use of Poisson statistics but the gain is generaly not important for the fitting process as the data is normalized by default.points_per_pixelnumber of wavelength points computed in the spectrum per pixel in the data being analyzed, for most cases 1 is sufficient but if the peaks in the data are very narrow then it may be necessary to use a value larger than 1 to ensure the peaks are well resolved in the computed spectrum, due to the scaling behaviour its not recommended to use a value larger than 10 here.ang_res_unitis the number of pixels in an angular resolution unit for ARTSlam_res_unitis the number of pixels in an specular resolution unit for ARTS
Plotting#
These options only alter the plotting of that data and fits; they do not influence the fits. The plotting and fitting ranges are intentionally decoupled in order to allow visualization of data that is not fit.
n_sigmasis the number of standard deviations to plot the uncertainty region overrolling_std_widthnumber of lineouts used to calculate the standard deviation for the moving window error regiondata_cbar_uupper limit for the colorbar in plotting the data and fit; also limits the lineout plots. Can be given as a number of counts or asdatato automatically use the maximum of the datadata_cbar_llower limit for the colorbar in plotting the data and fit; also limits the lineout plots. Can be given as a number of counts or asdatato automatically use the minimum of the dataion_window_startdetermines the spectral range of the IAW fit plots; this gives the lower bound in nmion_window_enddetermines the spectral range of the IAW fit plots; this gives the upper bound in nmele_window_startdetermines the spectral range of the EPW fit plots; this gives the lower bound in nmele_window_enddetermines the spectral range of the EPW fit plots; this gives the upper bound in nmdetailed_breakdownwhen active all lineout plots will show the constituent curves within the fit model. This includes the angle extremes, gradient extremes, IRF, and background.