Skip to content

Commit

Permalink
eidos/
Browse files Browse the repository at this point in the history
  • Loading branch information
ratt-priv-ci committed Dec 23, 2019
1 parent 28a8d0c commit 1d65378
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion eidos/create_beam.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def main(argv):
c, r = int(B.shape[-1]/2), int(args.pixels/2)
if args.pixels%2==0: B = B[...,c-r:c+r,c-r:c+r]
else: B = B[...,c-r:c+r+1,c-r:c+r+1]

print("Cube shape", B.shape)

if args.prefix:
filename = args.prefix
Expand Down
14 changes: 7 additions & 7 deletions eidos/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ def write_fits(beam, freqs, diameter, filename):
if beam.shape[0]==2: xy = ['H', 'V']
elif beam.shape[0]==4: xy = ['Mx', 'My']
else: xy = ['', '']
ctypes = ['px', 'py', 'FREQ', xy[0], xy[1]]
crvals = [0.0, 0.0, fMHz[0], 0, 0, 0]
cdelts = [diam/beam.shape[-2], diam/beam.shape[-1], df, 1, 1]
cunits = ['deg', 'deg', 'Hz', '', '']
ctypes = ['FREQ', xy[0], xy[1], 'px', 'py'][::-1]
crvals = [fMHz[0], 0, 0, 0.0, 0.0][::-1]
cdelts = [df, 1, 1, diam/beam.shape[-2], diam/beam.shape[-1]][::-1]
cunits = ['Hz', '', '', 'deg', 'deg'][::-1]
nx, ny = beam.shape[-2], beam.shape[-1]
if nx%2 == 0: crpixx, crpixy = nx/2, ny/2
elif nx%2 == 1: crpixx, crpixy = int(nx/2), int(ny/2)
crpixs = [crpixx, crpixy, 1, 1, 1]
crpixs = [1, 1, 1, crpixy, crpixx][::-1]
for i in range(len(beam.shape)):
ii = str(i+1)
hdr['CTYPE'+ii] = ctypes[i]
Expand Down Expand Up @@ -112,8 +112,8 @@ def write_fits_eight(data, freqs, diameter, prefix):
for i in range(2):
for j in range(2):
filename = prefix+'_%s%s'%(C[i],C[j])
write_fits_cube(data[i,j,:,:,:].real, freqs, diameter, filename+'_re.fits')
write_fits_cube(data[i,j,:,:,:].imag, freqs, diameter, filename+'_im.fits')
write_fits_cube(data[:,i,j,:,:].real, freqs, diameter, filename+'_re.fits')
write_fits_cube(data[:,i,j,:,:].imag, freqs, diameter, filename+'_im.fits')


def write_fits_single(beam, freqs, diameter, filename):
Expand Down

0 comments on commit 1d65378

Please sign in to comment.