Skip to content

Compatibility with GILDAS/NOEMA format #35

Description

@SmirnGreg

Hello @ryanaloomis,

I am trying to use VISIBLE with NOEMA data. We are using GILDAS for data reduction. GILDAS can convert its own uv tables uvt format in multiple styles, including "CASA"-compatible uvfits (I am not sure it actually is...). When I am trying to supply them to VISIBLE.matched_filter, vis_sample crashes in the following places:

  1. delt_freq = dhd['CDELT4']
    npol = dhd['NAXIS3']
    restfreq = freq_start + (mid_chan_freq-1)*delt_freq
    data_VV_raw = np.squeeze(data['data'])
    data_uu = np.squeeze(data['UU'])*restfreq
    data_vv = np.squeeze(data['VV'])*restfreq
    # check for dual polarizations
    if (npol == 2):
    data_real = (data_VV_raw[:,:,0,0] + data_VV_raw[:,:,1,0])/2.
    data_imag = (data_VV_raw[:,:,0,1] + data_VV_raw[:,:,1,1])/2.
    data_wgts = (data_VV_raw[:,:,0,2] + data_VV_raw[:,:,1,2])
    else:
    data_real = data_VV_raw[:,:,0,0]
    data_imag = data_VV_raw[:,:,0,1]
    data_wgts = data_VV_raw[:,:,0,2]

    Here, if npol == 1, line 22 squeezes the data_VV_raw array to an array of rank 3, not 4. Thus in lines 33-35, the second last index should be removed, right?
  2. Then,
    return Visibility(data_VV.T, data_uu, data_vv, data_wgts, freq_start + np.arange(data_VV.shape[1])*dat[1].data['ch width'][0])
    , refers to dat[1].data['ch width']. In the format I have, this is not available. Here are the columns I have in this array:
00 = {tuple: 2} ('ANNAME', '|S8')
01 = {tuple: 3} ('STABXYZ', '>f8', (3,))
02 = {tuple: 3} ('ORBPARM', '>f8', (0,))
03 = {tuple: 2} ('NOSTA', '>i4')
04 = {tuple: 2} ('MNTSTA', '>i4')
05 = {tuple: 2} ('STAXOF', '>f4')
06 = {tuple: 2} ('POLTYA', '|S1')
07 = {tuple: 2} ('POLAA', '>f4')
08 = {tuple: 3} ('POLCALA', '>f4', (2,))
09 = {tuple: 2} ('POLTYB', '|S1')
10 = {tuple: 2} ('POLAB', '>f4')
11 = {tuple: 3} ('POLCALB', '>f4', (2,))
12 = {tuple: 2} ('DIAMETER', '>f4')

Why would not you reuse delt_freq defined above? Overall, this looks strange to me -- freq_start = dhd['CRVAL4'] refers to a value of a mid_chan_freq = dhd['CRPIX4'] channel. Thus the frequencies in Hz should be something like

freqs = (np.arange(dhd['NAXIS4']) + 1 - dhd['CRPIX4']) * dhd['CDELT4'] + dhd['CRVAL4']

But even when I change this, I get other shape mismatch errors later. Could you please help me debug this? I don't exactly see where can I find the expected shapes of the input arrays.

I understand that NOEMA may not be a priority for you, but it is now getting a huge upgrade, especially viable for astrochemistry purposes.

Hoping for a reply,
Greg Smirnov-Pinchukov

==========================
Max Planck Institute for Astronomy
PhD student @ Planet and Star Formation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions