Normalize vectors
- pyspedas.tnormalize(variable, newname=None, return_data=False)[source]
Normalize all the vectors stored in a tplot variable
- Parameters:
variable (
str
ornp.ndarray
) – tplot variable (or numpy array) containing the vectors to be normalizednewname (
str
, optional) – name of the output variable; If not set, output name will be variable + ‘_normalize’ Default: Nonereturn_data (
bool
, optional) – If true, return the normalized vectors instead of creating a tplot variable Default: False
- Returns:
name
ofthe tplot variable created
ornormalized vectors if return_data
is set
Examples
>>> import pytplot >>> pytplot.store_data('a', data={'x':[1, 2, 3], 'y':[[1,2,3],[4,5,6],[7,8,9]]}) >>> pytplot.tnormalize('a') >>> print(pytplot.data_quants['a_normalized'].data)