File: nec_ground.py

package info (click to toggle)
necpp 1.2.4%2Bcvs20060601-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,764 kB
  • ctags: 5,989
  • sloc: cpp: 30,174; ansic: 10,162; fortran: 8,333; python: 2,948; makefile: 186; sh: 1
file content (179 lines) | stat: -rw-r--r-- 5,984 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
#nec_ground.py

#header generated by SWIG

import _PyNEC

def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
    if (name == "this"):
        if isinstance(value, class_type):
            self.__dict__[name] = value.this
            if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
            del value.thisown
            return
    method = class_type.__swig_setmethods__.get(name,None)
    if method: return method(self,value)
    if (not static) or hasattr(self,name) or (name == "thisown"):
        self.__dict__[name] = value
    else:
        raise AttributeError("You cannot add attributes to %s" % self)

def _swig_setattr(self,class_type,name,value):
    return _swig_setattr_nondynamic(self,class_type,name,value,0)

def _swig_getattr(self,class_type,name):
    method = class_type.__swig_getmethods__.get(name,None)
    if method: return method(self)
    raise AttributeError,name

import types
try:
    _object = types.ObjectType
    _newclass = 1
except AttributeError:
    class _object : pass
    _newclass = 0
del types

#end of the header generated by SWIG



import exceptions

#class "nec_ground"

class nec_ground(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, nec_ground, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, nec_ground, name)
    def __repr__(self):
        return "<%s.%s; proxy of C++ nec_ground instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
    def __init__(self, *args):
        _swig_setattr(self, nec_ground, 'this', _PyNEC.new_nec_ground(*args))
        _swig_setattr(self, nec_ground, 'thisown', 1)
	self._ifar=0
    
    
    def get_relative_dielectric_constant(*args):
    	"""
	Returns the relative dielectric constant (no units) of the ground medium 1.
	"""
    	return _PyNEC.nec_ground_get_relative_dielectric_constant(*args)
	
	
    def get_conductivity(*args):
    	"""
	Returns the conductivity in Siemens/meter of the ground medium 1.
	"""
    	return _PyNEC.nec_ground_get_conductivity(*args)
    
    
    def get_radial_wire_count(self,*args):
    	"""
	Returns the number of radial wires in the ground screen approximation, provided it has been used.
	"""
    	_ifar=self._ifar
	if _ifar>3 and _ifar<7 :
    		return _PyNEC.nec_ground_get_radial_wire_count(*args)
	else :
		error_msg="The count of radial wires is not available : there is no radial wire ground screen."
		raise exceptions.Warning(error_msg)


    def get_radial_wire_length(self,*args):
    	"""
	Returns the length of radial wires used in the ground screen approximation - provided this approximation has been used.
	"""		  
    	_ifar=self._ifar
	if _ifar >3 and _ifar<7 :
    		return _PyNEC.nec_ground_get_radial_wire_length(*args)
	else :
		error_msg="The length of radial wires is not available : there is no radial wire ground screen."
		raise exceptions.Warning(error_msg)
		
		
    def get_radial_wire_radius(self,*args):
     	"""
	Returns the radius of radial wires used in the ground screen approximation - provided this approximation has been used.
	"""
	_ifar=self._ifar
	if _ifar >3 and _ifar<7 :
    		return _PyNEC.nec_ground_get_radial_wire_radius(*args)
	else :
		error_msg="The radius of radial wires is not available : there is no radial wire ground screen."
		raise exceptions.Warning(error_msg)
    
    
    def get_cliff_type(self):
    	"""
	Returns the type of cliff provided there's a cliff problem.
	"""
    	_ifar=self._ifar
	if _ifar == 2 or _ifar == 5 :
		return "Linear"
	elif _ifar == 3 or _ifar == 6 :
		return "Circular"
	else :
		error_msg = "Unknown cliff type."
		raise exceptions.Warining(error_msg)
    
    
    def get_cliff_edge_distance(self):
    	"""
	If there's a cliff problem, returns the distance from the origin of the coordinate system to join between medium 1 and 2.
		This distance is either	the radius of the circle where the two media join or the distance from the X axis to where
		the two media join in a line parallel to the Y axis. Specification of the circular or linear option is on the RP card.
	"""
    	_ifar=self._ifar
	if _ifar>1 and _ifar!=4 and _ifar<7 :
		return _PyNEC.nec_ground_get_cliff_edge_distance(self)
	else :
		error_msg = "The edge distance of the cliff is not available : there is no cliff."
		raise exceptions.Warning(error_msg)
		
		
    def get_cliff_height(self):
    	"""
	If there's a cliff problem, returns the distance (positive or zero) by which the surface of medium 2 is below medium 1.
	"""
    	_ifar=self._ifar
	if _ifar>1 and _ifar!=4 and _ifar<7 :
		return _PyNEC.nec_ground_get_cliff_height(self)
	else :
		error_msg = "The height of the cliff is not available : there is no cliff."
		raise exceptions.Warning(error_msg)
		
		
    def get_relative_dielectric_constant2(self):
    	"""
	If there's a cliff problem, returns the relative dielectric constant (no units) of the ground medium 2.
	"""	
	_ifar=self._ifar
	if _ifar>1 and _ifar!=4 and _ifar<7 :
		return _PyNEC.nec_ground_get_relative_dielectric_constant2(self)
	else :
		error_msg = "The relative dielectric constant of medium 2 is not available : there is no cliff."
		raise exceptions.Warning(error_msg)
	
		
    def get_conductivity2(self):
    	"""
	If there's a cliff problem, returns the conductivity in Siemens/meter of the ground medium 2.
	"""
    	_ifar=self._ifar
	if _ifar>1 and _ifar!=4 and _ifar<7 :
		return _PyNEC.nec_ground_get_conductivity2(self)
	else :
		error_msg = "The conductivity of medium 2 is not available : there is no cliff."
		raise exceptions.Warning(error_msg)
		
    

class nec_groundPtr(nec_ground):
    def __init__(self, this):
        _swig_setattr(self, nec_ground, 'this', this)
        if not hasattr(self,"thisown"): _swig_setattr(self, nec_ground, 'thisown', 0)
        _swig_setattr(self, nec_ground,self.__class__,nec_ground)
_PyNEC.nec_ground_swigregister(nec_groundPtr)