Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coarse channel selection is broken #149

Open
d3v-null opened this issue Apr 3, 2024 · 1 comment
Open

coarse channel selection is broken #149

d3v-null opened this issue Apr 3, 2024 · 1 comment

Comments

@d3v-null
Copy link
Collaborator

d3v-null commented Apr 3, 2024

Users might reasonably expect that --sel-chan-ranges should take a range of receiver / sky channel numbers, but instead it takes a selection of coarse channel indices. This is not clearly documented.

It is also not documented whether the ranges are inclusive / exclusive

The documentation also says this, which is wrong.

There is no intention of replicating the following options Birli at this point, so please open an issue if these are important to you:
- Coarse channel selection (-sbcount, -sbstart): This can be done by simply changing which coarse channel files are given in the CLI arguments)

For example, a user processing an observation over receiver channels 109-132 might expect --sel-chan-ranges 120-121 to select two of the middle channels. Instead, the selection fails to find channels with index > 23 and selects all channels!

Birli should error when the selected coarse channels are not found.

Also, when a channel selection is made, the selected channel count is always 24.

Coarse channel details (metafits=24, provided=24, common=24, good=24, select=24, flag=0, ranges=1):
            gpu  corr  rec  cen [MHz]  p  c  g  s  f  range 
      cc0:    1     0  109   139.5200  p  c  g  s     0 (0-1) 
      cc1:    2     1  110   140.8000  p  c  g  s     0 (0-1) 
      cc2:    3     2  111   142.0800  p  c  g  
@d3v-null
Copy link
Collaborator Author

d3v-null commented Apr 4, 2024

another example: selecting a subset of channels causes all channels to be read anyway.

export obsid=1386017864

# selecting only the first channel
birli --sel-chan-ranges 0-0 -u test0.uvfits -m ${obsid}.metafits ${obsid}_2*.fits

  # Coarse channel details (metafits=24, provided=24, common=24, good=24, select=24, flag=0, ranges=1):
  #         gpu  corr  rec  cen [MHz]  p  c  g  s  f  range
  #   cc0:  133     0  133   170.2400  p  c  g  s     0 (0-0)
  #   cc1:  134     1  134   171.5200  p  c  g
  #   cc2:  135     2  135   172.8000  p  c  g

# should be equivalent to above
birli -u test_ch133.uvfits -m ${obsid}.metafits ${obsid}_2*_ch133_*.fits

  # Coarse channel details (metafits=24, provided=1, common=1, good=1, select=1, flag=23, ranges=1):
  #         gpu  corr  rec  cen [MHz]  p  c  g  s  f  range
  #   cc0:  133     0  133   170.2400  p  c  g  s     0 (0-23)
  #   cc1:  134     1  134   171.5200              f  0 (0-23)
  #   cc2:  135     2  135   172.8000              f  0 (0-23)

# selecting only the second channel
birli --sel-chan-ranges 1-1 -u test1.uvfits -m ${obsid}.metafits ${obsid}_2*.fits

  # Coarse channel details (metafits=24, provided=24, common=24, good=24, select=24, flag=0, ranges=1):
  #         gpu  corr  rec  cen [MHz]  p  c  g  s  f  range
  #   cc0:  133     0  133   170.2400  p  c  g
  #   cc1:  134     1  134   171.5200  p  c  g  s     0 (1-1)
  #   cc2:  135     2  135   172.8000  p  c  g

# should be equivalent to above
birli -u test_ch134.uvfits -m ${obsid}.metafits ${obsid}_2*_ch134_*.fits

  # Coarse channel details (metafits=24, provided=1, common=1, good=1, select=1, flag=23, ranges=1):
  #         gpu  corr  rec  cen [MHz]  p  c  g  s  f  range
  #   cc0:  133     0  133   170.2400              f  0 (0-23)
  #   cc1:  134     1  134   171.5200  p  c  g  s     0 (0-23)
  #   cc2:  135     2  135   172.8000              f  0 (0-23)

let's look at the headers

fitsheader test*.uvfits

# HDU 0 in test0.uvfits:
CTYPE4  = 'FREQ    '
CRVAL4  =           184960000.
CDELT4  =               10000.
CRPIX4  =                 1537

# HDU 0 in test_ch133.uvfits:
CTYPE4  = 'FREQ    '
CRVAL4  =           170240000.
CDELT4  =               10000.
CRPIX4  =                   65

# HDU 0 in test1.uvfits:
CTYPE4  = 'FREQ    '
CRVAL4  =           184960000.
CDELT4  =               10000.
CRPIX4  =                 1537

# HDU 0 in test_ch134.uvfits:
CTYPE4  = 'FREQ    '
CRVAL4  =           171520000.
CDELT4  =               10000.
CRPIX4  =                   65

@d3v-null d3v-null changed the title coarse channel selection is not intuitive coarse channel selection is broken Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant