Opened 14 years ago

Closed 14 years ago

#180 closed defect (worksforme)

masks and flagging

Reported by: G.Fuller@… 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 Changed 14 years ago by Malte Marquarding

Resolution: wontfix
Status: newclosed

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

mask=csp.create_mask([-500,0])
csp.flag(mask=mask_not(mask))

I can't change the meaning as quite a few user scripts depend on the current interpretation.

comment:2 Changed 14 years ago by Malte Marquarding

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 Changed 14 years ago by Malte Marquarding

Gary,

this works for me - it flags everything but [-500,0].

What version of asap are you using?

comment:4 Changed 14 years ago by Malte Marquarding

Resolution: wontfix
Status: closedreopened

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 Changed 14 years ago by Malte Marquarding

Also, please attach to ticket rather than email:

xvals = csp.get_abcissa()[0]
print xvals[0], xvals[-1]

and

print csp

comment:6 Changed 14 years ago by Malte Marquarding

I just checked and the flagging code is identical in both 2.3.1 and trunk.

comment:7 Changed 14 years ago by Malte Marquarding

Resolution: worksforme
Status: reopenedclosed
Note: See TracTickets for help on using tickets.