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

apply delay self-calibration solutions #1620

Open
Fil8 opened this issue Dec 17, 2024 · 0 comments
Open

apply delay self-calibration solutions #1620

Fil8 opened this issue Dec 17, 2024 · 0 comments
Assignees

Comments

@Fil8
Copy link
Collaborator

Fil8 commented Dec 17, 2024

If delay self-calibration is performed then apply_cubical_gains does not find the correct solutions. This because the keyword matrix_type is overwritten and the correct if clause is not accepted:

here we define the matrix type based on the caracal keyword:

matrix_type = config[key]['gain_matrix_type'][
num - 1 if len(config[key]['gain_matrix_type']) >= num else -1]
# Decide if take diagonal terms into account
if matrix_type == 'Gain2x2':
take_diag_terms = False
else:
take_diag_terms = True
# set the update type correctly
if matrix_type == 'GainDiagPhase':
gupdate = 'phase-diag'
elif matrix_type == 'GainDiagAmp':
gupdate = 'amp-diag'
elif matrix_type == 'GainDiag':
gupdate = 'diag'
elif matrix_type == 'Gain2x2':
gupdate = 'full'
elif matrix_type == 'Fslope':
gupdate = 'phase-diag'

here we overwrite the matrix_type:

# if we have more than one matrix set the matrixtype correctly
if len(jones_chain.split(",")) > 1:
matrix_type = 'Gain2x2'
# Cubical does not at the moment apply the gains when the matrix is not complex2x2 (https://github.com/ratt-ru/CubiCal/issues/324).
# Hence the following fix. This should be removed once the fix makes it into stimela.
matrix_type = 'Gain2x2'
# Does solterm_niter matter for applying?????
solterm_niter = config['cal_cubical']['solterm_niter']
sol_terms_add = []

here we don't make it into the loop:

# Set the table name
if gupdate == 'phase-diag' and matrix_type == 'Fslope':
g_table_name = "{0:s}/{3:s}-g-delay-gains-{1:d}-{2:s}.parmdb:output".format(get_dir_path(prod_path,
pipeline), num, os.path.splitext(fromname)[0], prefix)
elif gupdate == 'phase-diag':
g_table_name = "{0:s}/{3:s}-g-phase-gains-{1:d}-{2:s}.parmdb:output".format(get_dir_path(prod_path,
pipeline), num, os.path.splitext(fromname)[0], prefix)
elif gupdate == 'amp-diag':
g_table_name = "{0:s}/{3:s}-g-amp-gains-{1:d}-{2:s}.parmdb:output".format(get_dir_path(prod_path,
pipeline), num, os.path.splitext(fromname)[0], prefix)
elif gupdate == 'diag':
g_table_name = "{0:s}/{3:s}-g-amp-phase-diag-gains-{1:d}-{2:s}.parmdb:output".format(get_dir_path(prod_path,
pipeline), num, os.path.splitext(fromname)[0], prefix)
elif gupdate == 'full':
g_table_name = "{0:s}/{3:s}-g-amp-phase-full-gains-{1:d}-{2:s}.parmdb:output".format(get_dir_path(prod_path,

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

When branches are created from issues, their pull requests are automatically linked.

2 participants