.lua script for exporting far field data

User: "mraei047"
Altair Community Member
Updated by mraei047

Hi, 

I am looking for help with extracting the far field data from FEKO and importing it into HyperStudy. I have tweaked the .lua script which was provided in example I-4 in the Example Guide.  
The attached script seems to run without any errors (dummy value is imported into HyperStudy) if I comment out lines 17 and 24 of the attached code. 

Any help is appreciated :)/emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' /> 
 

 

 


Here is the code is plain text: 

 

--
-- Run into POSTFEKO to fetch results and push the scalar values to a HyperStudy .hstp file
--

HstUtl = require 'hst.hstutl'
local app = pf.GetApplication()
local config = app.Models[1].Configurations[1]

-- Get first far field result
local f_field = pf.FarField.GetDataSet( pf.FarField.GetNames()[1] )
 -- get theta values (x-axis) 
local num_frequencies = f_field.Axes[pf.Enums.DataSetAxisEnum.Theta].Count


--local ffdata={}
for findex = 1,num_frequencies do  
ffdata[findex]=f_field[findex].FarFields[1]:Abs()
end

local dummy=1
-- Create the output file
file = HstUtl.NewOutputFile( )
HstUtl.StoreScalarValue( file, 'dummy', dummy)
HstUtl.StoreScalarList( file, 'ffdata', ffdata)
HstUtl.WriteFile( file )
-- End of file

 





 


 

Unable to find an attachment - read this blog

Find more posts tagged with