var query = new ResultQuery(); ///////////////////////Get Theta and Phi Gain/////////////// query.projectId = App.getActiveProject().getProjectDirectory(); query.simulationId = "000062"; query.runId = "Run0001"; query.sensorType = ResultQuery.FarZoneSensor; query.sensorId = "Far Zone Sensor"; query.timeDependence = ResultQuery.SteadyState; query.resultType = ResultQuery.Gain; query.fieldScatter = ResultQuery.TotalField; query.resultComponent = ResultQuery.Theta; query.dataTransform = ResultQuery.NoTransform; query.complexPart = ResultQuery.NotComplex; query.surfaceInterpolationResolution = ResultQuery.NoInterpolation; query.setDimensionRange( "Frequency", 0, -1 ); query.setDimensionRange( "Theta", 0, -1 ); query.setDimensionRange( "Phi", 0, -1 ); var thdata = new ResultDataSet( "" ); thdata.setQuery( query ); if( !thdata.isValid() ){ Output.println( "1getCurrentDataSet() : " + thdata.getReasonWhyInvalid() ); } query.resultComponent = ResultQuery.Phi; var phdata = new ResultDataSet(""); phdata.setQuery(query); if( !phdata.isValid() ){ Output.println( "2getCurrentDataSet() : " + phdata.getReasonWhyInvalid() ); } /////////////////Get Theta and Phi Phase/////////////////////////////////// query.resultType = ResultQuery.E; query.fieldScatter = ResultQuery.TotalField; query.resultComponent = ResultQuery.Theta; query.dataTransform = ResultQuery.NoTransform; query.complexPart = ResultQuery.Phase; query.surfaceInterpolationResolution = ResultQuery.NoInterpolation; query.setDimensionRange( "Frequency", 0, -1 ); query.setDimensionRange( "Theta", 0, -1 ); query.setDimensionRange( "Phi", 0, -1 ); var thphase = new ResultDataSet(""); thphase.setQuery(query); if( !thphase.isValid() ){ Output.println( "3getCurrentDataSet() : " + thphase.getReasonWhyInvalid() ); } query.resultComponent = ResultQuery.Phi; query.ComplexPart = ResultQuery.Phase; var phphase = new ResultDataSet(""); phphase.setQuery(query); if( !phphase.isValid() ){ Output.println( "4getCurrentDataSet() : " + phphase.getReasonWhyInvalid() ); } /////////////////Get Input Power/////////////////////////// query.sensorType = ResultQuery.System; query.sensorId = "System"; query.timeDependence = ResultQuery.SteadyState; query.resultType = ResultQuery.NetInputPower; query.fieldScatter = ResultQuery.NoFieldScatter; query.resultComponent = ResultQuery.Scalar; query.dataTransform = ResultQuery.NoTransform; query.complexPart = ResultQuery.NotComplex; query.surfaceInterpolationResolution = ResultQuery.NoInterpolation; query.clearDimensions(); query.setDimensionRange("Frequency",0,-1); var inputpower = new ResultDataSet(""); inputpower.setQuery(query); if( !inputpower.isValid() ){ Output.println( "5getCurrentDataSet() : " + inputpower.getReasonWhyInvalid() ); } FarZoneUtils.exportToUANFile(thdata,thphase,phdata,phphase,inputpower,"/users/PAS0654/osu8742/Evolved_Dipole/data/1.uan");