Skip to content

Commit

Permalink
rename impedances to reflect that they are reference values
Browse files Browse the repository at this point in the history
  • Loading branch information
bhazelton authored and adampbeardsley committed Aug 23, 2017
1 parent 5d8a6e8 commit a737ecb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
12 changes: 6 additions & 6 deletions pyuvdata/beamfits.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ def read_beamfits(self, filename, run_check=True,
if 'BANDPARM' in hdunames:
bandpass_hdu = F[hdunames['BANDPARM']]
bandpass_header = bandpass_hdu.header.copy()
self.input_impedence = bandpass_header.pop('inimped', None)
self.output_impedence = bandpass_header.pop('outimped', None)
self.reference_input_impedance = bandpass_header.pop('refzin', None)
self.reference_output_impedance = bandpass_header.pop('refzout', None)

freq_data = bandpass_hdu.data
columns = [c.name for c in freq_data.columns]
Expand Down Expand Up @@ -546,10 +546,10 @@ def write_beamfits(self, filename, run_check=True,
coldefs = fits.ColDefs(col_list)
bandpass_hdu = fits.BinTableHDU.from_columns(coldefs)
bandpass_hdu.header['EXTNAME'] = 'BANDPARM'
if self.input_impedence is not None:
bandpass_hdu.header['inimped'] = self.input_impedence
if self.output_impedence is not None:
bandpass_hdu.header['outimped'] = self.output_impedence
if self.reference_input_impedance is not None:
bandpass_hdu.header['refzin'] = self.reference_input_impedance
if self.reference_output_impedance is not None:
bandpass_hdu.header['refzout'] = self.reference_output_impedance
hdulist.append(bandpass_hdu)

if float(astropy.__version__[0:3]) < 1.3:
Expand Down
8 changes: 4 additions & 4 deletions pyuvdata/tests/test_uvbeam.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ def fill_dummy_beam(beam_obj, beam_type, pixel_coordinate_system):

# add optional parameters for testing purposes
beam_obj.extra_keywords = {'KEY1': 'test_keyword'}
beam_obj.input_impedence = 340.
beam_obj.output_impedence = 50.
beam_obj.reference_input_impedance = 340.
beam_obj.reference_output_impedance = 50.
beam_obj.receiver_temperature_array = np.random.normal(50.0, 5, size=(beam_obj.Nspws, beam_obj.Nfreqs))
beam_obj.loss_array = np.random.normal(50.0, 5, size=(beam_obj.Nspws, beam_obj.Nfreqs))
beam_obj.mismatch_array = np.random.normal(0.0, 1.0, size=(beam_obj.Nspws, beam_obj.Nfreqs))
Expand Down Expand Up @@ -131,7 +131,7 @@ def setUp(self):
'_element_coordinate_system',
'_element_location_array', '_delay_array',
'_gain_array', '_coupling_matrix',
'_input_impedence', '_output_impedence',
'_reference_input_impedance', '_reference_output_impedance',
'_receiver_temperature_array',
'_loss_array', '_mismatch_array',
'_s_parameters']
Expand All @@ -143,7 +143,7 @@ def setUp(self):
'element_coordinate_system',
'element_location_array', 'delay_array',
'gain_array', 'coupling_matrix',
'input_impedence', 'output_impedence',
'reference_input_impedance', 'reference_output_impedance',
'receiver_temperature_array',
'loss_array', 'mismatch_array',
's_parameters']
Expand Down
20 changes: 11 additions & 9 deletions pyuvdata/uvbeam.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,17 @@ def __init__(self):
description=desc, value={},
spoof_val={}, expected_type=dict)

desc = 'Input impedence of receiving chain, units: Ohms'
self._input_impedence = uvp.UVParameter('input_impedence', required=False,
description=desc,
expected_type=np.float, tols=1e-3)

desc = 'Output impedence of receiving chain, units: Ohms'
self._output_impedence = uvp.UVParameter('output_impedence', required=False,
description=desc,
expected_type=np.float, tols=1e-3)
desc = ('Reference input impedance of receiving chain (sets the reference '
'for the S parameters), units: Ohms')
self._reference_input_impedance = uvp.UVParameter('reference_input_impedance', required=False,
description=desc,
expected_type=np.float, tols=1e-3)

desc = ('Reference output impedance of receiving chain (sets the reference '
'for the S parameters), units: Ohms')
self._reference_output_impedance = uvp.UVParameter('reference_output_impedance', required=False,
description=desc,
expected_type=np.float, tols=1e-3)

desc = 'Array of receiver temperatures, shape (Nspws, Nfreqs), units K'
self._receiver_temperature_array = \
Expand Down

0 comments on commit a737ecb

Please sign in to comment.