MIRIAD numbering convention inconsistency

Aperta
#1,700 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
data

Direzione di ricerca

Iniziate da miriad_wrap.pyx, in particolare da GETI, GETJ, MKBL e dal punto di chiamata per l’unpacking del preambolo. Tracciate il percorso di questi valori fino alle classi UVData e UVCal e confrontatene la numerazione con gli input UVFITS generati da MIRIAD e gli input di MirParser. Il lavoro è completo quando la convenzione è definita in modo coerente tra le classi interessate senza compromettere il comportamento MIRIAD esistente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

While working on #1695, I stumbled upon an interesting feature of the MIRIAD reader, which is that the antenna numbers start with zero. Ant 0 is sort of a kludgy thing within MIRIAD because of the mixture of C and Fortran in the code (which are 0- and 1-indexed, respectively), and I was surprised that when reading in an SMA dataset, the antenna numbers were coming out to be 0->7 (when within MIRIAD they are numbered 1->8, matching where they appear elsewhere). Looking around, I stumbled upon this block of code in miriad_wrap.pyx:

cdef inline int GETI(int bl):
  return (bl - 65536) // 2048 - 1 if bl > 65536 else (bl >> 8) - 1

cdef inline int GETJ(int bl):
  return (bl - 65536) % 2048 - 1 if bl > 65536 else (bl & 255) - 1

cdef inline float MKBL(int i, int j):
  return (i + 1) << 8 | (j + 1) if (i + 1 < 256 and j + 1 < 256) else (i + 1) * 2048 + (j + 1 + 65536)

That's being called later when the preamble is being unpacked, which maps antennas to a given baseline:

    i = GETI(<int>preamble[4])
    j = GETJ(<int>preamble[4])

    return (uvw, preamble[3], (i, j)), data, flags, nread

Strictly speaking, this isn't "wrong", but rather a convention choice. But, it does mean that the numbering in MIRIAD is different than how it appears in other datasets, including those that MIRIAD is capable of generating itself (e.g., via the fits function to output UVFITS format). For my specific use case (reading in old MIRIAD gains to match to directly-read MIR files read via MirParser), I can kludge a fix, but it strikes me that it may be worth considering a fix/change that would affect both the UVData and UVCal based classes. Within #1695 I've left the numbering as-is so as to maintain consistency, and I think this is worth fixing, but I know that part of pyuvdata's heritage w/ MIRIAD runs through PAPER, and I don't know if this has the potential to break something that we'd prefer be left alone.

Lingua principale
Python
Stelle
103
Fork
40
Merge medio
4g 11h
PR unite (30g)
13

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di RadioAstronomySoftwareGroup/pyuvdata

Tutte le issue di RadioAstronomySoftwareGroup/pyuvdata

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.