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

Should set_analysis report on the "new" filter expression? #1590

Closed
DougBurke opened this issue Sep 22, 2022 · 0 comments · Fixed by #1888
Closed

Should set_analysis report on the "new" filter expression? #1590

DougBurke opened this issue Sep 22, 2022 · 0 comments · Fixed by #1888

Comments

@DougBurke
Copy link
Contributor

DougBurke commented Sep 22, 2022

Once #1562 lands we have

In [1]: from sherpa.astro.ui import *
WARNING: imaging routines will not be available, 
failed to import sherpa.image.ds9_backend due to 
'RuntimeErr: DS9Win unusable: Could not find ds9 on your PATH'
WARNING: failed to import sherpa.astro.xspec; XSPEC models will not be available

In [2]: load_pha("3c273.pi")
WARNING: systematic errors were not found in file '3c273.pi'
statistical errors were found in file '3c273.pi' 
but not used; to use them, re-read with use_errors=True
read ARF file 3c273.arf
read RMF file 3c273.rmf
WARNING: systematic errors were not found in file '3c273_bg.pi'
statistical errors were found in file '3c273_bg.pi' 
but not used; to use them, re-read with use_errors=True
read background file 3c273_bg.pi

In [3]: ignore(hi=0.5)
dataset 1: 0.00146:14.9504 -> 0.5694:14.9504 Energy (keV)

In [4]: ignore(lo=7)
dataset 1: 0.5694:14.9504 -> 0.5694:6.57 Energy (keV)

In [5]: ungroup()

In [6]: get_filter()
Out[6]: '0.569400012493:6.570000171661'

In [7]: notice()
dataset 1: 0.5694:6.57 -> 0.00146:14.9504 Energy (keV)

In [8]: ignore(hi=0.5)
dataset 1: 0.00146:14.9504 -> 0.511:14.9504 Energy (keV)

In [9]: ignore(lo=7)
dataset 1: 0.511:14.9504 -> 0.511:6.9934 Energy (keV)

In [10]: group_counts(20, tabStops=~get_data().get_mask())

In [11]: get_filter()
Out[11]: '0.510999977589:6.993400096893'

In [12]: set_analysis("wave")

In [13]: get_filter()
Out[13]: '1.772874219724:24.263051435945'

In [14]: set_analysis("chan")

In [15]: get_filter()
Out[15]: '36:479'

There is an argument to be made that set_anaysis and the groupXXX commands could report new filters in the same way that notice and ignore now do. Note that groupXXX commands now report the filter as #1637 has landed

We have a similar issue with set_coord, but there it is a bit-more serious, but we recently changed things so the spatial filter gets cleared:

In [16]: clean()

In [17]: load_image("acisf08478_000N001_r0043_regevt3_srcimg.fits")

In [18]: set_coord("physical")

In [19]: notice2d("circle(4324.5,3827.5,430)")
dataset 1: Field() -> Circle(4324.5,3827.5,430)

In [20]: set_coord("logical")
WARNING: Region filter has been removed from 'acisf08478_000N001_r0043_regevt3_srcimg.fits'

This is only for the UI level, not the lower-level Data methods.

hamogu pushed a commit to hamogu/sherpa that referenced this issue Sep 23, 2022
From a numbre of searches, it seems like the

    Tcl_AsyncDelete: async handler deleted by the wrong thread

error "caused" by matplotlib, as it defaults to the TkAgg backend.
If we switch to the Agg backend does this fix the problem?

Note that we currently don't actually test the matplotlib output so
there should be no prioblem in the tests.
DougBurke added a commit to DougBurke/sherpa that referenced this issue Sep 13, 2023
This follows notice/ignore (sherpa#1562) and group_xxx (sherpa#1637) changes
to report the filter for any dataset that set_analysis operates
on. Unfortunately it can't easily use the code used in the previous
PRs since that doesn't support the "analysis units" changing,
which is the main reason for set_analysis! So the code does it
manually, but it's not a lot of code.
DougBurke added a commit to DougBurke/sherpa that referenced this issue Sep 14, 2023
This follows notice/ignore (sherpa#1562) and group_xxx (sherpa#1637) changes
to report the filter for any dataset that set_analysis operates
on. Unfortunately it can't easily use the code used in the previous
PRs since that doesn't support the "analysis units" changing,
which is the main reason for set_analysis! So the code does it
manually, but it's not a lot of code.
wmclaugh added a commit that referenced this issue Sep 14, 2023
…fix #1590

UI: set_analysis reports the filter change - fix #1590
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