Git Product home page Git Product logo

pyaedt-toolkits-antenna's Issues

Currugated horn only one mode simulated

๐Ÿ“ Description of the feature

Waveport has only 1 mode

๐Ÿ’ก Steps for implementing the feature

No response

๐Ÿ”— Useful links and references

No response

add a function to create .sarr files

๐Ÿ“ Description of the feature

Hi there,
if you are an oldr user user of SBR then you would know that in the savant times there was very useful MATLAB functions shipped with SAVANT. these functions are still shipped with AEDT despite that SAVANT is sunsetted. the functions can be found under

C:\Program Files\AnsysEM\v242\Win64\Delcross\Savant MATLAB
now many customers do not have MATLAB license so a PyAEDT alternative is very important
one particular useful function is the one to create .sarr file. the MATLAB function is below so a translation is easy

function iok = wr_sarr(fname,arr)
% write an antenna array definition as a Savant .sarr file
%
% Input Params:
% fname (str) output file name
% arr (struct) array data structure
% .f_ghz (Nf x 1 dbl) list of frequencies [GHz]
% (monotonically increasing)
%
% .numEle (int) number of array elements (Ne)
% .numState (int) number of array states (Ns), optional field,
% default = 1
%
% .hasWeight (lgc) ignored, what matters is whether the .weight field
% exists
%
% .pos (Ne x 3 dbl) location of array element [m]
% .xHat (Ne x 3 dbl) local x axis of array element, unit vector
% .yHat (Ne x 3 dbl) local y axis of array element, unit vector
% .weight (Nf x Ns x Ne cplx) element weighting vs. freq vs. state
% OR [unitless]
% (Nf*Ns x Ne cplx) with freqs looping within states
% (Nf x Ne cplx) if single-state
% (Ns x Ne cplx) if single-freq
%
% Careful: Most struct fields expect element index in first (row) dimension,
% but .weight field expects it in last dimension, consistent with
% ld_sarr.m
%
% Returns:
% iok (int) 1 if okay, 0 if failed
%
% iok = wr_sarr(fname,sarr)
%
% COPYRIGHT ANSYS, Inc. ALL RIGHTS RESERVED.

iok = 0;
fid = fopen(fname,'w');
if fid == -1
error('wr_sarr:fileOpen','Could not open output file: %s',fname);
end

fprintf(fid,'# Array Element List (.sarr) file\n');
fprintf(fid,'# Blank lines and lines beginning with pound sign (''#'') are ignored\n');

% Write the has_weights key line
hasWeight = isfield(arr,'weight');
fprintf(fid,'\n');
fprintf(fid,...
'# has_weights flags whether array file includes element weight data.\n');
fprintf(fid,...
'# If not, then array file only specifies element positions and \n');
fprintf(fid,'# orientations.\n');
if hasWeight
fprintf(fid,'has_weights true\n');
else
fprintf(fid,'has_weights false\n');
end

nf = length(arr.f_ghz);
if (is_uniform(arr.f_ghz) || nf == 1)
%
% Write frequency domain as uniform sweep. Single frequency case
% also written as sweep with zero step for consistency with earlier
% implementations of this script.
%
fprintf(fid,'\n');
fprintf(fid,'# freq <start_ghz> <stop_ghz> # nstep = nfreq - 1\n');
fprintf(fid,'freq %f %f %d\n',arr.f_ghz(1),arr.f_ghz(nf),(nf - 1));

else
%
% Write frequency domain as list of non-uniformly spaced frequencies.
%
fprintf(fid,'\n');
fprintf(fid,'# freq_list \n');
fprintf(fid,'freq_list %d\n',nf);
fprintf(fid,'# list of frequencies in GHz, one per line\n');
for ifreq = 1:nf
fprintf(fid,'%f\n',arr.f_ghz(ifreq));
end
end

ns = 1;
nfns = nf;
nelem = arr.numEle;
if isfield(arr,'numState')
ns = arr.numState;
nfns = nf*ns;
end

if (hasWeight)
fprintf(fid,'\n');
fprintf(fid,'# Multi-state arrays can be configured in this file format.\n');
fprintf(fid,...
'# This provides a second dimension in addition to frequency along\n');
fprintf(fid,...
'# which element weights can be varied. Some examples of weight set\n');
fprintf(fid,'# variations:\n');
fprintf(fid,'# - beam steer angle\n');
fprintf(fid,'# - aperture amplitude taper for sidelobe control\n');
fprintf(fid,...
'# - switching sub-arrays on/off by selectively nulling weights\n');
fprintf(fid,'#\n');
fprintf(fid,'# num_states \n');
fprintf(fid,'num_states %d\n',ns);
arr.weight = reshape(arr.weight,nfns,nelem);
end

