ratt-ru / montblanc

GPU-accelerated RIME implementations. An offshoot of the BIRO projects, and one of the foothills of Mt Exaflop.
Other
10 stars 3 forks source link

Predicting from polynomial fit to frequency axis #171

Open landmanbester opened 7 years ago

landmanbester commented 7 years ago

Currently montblanc uses a spectral index model for the frequency axis

I(v) = I(v0)(v/v0)^alpha

In some cases it is preferable to fit a more flexible model. In particular it is not possible to fit in log space when there are negative pixels in the model. In such cases we can still fit a polynomial

I(v) = I_0 + I_1(v/v0) + I_2(v/v0)**2 + ....

to the frequency axis. Alternatively we might want to fit a polynomial in log space

log(I(v)) = I_0 + alpha log(v/v0) + beta log(v/v0)**2 + ....

Can we have a feature which allows montblanc to predict from these models? This is especially relevant for incorporating montblanc into DDFacet.

landmanbester commented 7 years ago

This is also relevant to https://github.com/ska-sa/montblanc/issues/169

landmanbester commented 6 years ago

Just documenting discussion with @sjperkins. We usually want to fit the polynomial in log space for Stokes I and just an ordinary polynomial for Q, U and V. Thus sensible default behaviour would be to use a log-polynomial for I and ordinary polynomial for the rest. There are however cases where we want to allow for negative flux (as is the case when predicting from a DDFacet sky model for example) so we should be able to toggle log-polynomial on or off depending on the use case.

sjperkins commented 6 years ago

The alpha input with shape schema ['nsrc', 'ntime'] would then be renamed to spectral_components and it's shape changed something like ['nsrc','ntime','nspeccomps','nstokes'].

@o-smirnov Is the variation by time necessary -- The original idea was to represent scintillation in the stokes parameters, but I've never been sure if it's necessary in the spectral index expression.

rdeane commented 6 years ago

The spectral index (and stokes parameters) can change fairly rapidly in the EHT case (timescale of minutes to hours). This is an intrinsic source variation which we would like to model in the future, so if this can be incorporated now with not much extra effort, I would be greatly appreciative.

cheers Roger

On 14 November 2017 at 12:18, Simon Perkins notifications@github.com wrote:

The alpha input with shape schema ['nsrc', 'ntime'] would then be renamed to spectral_components and it's shape changed something like ['nsrc','ntime','nspeccomps','nstokes'].

@o-smirnov https://github.com/o-smirnov Is the variation by time necessary -- The original idea was to represent scintillation in the stokes parameters, but I've never been sure if it's necessary in the spectral index expression.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ska-sa/montblanc/issues/171#issuecomment-344211201, or mute the thread https://github.com/notifications/unsubscribe-auth/AD29R8a-63U5FtDwfuv4Zsru7l8wro57ks5s2WjsgaJpZM4KcFpD .

bennahugo commented 6 years ago

I second @landmanbester's request to do polynomial fitting for I. It is necessary if you're working off pixelated models that could contain negatives - if a source falls between pixels it is necessary to to describe it as some sort of sinc function in pixel space.

I also agree that the log expansion needs more terms - some sources are peaked within the observed spectrum and have strong curavature (1934-638 is one such case for instance).

Moreover it is not just one polynomial to describe Q and U behaviour in frequency. There are two taylor expansions needed to describe how the polarization angle varies with frequency and another how fractional polarization varies with frequency. In the a first order these are the polarization angle and polarization fraction at the reference frequency. See also documentation of SetJy here: https://casa.nrao.edu/docs/taskref/setjy-task.html

sjperkins commented 6 years ago

@landmanbester @bennahugo Am I correct in understanding that these expressions are applied to the stokes parameters prior to the construction of the brightness matrix?

bennahugo commented 6 years ago

Yes they make I, Q and U frequency dependent. So the brightness matrix becomes frequency dependent.

sjperkins commented 6 years ago

I'll work this into the dask version