Script - Create Dataset
This script illustrates how the INIRC 88 safety standards and NRPB 89 safety standards are added as a dataset that allows you to plot the threshold values on a graph.
-- Create a dataset containing the standards formulae for reference standards = pf.DataSet.New() standards.Axes:Add( pf.Enums.DataSetAxisEnum.Frequency, pf.Enums.FrequencyUnitEnum.Hz, 400e6, 1.5e9 ,21 ) standards.Quantities:Add( "E_inirc88",pf.Enums.DataSetQuantityTypeEnum.Scalar,"V/m") standards.Quantities:Add( "E_nrpb89",pf.Enums.DataSetQuantityTypeEnum.Scalar,"V/m") standards.Quantities:Add( "H_inirc88",pf.Enums.DataSetQuantityTypeEnum.Scalar,"A/m") standards.Quantities:Add( "H_nrpb89",pf.Enums.DataSetQuantityTypeEnum.Scalar,"A/m") for freqIndex = 1,standards.Axes[pf.Enums.DataSetAxisEnum.Frequency].Count do local freqHz = standards[freqIndex]:AxisValue(pf.Enums.DataSetAxisEnum.Frequency) local freqMHz = freqHz/1e6 -- frequency in MHz local freqGHz = freqHz/1e9 -- frequency in GHz local standardsPt = standards[freqIndex] -- Electric field limits standardsPt.E_inirc88 = 3*math.sqrt(freqMHz) standardsPt.E_nrpb89 = 97.1*math.sqrt(freqGHz) -- Magnetic field limits standardsPt.H_inirc88 = 0.008*math.sqrt(freqMHz) standardsPt.H_nrpb89 = 0.258*math.sqrt(freqGHz) end return standards