fprintf(fid,'\n');
fprintf(fid,...
'# The num_elements key line is always the last line of the header.\n');
fprintf(fid,'# It marks the start of the array element data block.\n');
fprintf(fid,'# num_elements \n');
fprintf(fid,'num_elements %d\n',nelem); % this must be last heard key line

fprintf(fid,'\n');
fprintf(fid,'# Element List Data Block\n');
fprintf(fid,'#\n');
fprintf(fid,'# For each of the array elements:\n');
fprintf(fid,...
'# <pos_x> <pos_y> <pos_z> # element position in array coords [m]\n');
fprintf(fid,...
'# <xhat_x> <xhat_y> <xhat_z> # local x-axis of element, unit vector\n');
fprintf(fid,...
'# <yhat_x> <yhat_y> <yhat_z> # local y-axis of element, unit vector\n');
if hasWeight
fprintf(fid,...
'# <wgt_1_rl> <wgt_1_im> # real and imaginary part, unitless\n');
fprintf(fid,'# <wgt_2_rl> <wgt_2_im>\n');
fprintf(fid,'# : :\n');
fprintf(fid,'# <wgt_NfNs_rl> <wgt_NfNs_im>\n');
fprintf(fid,'# Element weights are looped frequency within state.\n');
end

for ielem = 1:nelem
fprintf(fid,'\n');
fprintf(fid,'# Element %d\n',ielem);
fprintf(fid,'%13.7e %13.7e %13.7e\n',arr.pos(ielem,:));
fprintf(fid,'%13.7e %13.7e %13.7e\n',arr.xHat(ielem,:));
fprintf(fid,'%13.7e %13.7e %13.7e\n',arr.yHat(ielem,:));
if hasWeight
for ifs = 1:nfns
weight0 = arr.weight(ifs,ielem);
fprintf(fid,'%13.7e %13.7e\n',real(weight0),imag(weight0));
end
end
end

fclose(fid);
iok = 1;
end % wr_sarr

๐Ÿ’ก Steps for implementing the feature

take the MATLAB file and write a python equivalent
document the file in the API

๐Ÿ”— Useful links and references

No response

Generate antenna with a saved Project is crashing the wizard

๐Ÿ” Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

๐Ÿž Description of the bug

The Generate antenna button only works if the project is not saved.

๐Ÿ“ Steps to reproduce

Run the Antenna wizard

๐Ÿ’ป Which operating system are you using?

Windows

๐Ÿ“€ Which ANSYS version are you using?

No response

๐Ÿ Which Python version are you using?

3.10

๐Ÿ“ฆ Installed packages

All

Fix new modeler PyAEDT class

๐Ÿ” Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

๐Ÿž Description of the bug

PyAEDT changed the modeler class and it affects the toolkit

๐Ÿ“ Steps to reproduce

Run unit tests

๐Ÿ’ป Which operating system are you using?

Windows

๐Ÿ“€ Which ANSYS version are you using?

No response

๐Ÿ Which Python version are you using?

3.8

๐Ÿ“ฆ Installed packages

pyaedt==0.7.4

change default unit to mm instead of cm

๐Ÿ“ Description of the feature

all antenna engineers and manufacturing techinians work with mm. creating models directly in mm instead of cm avoids one extra source of confusion or erros. and it takes the step of changing the unit away

๐Ÿ’ก Steps for implementing the feature

in the code change teh default unit

๐Ÿ”— Useful links and references

No response

Improve documentation style

Description of the modifications

Right now all antennas are together in the same section:
image

I think it would be better to have a type separator (Horn, Patch...)

Useful links and references

No response

Analyze tests are not working in Linux

๐Ÿ” Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

๐Ÿž Description of the bug

Analyze is taking too much time in Linux runner

๐Ÿ“ Steps to reproduce

Run unit tests

๐Ÿ’ป Which operating system are you using?

Linux

๐Ÿ“€ Which ANSYS version are you using?

No response

๐Ÿ Which Python version are you using?

3.10

๐Ÿ“ฆ Installed packages

all

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.