Skip to content

Commit 6c4b5bf

Browse files
committed
Cleanup.
1 parent 014f7f6 commit 6c4b5bf

File tree

3 files changed

+2
-18
lines changed

3 files changed

+2
-18
lines changed

src/direct_optimal_mapping/dom_pspec.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ def set_k_space(self, binning='lin', n_perp=None):
111111
self.ky = np.fft.fftfreq(self.ny, d=self.res_y_mpch)*2*np.pi
112112
self.kz = np.fft.fftfreq(self.nz, d=self.res_z_mpch)*2*np.pi
113113

114-
# self.k_xx, self.k_yy, self.k_zz = np.meshgrid(self.kx, self.ky, self.kz, indexing='ij')
115-
116114
self.k_zz, self.k_xx, self.k_yy = np.meshgrid(self.kz, self.kx, self.ky, indexing='ij')
117115

118116
self.k_perp = np.sqrt(np.average(self.k_xx, axis=0)**2 +
@@ -174,4 +172,4 @@ def calc_ps1d(self, nbin=None, avoid_fg=True):
174172
self.ps1d_nsample = np.array(n_sample)
175173

176174
return
177-
175+

src/direct_optimal_mapping/image_cube_compilation.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,12 @@ def image_cube_calc(self):
3333
map_dic_n6 = pickle.load(f_t)
3434

3535
freq_mhz = float(re.search('_(......)MHz', file_n5_t).group(1))
36-
# idx_t = np.where(freq_mhz == self.syn_sa_dic['freq_mhz'])[0]
37-
# syn_sa = self.syn_sa_dic['sa'][idx_t]
3836
syn_sa = self.sa_interp(freq_mhz)
3937
print(i, freq_mhz, 'MHz', end=',')
4038

4139
# normalization d calculation
4240
d_diag = 1/(map_dic_n5['beam_weight_sum'] * map_dic_n5['px_dic']['sa_sr'].flatten()) # vis -> Jy/beam
4341
d_diag = d_diag/syn_sa # Jy/beam -> Jy/sr
44-
# d_diag = d_diag/map_dic_n5['px_dic']['sa_sr'].flatten() # Jy/beam -> Jy/sr
45-
# print(self.syn_sa_dic['sa'][i], map_dic_n5['px_dic']['sa_sr'])
4642
jysr2mk = 1e-26*const.c**2/2/(1e6*freq_mhz)**2/const.k_B*1e3
4743
d_diag = d_diag * jysr2mk # Jy/sr -> mK
4844

@@ -62,8 +58,6 @@ def image_cube_calc(self):
6258
self.d_diag = np.vstack((self.d_diag, d_diag))
6359
img_cube_n5 = img_cube_n5.squeeze().reshape(((-1, *map_dic_n5['px_dic']['ra_deg'].shape)))
6460
img_cube_n6 = img_cube_n6.squeeze().reshape(((-1, *map_dic_n6['px_dic']['ra_deg'].shape)))
65-
# img_cube_n5 = np.moveaxis(img_cube_n5, 0, -1)
66-
# img_cube_n6 = np.moveaxis(img_cube_n6, 0, -1)
6761

6862
data_dic['data_cube_pol-5'] = img_cube_n5
6963
data_dic['data_cube_pol-6'] = img_cube_n6

src/direct_optimal_mapping/optimal_mapping_radec_grid.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,6 @@ def __init__(self, uv, px_dic, epoch='J2000', feed=None,
114114
height=uv.telescope_location_lat_lon_alt_degrees[2]*u.m)
115115

116116
self.uv = uv
117-
# self.nside = nside
118-
# self.npix = hp.nside2npix(nside)
119117
self.hera_dec = self.uv.telescope_location_lat_lon_alt[0]
120118
self.lsts = np.unique(self.uv.lst_array)
121119
self.times = np.unique(uv.time_array)
@@ -128,9 +126,7 @@ def __init__(self, uv, px_dic, epoch='J2000', feed=None,
128126
self.feed_type = 'vivaldi'
129127
else:
130128
self.feed_type = feed
131-
#print('RA/DEC in the epoch of %s, with %s beam used.'%(self.equinox, self.feed_type))
132129

133-
# theta, phi = hp.pix2ang(nside, range(self.npix))
134130
self.ra = np.radians(px_dic['ra_deg']).flatten()
135131
self.dec = np.radians(px_dic['dec_deg']).flatten()
136132
self.px_sa = px_dic['sa_sr'].flatten()
@@ -174,8 +170,6 @@ def _radec2azalt(self, ra, dec, time):
174170
aa = AltAz(location=self.hera_site, obstime=obs_time)
175171
if self.equinox == 'J2000':
176172
c = SkyCoord(ra=ra, dec=dec, unit='radian', frame=TETE(obstime=self.equinox))
177-
#c = SkyCoord(ra=ra, dec=dec, unit='radian', frame='icrs')
178-
#print('ICRS')
179173
elif self.equinox == 'Current':
180174
c = SkyCoord(ra=ra, dec=dec, unit='radian', frame=TETE(obstime=obs_time))
181175
else:
@@ -215,7 +209,6 @@ def set_pyuvbeam(self, beam_model):
215209
pyuvbeam.read_beamfits(beamfits_file)
216210
pyuvbeam.efield_to_power()
217211
pyuvbeam.select(polarizations=self.uv.polarization_array)
218-
#print(pyuvbeam.polarization_array)
219212
pyuvbeam.peak_normalize()
220213
pyuvbeam.interpolation_function = 'az_za_simple'
221214
pyuvbeam.freq_interp_kind = 'cubic'
@@ -245,8 +238,7 @@ def set_a_mat(self, uvw_sign=1, apply_beam=True):
245238
self.beam_mat = np.zeros(self.phase_mat.shape, dtype='float64')
246239
self.sa_mat = np.zeros(self.phase_mat.shape, dtype='float64')
247240
self.set_pyuvbeam(beam_model=self.feed_type)
248-
# freq_array = np.array([self.frequency,])
249-
freq_array = np.array([169e6,])
241+
freq_array = np.array([self.frequency,])
250242
for time_t in np.unique(self.uv.time_array):
251243
az_t, alt_t = self._radec2azalt(self.ra, self.dec, time_t)
252244
lmn_t = np.array([np.cos(alt_t)*np.sin(az_t),

0 commit comments

Comments
 (0)