ratt-ru / QuartiCal

CubiCal, but with greater power.
MIT License
7 stars 4 forks source link

One direction had zero phases after DD solve #282

Closed Joshuaalbert closed 10 months ago

Joshuaalbert commented 1 year ago

Describe the bug

I'm getting zero gains for one direction in a DD solve.

Data description (if applicable)

The Sky model is this, and they are placed in two lsm Tigger files, and passed in as part of input (see below)

# (Name, Type, Ra, Dec, I) = format
A, POINT, 00:00:00.00, +37.07.47.400, 1.0
B, POINT, 00:00:00.00, +37.37.47.400, 1.0

To Reproduce


input_ms:
  path: /dsa/output/input.ms
  data_column: DATA
  weight_column: WEIGHT
  time_chunk: 4 # Controls how much RAM is used, can be unit or number per chunk
  freq_chunk: 32 # can be unit or number per chunk, 0 is all

input_model:
  recipe: /dsa/output/skymodel1.lsm.html:/dsa/output/skymodel2.lsm.html

output:
  gain_directory: /dsa/output/gains
  log_directory: /dsa/output/logs
  log_to_terminal: True
  overwrite: True
  flags: True

dask:
  threads: 0 # Setting to zero (the default) will use all available resources.
  scheduler: "threads" # Apparently "threads" is best for single-node use. "multiprocessing" would be the other.

solver:
  terms: [ "G" ]
  iter_recipe: [ 1000 ] # Using a zero would just "interpolate" the solutions into appropriate gains, e.g. G (independent) -> dE (dependent)
  propagate_flags: True
  robust: False # reweight visibilties using residuals (or something) Ask about it.
  threads: 32 # The total number of threads used will be dask.threads*solver.threads; if this product exceeds the number of available threads, performance will suffer.
  reference_antenna: 0 # reference antenna. No gaurantee that it'll be zero.

G:
  type: phase
  direction_dependent: True
  time_interval: "4"
  freq_interval: "32"

Expected behavior Should have non-zero gains for all directions in solve.

Actual Behaviour I get zeros for direction 0, and solutions for direction 1.

I see that the dimension of gains correctly has two directions: Screenshot from 2023-06-21 02-20-39

Version quartical 0.2.0

JSKenyon commented 1 year ago

Hi @Joshuaalbert! I think you have been the victim of a new feature. By default G.pinned_directions is set to [0]. This means that it will not produce solutions in that direction. The reason for this behaviour is that typically calibration will have both a DI component and a DD component and QuartiCal assumes that the zeroth direction corresponds to that DI component. You can specify an empty list to solve in all the directions.

JSKenyon commented 10 months ago

Closing as I believe this is now expected behaviour.