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

Outlier detection ignores masks when in_memory is True #8776

Closed
stscijgbot-jp opened this issue Sep 11, 2024 · 2 comments · Fixed by #8777
Closed

Outlier detection ignores masks when in_memory is True #8776

stscijgbot-jp opened this issue Sep 11, 2024 · 2 comments · Fixed by #8777

Comments

@stscijgbot-jp
Copy link
Collaborator

stscijgbot-jp commented Sep 11, 2024

Issue JP-3743 was created on JIRA by Ned Molter:

The introduction of ModelLibrary (JP-3690) introduced a bug where the drizzled array weights are ignored entirely when the in_memory parameter is set to True.  This can be seen by modifying this unit test as follows, such that it's meaningful with respect to the weights array and weight threshold:

def test_create_median(three_sci_as_asn, tmp_cwd):
"""Test creation of median on disk vs in memory"""
    lib_on_disk = ModelLibrary(three_sci_as_asn, on_disk=True)
    lib_in_memory = ModelLibrary(three_sci_as_asn, on_disk=False)
    # make this test meaningful w.r.t. handling of weights
    with (lib_on_disk, lib_in_memory):
        for lib in [lib_on_disk, lib_in_memory]:
            for model in lib:
                model.wht = np.ones_like(model.data)
                model.wht[4,9] = 0.5
                lib.shelve(model, modify=True)

    median_on_disk = create_median(lib_on_disk, 0.7, on_disk=True)
    median_in_memory = create_median(lib_in_memory, 0.7, on_disk=False)

    assert np.isnan(median_in_memory[4,9])

    # Make sure the median library is the same for on-disk and in-memory
    assert np.allclose(median_on_disk, median_in_memory, equal_nan=True) ```
 
@stscijgbot-jp
Copy link
Collaborator Author

Comment by Ned Molter on JIRA:

Fixed by #8777 

@stscijgbot-jp
Copy link
Collaborator Author

Comment by David Law on JIRA:

Internal issue, closing based on clean regression tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant