# NearFieldData

Near field results generated by the Feko Solver.

## Example

app = pf.GetApplication()
app:NewProject()
app:OpenFile(FEKO_HOME..[[/shared/Resources/Automation/startup.fek]])

-- Retrieve the 'NearFieldData' called 'NearFields'

nearFieldData = app.Models[1].Configurations[1].NearFields["NearFields"]

-- Manipulate the near field data. See 'DataSet' for faster and more comprehensive options

dataSet = nearFieldData:GetDataSet(51)
print(dataSet) -- Describes the structure of the data
inspect(dataSet) -- Gives a list of the data set contents

-- Find the x start and end values

xAxis = dataSet.Axes["X"]
xStartValue = xAxis:ValueAt(1)
xEndValue = xAxis:ValueAt(#xAxis)

-- Scale the near field field values

scale = 2
constantZIndex = 1
for freqIndex = 1, #dataSet.Axes["Frequency"] do
for xIndex = 1, #dataSet.Axes["X"] do
for yIndex = 1, #dataSet.Axes["Y"] do
indexedValue = dataSet[freqIndex][xIndex][yIndex][constantZIndex]
indexedValue.EFieldComp1 = indexedValue.EFieldComp1 * scale
indexedValue.EFieldComp2 = indexedValue.EFieldComp2 * scale
indexedValue.EFieldComp3 = indexedValue.EFieldComp3 * scale
end
end
end

-- Store the manipulated data

scaledNearField = dataSet:StoreData(pf.Enums.StoredDataTypeEnum.NearField)

-- Compare the original far field to the manipulated far field



## Inheritance

The NearFieldData object is derived from the ResultData object.

## Property List

Configuration
The result data's solution configuration in the model. (Read only SolutionConfiguration)
DataSetAvailable
Valid result data exist. (Read only boolean)
Label
Type
The object type string. (Read only string)

## Method List

ExportData (filename string, components NearFieldsExportTypeEnum, samples number)
Export the result near field data to the specified *.efe / *.hfe file.
GetDataSet ()
Returns a data set containing the near field values. (Returns a DataSet object.)
GetDataSet (samplePoints number)
Returns a data set containing the near field values. (Returns a DataSet object.)
GetDataSet (startFrequency number, endFrequency number, samplePoints number)
Returns a data set containing the near field values. (Returns a DataSet object.)
Returns a data set containing the media information for the near field. (Returns a DataSet object.)
Returns a data set containing the media information for the near field. (Returns a DataSet object.)
GetMediaDataSet (startFrequency number, endFrequency number, samplePoints number)
Returns a data set containing the media information for the near field. (Returns a DataSet object.)
StoreData ()
Creates a local stored version of the result data. (Returns a ResultData object.)

## Property Details

Configuration
The result data's solution configuration in the model.
Type
SolutionConfiguration
Access
DataSetAvailable
Valid result data exist.
Type
boolean
Access
Label
The object label.
Type
string
Access
Type
The object type string.
Type
string
Access

## Method Details

ExportData (filename string, components NearFieldsExportTypeEnum, samples number)
Export the result near field data to the specified *.efe / *.hfe file.
Input Parameters
filename(string)
The name of the exported data file without its extension.
components(NearFieldsExportTypeEnum)
The components to export specified by the NearFieldsExportTypeEnum, e.g. Both (*.efe and *.hfe), Electric (*.efe) or Magnetic (*.hfe).
samples(number)
The number of samples for continuous data. This value will be ignored if the data is discrete.
Example
app = pf.GetApplication()
app:NewProject()
app:OpenFile(FEKO_HOME..[[/shared/Resources/Automation/startup.fek]])
nearField = app.Models[1].Configurations[1].NearFields[1]

-- Export the near field data to the current working directory

fileName = "temp_nearField"
nearField:ExportData(fileName, pf.Enums.NearFieldsExportTypeEnum.Electric, 51)

GetDataSet ()
Returns a data set containing the near field values.
Return
DataSet
The data set containing the near field values.
GetDataSet (samplePoints number)
Returns a data set containing the near field values.
Input Parameters
samplePoints(number)
The number of sample points used to sample the continuous frequency axis.
Return
DataSet
The data set containing the near field values.
GetDataSet (startFrequency number, endFrequency number, samplePoints number)
Returns a data set containing the near field values.
Input Parameters
startFrequency(number)
The start frequency used to sample the continuous frequency axis.
endFrequency(number)
The end frequency used to sample the continuous frequency axis.
samplePoints(number)
The number of sample points used to sample the continuous frequency axis.
Return
DataSet
The data set containing the near field values.
Returns a data set containing the media information for the near field.
Return
DataSet
The near field media data set.
Example
app = pf.GetApplication()
app:NewProject()
app:OpenFile(FEKO_HOME..[[/shared/Resources/Automation/Example_Expanded.fek]])
nearField = app.Models[1].Configurations[1].NearFields[1]

-- Get and inspect the near field media data

-- get the medium index at a given near field request point

nearFieldData = nearField:GetDataSet()
freqIndex = 1
U, V, N = 12, 17, 1
mediumIndexAtRequestPoint = nearFieldData[freqIndex][U][V][N].MediumIndex

-- use the index to access media properties at the given near field request point


Returns a data set containing the media information for the near field.
Input Parameters
samplePoints(number)
The number of sample points used to sample the continuous frequency axis.
Return
DataSet
The near field media data set.
GetMediaDataSet (startFrequency number, endFrequency number, samplePoints number)
Returns a data set containing the media information for the near field.
Input Parameters
startFrequency(number)
The start frequency used to sample the continuous frequency axis.
endFrequency(number)
The end frequency used to sample the continuous frequency axis.
samplePoints(number)
The number of sample points used to sample the continuous frequency axis.
Return
DataSet
The near field media data set.
StoreData ()
Creates a local stored version of the result data.
Return
ResultData
The new stored data.