After simulating a structure in HFSS or CST I get the radiation pattern in terms of E-field. What I need is to integrate this component so as to computer a factor. Since the E-field is a function of theta,phi the integration should be done in spherical coordinates. The input values are 2 D matrixes representing the values of E-field in terms of theta,phi( E=f(theta,phi)).