Skip to content

Indexing of NI vs iteration in wfsc.py #94

@johnekrist

Description

@johnekrist

There might be a Matlab-conversion-induced indexing issue in wfsc.py.

Starting at line 128, things vs iteration are being stored. The latest NI values are being stored in element [Itr+1]:

    out.log10regHist[Itr] = cvar.log10regUsed
    if hasattr(cvar, 'Im') and not mp.ctrl.flagUseModel:
        out.IrawScoreHist[Itr+1] = np.mean(cvar.Im[mp.Fend.score.maskBool])
        out.IrawCorrHist[Itr+1] = np.mean(cvar.Im[mp.Fend.corr.maskBool])
        out.InormHist[Itr+1] = out.IrawCorrHist[Itr+1]

I'm not sure why it is dependent on flagUseModel being non-zero.

However, NI at the current iteration is reported in plot.py, line 45, as [Itr], not [Itr+1]:

    ax1.set_title('Stellar PSF: NI=%.2e' % out.InormHist[Itr])

Also, within wfsc.py, NI change with iteration is reported like so, starting at line 155, out of step with what plot.py is reporting.

if np.abs(out.InormHist[Itr+1]) > np.finfo(float).eps:
print('Prev and New Measured Normalized Intensity:\t\t\t '
'%.2e\t->\t%.2e\t (%.2f x smaller)' %
(out.InormHist[Itr],
out.InormHist[Itr+1],
out.InormHist[Itr]/out.InormHist[Itr+1]))

I think the indexing of the NI arrays needs to change in wfsc.py so that the current iteration values are in [Itr].

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions