Opened 15 years ago
Closed 15 years ago
#180 closed defect (worksforme)
masks and flagging
Reported by: | Owned by: | Malte Marquarding | |
---|---|---|---|
Priority: | high | Milestone: | ASAP 3.0 |
Component: | General | Version: | |
Severity: | major | Keywords: | |
Cc: |
Description
I'm trying to use a mask to flag out all of a spectrum except the region around a line at -250 km/s. So I do this
csp.set_unit("km/s")
plotter.plot(csp) - show a spectrum from -2500 to +500 km/s
mask=csp.create_mask([-500,0])
-- get back message The current mask window unit is km/s - Good
csp.flag(mask=cmask)
plotter.plot(csp) - the spectrum now runs from -2500 km/s to -500 km/s - Not what I expected or want.
Interestingly if I do this instead:
cmask=csp.create_mask([-500,0],invert=True)
csp.flag(mask=cmask)
plotter.plot(csp)
-- now the spectrum is apparently flagged - Definitely not what I expected or want.
Gary
Change History (7)
comment:1 by , 15 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 by , 15 years ago
Hi Malte,
But
mask=csp.create_mask([-500,0]) csp.flag(mask=mask_not(mask))
does the same thing. It flags the whole spectrum.
Gary
comment:3 by , 15 years ago
Gary,
this works for me - it flags everything but [-500,0].
What version of asap are you using?
comment:4 by , 15 years ago
Resolution: | wontfix |
---|---|
Status: | closed → reopened |
Can you give me the details of your setup (version numbers etc)
python, matplotlib, ipython, numpy, casacore.
Also the output of
csp.get_mask(0)[:10]
comment:5 by , 15 years ago
Also, please attach to ticket rather than email:
xvals = csp.get_abcissa()[0] print xvals[0], xvals[-1]
and
print csp
comment:6 by , 15 years ago
I just checked and the flagging code is identical in both 2.3.1 and trunk.
comment:7 by , 15 years ago
Resolution: | → worksforme |
---|---|
Status: | reopened → closed |
Hi Gary,
a mask defines a region of interest - 'true' for the stuff you want to use. So when you use the flag method you tell it where to flag by defining a region of interest (where the mask is true). The mask/flag interpretation has been discussed at various times before and the decision (not by me) was to stick with the current system.
so I would just use what you have done or
I can't change the meaning as quite a few user scripts depend on the current interpretation.