34
34
sbr_file = "poc_scat_small"
35
35
q3d_file = "via_gsg"
36
36
eye_diagram = "SimpleChannel"
37
+ array = "array_simple"
37
38
38
39
39
40
class TestClass (BasisTest , object ):
@@ -50,6 +51,7 @@ def setup_class(self):
50
51
self .q3dtest = BasisTest .add_app (self , project_name = q3d_file , application = Q3d )
51
52
self .q2dtest = Q2d (projectname = q3d_file )
52
53
self .eye_test = BasisTest .add_app (self , project_name = eye_diagram , application = Circuit )
54
+ self .array_test = BasisTest .add_app (self , project_name = array )
53
55
54
56
def teardown_class (self ):
55
57
BasisTest .my_teardown (self )
@@ -289,6 +291,7 @@ def test_09_manipulate_report(self):
289
291
if not is_ironpython :
290
292
assert data .plot (is_polar = True )
291
293
assert data .plot_3d ()
294
+ assert self .field_test .post .create_3d_plot (data )
292
295
self .field_test .modeler .create_polyline ([[0 , 0 , 0 ], [0 , 5 , 30 ]], name = "Poly1" , non_model = True )
293
296
variations2 = self .field_test .available_variations .nominal_w_values_dict
294
297
variations2 ["Theta" ] = ["All" ]
@@ -794,13 +797,6 @@ def test_61_export_mesh(self):
794
797
assert os .path .exists (self .q3dtest .export_mesh_stats ("Setup1" , setup_type = "AC RL" ))
795
798
assert os .path .exists (self .aedtapp .export_mesh_stats ("Setup1" ))
796
799
797
- def test_62_delete_variations (self ):
798
- assert self .q3dtest .cleanup_solution ()
799
- vars = self .field_test .available_variations .get_variation_strings ()
800
- assert self .field_test .available_variations .variations ()
801
- assert self .field_test .cleanup_solution (vars , entire_solution = False )
802
- assert self .field_test .cleanup_solution (vars , entire_solution = True )
803
-
804
800
def test_62_eye_diagram (self ):
805
801
self .eye_test .analyze_nominal ()
806
802
rep = self .eye_test .post .reports_by_category .eye_diagram ("AEYEPROBE(OutputEye)" , "QuickEyeAnalysis" )
@@ -890,3 +886,103 @@ def test_70_sweep_from_json(self):
890
886
assert self .aedtapp .post .create_report_from_configuration (
891
887
os .path .join (local_path , "example_models" , "report_json" , "Modal_Report.json" )
892
888
)
889
+
890
+ @pytest .mark .skipif (is_ironpython , reason = "FarFieldSolution not supported by Ironpython" )
891
+ def test_71_antenna_plot (self ):
892
+ ffdata = self .field_test .get_antenna_ffd_solution_data (frequencies = 30e9 , sphere_name = "3D" )
893
+ assert ffdata .plot_farfield_contour (
894
+ qty_str = "RealizedGain" ,
895
+ convert_to_db = True ,
896
+ title = "Contour at {}Hz" .format (ffdata .frequency ),
897
+ export_image_path = os .path .join (self .local_scratch .path , "contour.jpg" ),
898
+ )
899
+ assert os .path .exists (os .path .join (self .local_scratch .path , "contour.jpg" ))
900
+
901
+ ffdata .plot_2d_cut (
902
+ primary_sweep = "theta" ,
903
+ secondary_sweep_value = [- 180 , - 75 , 75 ],
904
+ qty_str = "RealizedGain" ,
905
+ title = "Azimuth at {}Hz" .format (ffdata .frequency ),
906
+ convert_to_db = True ,
907
+ export_image_path = os .path .join (self .local_scratch .path , "2d1.jpg" ),
908
+ )
909
+ assert os .path .exists (os .path .join (self .local_scratch .path , "2d1.jpg" ))
910
+ ffdata .plot_2d_cut (
911
+ primary_sweep = "phi" ,
912
+ secondary_sweep_value = 30 ,
913
+ qty_str = "RealizedGain" ,
914
+ title = "Azimuth at {}Hz" .format (ffdata .frequency ),
915
+ convert_to_db = True ,
916
+ export_image_path = os .path .join (self .local_scratch .path , "2d2.jpg" ),
917
+ )
918
+
919
+ assert os .path .exists (os .path .join (self .local_scratch .path , "2d2.jpg" ))
920
+
921
+ ffdata .polar_plot_3d (
922
+ qty_str = "RealizedGain" ,
923
+ convert_to_db = True ,
924
+ export_image_path = os .path .join (self .local_scratch .path , "3d1.jpg" ),
925
+ )
926
+ assert os .path .exists (os .path .join (self .local_scratch .path , "3d1.jpg" ))
927
+
928
+ ffdata .polar_plot_3d_pyvista (
929
+ qty_str = "RealizedGain" ,
930
+ convert_to_db = True ,
931
+ show = False ,
932
+ export_image_path = os .path .join (self .local_scratch .path , "3d2.jpg" ),
933
+ )
934
+ assert os .path .exists (os .path .join (self .local_scratch .path , "3d2.jpg" ))
935
+
936
+ @pytest .mark .skipif (is_ironpython , reason = "FarFieldSolution not supported by Ironpython" )
937
+ def test_72_antenna_plot (self ):
938
+ ffdata = self .array_test .get_antenna_ffd_solution_data (frequencies = 3.5e9 , sphere_name = "3D" )
939
+ ffdata .frequency = 3.5e9
940
+ assert ffdata .plot_farfield_contour (
941
+ qty_str = "RealizedGain" ,
942
+ convert_to_db = True ,
943
+ title = "Contour at {}Hz" .format (ffdata .frequency ),
944
+ export_image_path = os .path .join (self .local_scratch .path , "contour.jpg" ),
945
+ )
946
+ assert os .path .exists (os .path .join (self .local_scratch .path , "contour.jpg" ))
947
+
948
+ ffdata .plot_2d_cut (
949
+ primary_sweep = "theta" ,
950
+ secondary_sweep_value = [- 180 , - 75 , 75 ],
951
+ qty_str = "RealizedGain" ,
952
+ title = "Azimuth at {}Hz" .format (ffdata .frequency ),
953
+ convert_to_db = True ,
954
+ export_image_path = os .path .join (self .local_scratch .path , "2d1.jpg" ),
955
+ )
956
+ assert os .path .exists (os .path .join (self .local_scratch .path , "2d1.jpg" ))
957
+ ffdata .plot_2d_cut (
958
+ primary_sweep = "phi" ,
959
+ secondary_sweep_value = 30 ,
960
+ qty_str = "RealizedGain" ,
961
+ title = "Azimuth at {}Hz" .format (ffdata .frequency ),
962
+ convert_to_db = True ,
963
+ export_image_path = os .path .join (self .local_scratch .path , "2d2.jpg" ),
964
+ )
965
+
966
+ assert os .path .exists (os .path .join (self .local_scratch .path , "2d2.jpg" ))
967
+
968
+ ffdata .polar_plot_3d (
969
+ qty_str = "RealizedGain" ,
970
+ convert_to_db = True ,
971
+ export_image_path = os .path .join (self .local_scratch .path , "3d1.jpg" ),
972
+ )
973
+ assert os .path .exists (os .path .join (self .local_scratch .path , "3d1.jpg" ))
974
+
975
+ ffdata .polar_plot_3d_pyvista (
976
+ qty_str = "RealizedGain" ,
977
+ convert_to_db = True ,
978
+ show = False ,
979
+ export_image_path = os .path .join (self .local_scratch .path , "3d2.jpg" ),
980
+ )
981
+ assert os .path .exists (os .path .join (self .local_scratch .path , "3d2.jpg" ))
982
+
983
+ def test_z99_delete_variations (self ):
984
+ assert self .q3dtest .cleanup_solution ()
985
+ vars = self .field_test .available_variations .get_variation_strings ()
986
+ assert self .field_test .available_variations .variations ()
987
+ assert self .field_test .cleanup_solution (vars , entire_solution = False )
988
+ assert self .field_test .cleanup_solution (vars , entire_solution = True )
0 commit comments