RadioAstronomySoftwareGroup / RadioAstronomySoftwareGroup/pyuvdata
read_cst_beam turning negative gain values into positives
Open
@bhazelton is already working on this.
Since Jun 15, 2020.
beams
- Dominant language
- Python
- Stars
- 102
- Forks
- 35
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 14
Description
I am attempting to use the read_cst_beam feature of UVBeam and am running into an odd bug.
Chiropter_NS_PECBico_ff70_YupZnull.txt is a standard CST export file of the directivity/gain of the farfield beam. You'll see that both plots show points around +60dB, but the maximum value of the text file is 1.9. There appears to be some sort of inversion happening at some points.
import os
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import cm,colors,ticker
from pyuvdata import UVBeam
from pyuvdata.data import DATA_PATH
beam = UVBeam()
%matplotlib notebook
CST_txtfile = ['Chiropter_NS_PECBico_ff70_YupZnull.txt']
beam.read_cst_beam(CST_txtfile, beam_type='efield', frequency=[70e6],
telescope_name='Chiropter', feed_name='BicoLOG', feed_version='1.0',
model_name = 'Chiropter_NS_2019', model_version='1.0', feed_pol='y')
plt.figure()
ax1 = plt.subplot(121)
ax1.plot(beam.axis2_array*180/np.pi, beam.data_array[0, 0, 0, 0, :, 0],'.')
ax1.set_xlabel('Zenith Angle / Theta (degrees)')
ax1.set_ylabel('Gain (dB)')
ax1.set_ylim(-80,80)
ax1.set_yticks(np.arange(-80,81,20))
ax2 = plt.subplot(122, sharey=ax1)
ax2.plot(beam.axis1_array*180/np.pi, beam.data_array[0, 0, 0, 0, 0, :],'.')
ax2.set_xlabel('Azimuth Angle / Phi (degrees)')
plt.setp(ax2.get_yticklabels(), visible=False)
plt.subplots_adjust(wspace=0)
raw_data = np.loadtxt('Chiropter_NS_PECBico_ff70_YupZnull.txt',skiprows=2,usecols=(0,1,2))
gain = raw_data[:,2]
print(np.max(gain),np.min(gain))
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.