ratt-ru / mt-imager

The Malta Imager -- a GPU-based imager from Daniel Muscat (U. Malta)
GNU General Public License v3.0
1 stars 2 forks source link

need to be able to image a range of channels, and average channels together #6

Open o-smirnov opened 10 years ago

o-smirnov commented 10 years ago

We need to be able to

ddmusc commented 10 years ago

For the second feuture... Frequency and visibilties are averaged and taken as one point or all channels are gridded on the same uv-grid

Regards Daniel Muscat

On 16 Apr 2014, at 14:02, oms-ratt notifications@github.com wrote:

We need to be able to

-

image a subset of channels (e.g. 1:63 meaning channels 1 to 62, or e.g. 0:59:2 meaning every other channel i.e. 0, 2, 4, ... 58.

average channels together. A common use case is to average all channels before gridding (i.e. all channels in the specified subset) and produce a single-frequency FITS file. Another common one is to average every N channels together. Need both options.

— Reply to this email directly or view it on GitHubhttps://github.com/ska-sa/mt-imager/issues/6 .

o-smirnov commented 10 years ago

Eventually, both. The second option (gridding all channels on the same grid) is called MFS (multi-frequency synthesis).

The first option is way simpler to implement I guess and should certainly be tackled first.

ddmusc commented 10 years ago

The second option is more simple believe or not :)...well the two are very simple infact:)

Regards Daniel Muscat

On 16 Apr 2014, at 14:17, oms-ratt notifications@github.com wrote:

Eventually, both. The second option (gridding all channels on the same grid) is called MFS (multi-frequency synthesis).

The first option is way simpler to implement I guess and should certainly be tackled first.

— Reply to this email directly or view it on GitHubhttps://github.com/ska-sa/mt-imager/issues/6#issuecomment-40591783 .

o-smirnov commented 10 years ago

That's what I like to hear. :)

MFS does have its subtleties -- check the literature (and the lwimager/CASA implementation). I think there's some implicit correction by spectral index going on, since (most) sources get fainter with frequency.

ddmusc commented 8 years ago

@o-smirnov, I am working to enable such enhancement but I need ideas to how the configuration format should be I am thinking of using a CASA style syntax such as spw=0:5~10 but notsure if the best way

twillis449 commented 8 years ago

Nothing wrong with CASA syntax for this stuff. In fact if would be nice if you followed CASA syntax where possible for specifications. That way one wouldn't have to remember how to specify the same thing for different imaging programs.

o-smirnov commented 8 years ago

Yeah I agree with @twillis449. The CASA syntax seems fine, no point in breeding new syntaxes. @IanHeywood might have some good ideas too?

ddmusc commented 8 years ago

But how with CASA you say you want to average out two channels together?

o-smirnov commented 8 years ago

I think you either specify the number of channels in the output image, or the averaging "step". You then subdivide whatever channels were selected by the input syntax into that number of output channels. Of course this leaves you with all sorts of boundary cases where the output frequency axis is no longer regular. In these cases I say print a warning and do something reasonable (the FITS standard has something called imageIndex to support this).

twillis449 commented 8 years ago

I may be wrong, but I don't think CASA 'averages' channels together. The default method of imaging is to use MFS, which as far as I'm aware grids each channel at its correct wavelength/frequency in UV space. You specify the range of channels etc that end up in a particular image by specification with the 'spw' keyword.

Since you are modifying things, examples of how things are specified in current CASA-land are shown if you start up casapy and do 'help clean'. After wading through numerous screens of output you eventually get to an 'Example :' section which gives detailed examples of how the CASA user can specify data selection via spw, field, timerange, uvrange, mfs etc etc. etc.

The specification for CLEAN seems to have become incredibly complicated. :(

twillis449 commented 8 years ago

@o-smirnov CASA lets you 'account' for spectral index variations by using Taylor term expansion to model the frequency dependence of sky emission. The default is nterms=1, which means don't model anything.

o-smirnov commented 8 years ago

Yeah sure, my point about an irregular frequency axis was representing that in the FITS file. The normal CRVAL/CRPIX/CDELT way assumes a regular grid. If the user specifies some awkward combination of spectral windows and channel subsets, you may end up needing to produce an irregularly sampled freq axis. Hence imageIndex and all that.

Also, even if CASA doesn't "average" channels together anymore (lwimager still has that mode, one can select either plain averaging or MFS, right?), but in any case that's an orthogonal issue. @ddmusc needs some interface to specify that some number of input channels, across some number of spectral windows, ends up mapped into N output channels. Whether that's done with MFS or some other algorithm internally is a separate issue (Cyril and Andre have various interesting alternative ideas) and should be controlled by separate parameters. The general channel selection interface of "I want to take this subset of the input channels, and I want to produce these output channels" doesn't depend on the algorithm details (I think....)

ddmusc commented 8 years ago

That's my aim... I was thinking the best is use the spw syntax... and use another variable step or channelAdd.. where you define how much selected channels you are to add in one image. If in your definition it comes out that you have an irregular frequency axis then the mt-imager will fail stating the problem.

I believe it is mostly what you are arguing with the exception of irregular axis.. I don't see the advantage of trying to image also in the irregular axis case since the user can just run the imager more than once to get the required behaviour

Goodnight... falling asleep on my chair:)

On Wed, Feb 3, 2016 at 10:28 PM, Oleg Smirnov notifications@github.com wrote:

Yeah sure, my point about an irregular frequency axis was representing that in the FITS file. The normal CRVAL/CRPIX/CDELT way assumes a regular grid. If the user specifies some awkward combination of spectral windows and channel subsets, you may end up needing to produce an irregularly sampled freq axis. Hence imageIndex and all that.

Also, even if CASA doesn't "average" channels together anymore (lwimager still has that mode, one can select either plain averaging or MFS, right?), but in any case that's an orthogonal issue. @ddmusc https://github.com/ddmusc needs some interface to specify that some number of input channels, across some number of spectral windows, ends up mapped into N output channels. Whether that's done with MFS or some other algorithm internally is a separate issue (Cyril and Andre have various interesting alternative ideas) and should be controlled by separate parameters. The general channel selection interface of "I want to take this subset of the input channels, and I want to produce these output channels" doesn't depend on the algorithm details (I think....)

— Reply to this email directly or view it on GitHub https://github.com/ska-sa/mt-imager/issues/6#issuecomment-179479127.

twillis449 commented 8 years ago

The spw keyword lets you specify irregular groups of channels which end up collected into one image via mfs. The spw parameters can be very complicated - see the examples area in 'help clean' that I mentioned above. If you are observing in channel mode, you can specify a 'width' parameter which will allow you to condense down the number of images in your output spectral cube, BUT the stepping intervals still have to be regular - I don't think that FITS has any specifications for irregular steps in CDELT space. As Daniel says I think if you have some weird irregular steps then you have to re-run the imager.

Lucky me - for SKA simulations I only use one channel so I don't need to worry about the problems being discussed here. The mind boggles at the amount if computation that would be required for simulations with more than one channel!