Open bennahugo opened 4 years ago
I was hoping to write the fft routines for lsms first to get a feel for how things stick together in the package, placing components onto a uniformly sampled grid enough to encompass the entire lsm field, and then degrid into multiple facets with my geometric routines, but will need help with this before continuing
Can you paste your command line please?
"configurations": [
{
"name": "Quartical launch (python)",
"type": "python",
"request": "launch",
"program": "/home/hugo/workspace/venv3/bin/goquartical",
"args": ["--input-ms-name", "/home/hugo/workspace/msdir/1491291289.1ghz.1.1ghz.4hrs.ms",
"--input-ms-column", "DATA",
"--input-ms-weight-column", "UNITY",
"--input-ms-time-chunk", "300s",
"--input-ms-freq-chunk", "0",
"--output-visibility-product", "predicted_model",
"--output-column", "MODEL_OUT",
"--solver-gain-terms", "G",
"--parallel-nthread", "8",
"--parallel-scheduler", "threads",
"--G-type", "complex",
"--G-time-interval", "4",
"--G-freq-interval", "0",
//"--input-model-recipe", "/home/hugo/workspace/DEEP2_tagged.lsm.html+~/home/hugo/workspace/DEEP2_tagged.lsm.html@dE:/home/hugo/workspace/DEEP2_tagged.lsm.html@dE",
"--input-model-recipe", "/home/hugo/workspace/DEEP2_tagged.lsm.html",
"--flags-write-out", "False"],
"console": "integratedTerminal",
"env": {"PYTHONPATH": "${workspaceFolder}",
"PATH":"${workspaceFolder}/../venv3/bin"},
"pythonPath": "/home/hugo/workspace/venv3/bin/python",
"cwd": "${workspaceFolder}/.."
}
Data does not have cross correlations btw. Not sure if this is the problem though
Was about to say, I think that might be it. How big is the dataset? If you can make it available to me I can take a look on Monday.
About 1.1G. I can put it on the ftp
Note: there aren't any delta scale components in the lsm though
Confirmed. You can replicate the bug for a dataset generated using
simms -dir "J2000,04h13m20.0s,-80d00m00s" -T meerkat -dt 16 -st 0.5 -sl 0.16667 -nc 512 -f0 856MHz -df 1044.9215kHz -pl XX YY -n mk64.0.5hr.10min.scan.16s.1045Mhz.deep2.ms
but not for a full polarimetric dataset generated using
simms -dir "J2000,04h13m20.0s,-80d00m00s" -T meerkat -dt 16 -st 0.5 -sl 0.16667 -nc 512 -f0 856MHz -df 1044.9215kHz -pl XX XY YX YY -n mk64.0.5hr.10min.scan.16s.1045Mhz.deep2.ms
I will continue with full polarimetric datasets for now as I'm only interested in building the prediction system.
I think one has to first pad the data up to full resolution to be able to apply jones matricies? At least I suspect that things are going wrong in https://github.com/JSKenyon/QuartiCal/blob/master/quartical/data_handling/predict.py#L647 As far as I can see it returns a shape of dimension 5 when 4 correlations are available and a shape 4 when 2 correlations are used
Digging into this a little - this is currently failing due to P-jones construction, which is likely my fault. Shouldn't be too difficult to fix. Will keep you updated.
It is a bit weird though as I said - even for a diagonal matrix one cannot simply express it as two elements: what if one is calibrating the leakages or crosshand phase using only the crosshands (ie. the ms only has XY and YX - this is quite possible to have), or even more generic one only has RR / XX / LL / YY. This needs to be put in the correct place in a 2x2 matrix in order to apply the correct corruption? I think that this really does need to be in a 2x2 form for further gains to be applied correctly.
Not necessarily. I already work with a flat correlation axis during calibration. The important point is how to consistently predict the correct values given differing numbers of correlations in the MS. The user may want to predict/calibrate with fewer correlations than are in the MS. This is sort of non-trivial in the predict layer. The easiest approach would be to always predict four correlations and then select out, but I worry that it is wasteful.
Ok, as long as those elements make it into the correct indexes in that flat array. To be honest though the way codex handles 4 correlation predict doesn't really make sense as it stands. The Q and U terms really needs a much higher order polynomial / RM column to actually predict as it is far more structured than just a spectral index. So one could restrict this to I only for now and broadcast - no functionality will be lost in the process.
I'm only planning to support stokes I for now in the fft predict and broadcast it into the correlations matrix.
I think I will wait for @sjperkins to be available and then we can discuss it in detail. My understanding of things like feed rotation fall down a bit when we look at two correlation data.
As a more general comment, I think I need to make sure that two correlation data is consistently handled throughout the predict. I think it is unreliable at the moment, largely as a result of me having copied a slew of code from codex, without necessarily adapting it perfectly.
To add to that one would predict it as follows:
V = K(HA) \outer (I(nu) . (|P| . e^{i . 2(RM.\lambda^{2} + p)}))
where p is the EVPA (0.5 arctan(U/Q)
) and RM is given in rad / m^2
and P is the fractional polarization (-1 < |P| < 1, P := U + iQ
). K is the scalar Muller term describing the baseline delay in the direction of the source. This entire term is time-invariant, so one does not actually use the DFT to predict I, Q, U and V. One only predicts I and then infer Q, U and V from that. V is also a time and frequency invariant fraction. One never does a 4 correlation predict from a fitted catalog!
The only time when it becomes time-variant is when one applies the sky rotation P term onto it.
One can additionally add a Taylor polynomial (NOT log polynomal) to describe any depolarization of the source over really wide bandwidths.
The DFT is currently the most expensive thing in the entire calibration, so you can cut your runtime by 4x @JSKenyon
Ok Isee the K term is computed once in cubical. However the note on the rest of the terms remain valid to describe the full polarimetric response
Note that this should definitely be less broken than it once was, but I am going to leave this open until such time as we figure out precisely what we want to do in the polarised case. Thanks again @bennahugo for all your contributions here.
With fixes applied for #31 (spi set to [0,0,0,0] and reffreq set to 0.0) for flat spectrum prediction. I get
One direction independent gain is being solved for (works when specifying MODEL_DATA)
Only have_coh and have_dies are true
Expected sizes are not the same, which is why the check is failing
Now I'm quite stuck as I'm not sure what this routine is actually supposed to be checking.