Opened 11 years ago

Closed 11 years ago

#193 closed enhancement (fixed)

Generalise MW masking

Reported by: MatthewWhiting Owned by: MatthewWhiting
Priority: normal Milestone: Release-1.5
Component: Input Version: 1.3.2
Severity: normal Keywords:
Cc:

Description

Rather than the simple way of providing a range of channels to be blanked for the milky way, why not allow the specification of a set of channels that are to be masked.

Something like: maskChannels 76-112,343-345,800-900

So we give a list of channels in the same manner as the objectList parameter that is a comma-separated list of channels and channel ranges.

Would need to change the checks for MWness but that shouldn't be too difficult. Could put into the mask array for v2.0, but could be introduced earlier than this by reusing the MW setup.

Change History (9)

comment:1 Changed 11 years ago by MatthewWhiting

Status: newassigned

As a note, this would allow masking of known bad RFI channels.

comment:2 Changed 11 years ago by MatthewWhiting

Largely OK, as we can reuse the same sort of functions for the object requests (in the reuse case).

One tricky one is replacing the drawMWRange function for the spectral plots. The tricky bit here is twofold:

  • The plotting is done in world coordinate space, not channels
  • We don't have a single range, but potentially many. Need to take the list of channels and create a list of ranges. These can then be treated individually in the same way as we do for the MW currently.

For the latter, the obvious way to do this is to make use of the Object2D - progressively add the flagged channels to an Object2D, then each scan of that object will be a contiguous range of flagged channels. For each of these we get the min & max, transform to world coords, then draw the box.

One additional improvement would be to offset the edges outwards by half a pixel.

comment:3 Changed 11 years ago by MatthewWhiting

[1242] implements a lot of this.

It is still not 100% settled exactly how to manage the flagging. I currently read in a list of channels & channel ranges, then convert to a vector list of individual channels. There are then two options. Basically this needs to be converted to a vector list of true/false values, one for each channel.

  • One option is to use the function getChannelFlags, which takes a number as an argument and returns a vector of that length with each element being true if that channel number is flagged, and false if not.
  • The other is to first calculate this vector at the start, then use isChannelFlagged to get the flag value. Since we don't know at the start how many channels we will deal with, we just create it up to the largest flagged value, and if a channel is given that is bigger than this we return false.

Note that I have decided to assume the following convention - The first channel in the cube is designated channel 0. This wasn't made explicit in the documentation for the MW ranges, but I will do so now.

comment:4 Changed 11 years ago by MatthewWhiting

Scaling of main spectra panels are screwed up.

comment:5 Changed 11 years ago by MatthewWhiting

Fixed [1244].

Now the flagged channel ranges are wrong, being offset so that the high-velocity end is at 0km/s.

comment:6 Changed 11 years ago by MatthewWhiting

Fixed [1245] - was missing a line.

comment:7 Changed 11 years ago by MatthewWhiting

Code fails with segfault when no flagged channels are provided.

comment:8 Changed 11 years ago by MatthewWhiting

Fixed in [1247].

comment:9 Changed 11 years ago by MatthewWhiting

Resolution: fixed
Status: assignedclosed

Seems to all be working well now. Have updated the documentation as well, so can close the ticket.

Note: See TracTickets for help on using tickets.