e-merlin / eMERLIN_CASA_pipeline

This is CASA eMERLIN pipeline to calibrate data from the e-MERLIN array. Please fork the repository before making any changes and read the Coding Practices page in the wiki. Please add issues with the pipeline in the issues tab.
GNU General Public License v3.0
14 stars 11 forks source link

Checks for resolved phase calibrator #87

Closed jradcliffe5 closed 1 year ago

jradcliffe5 commented 6 years ago

I thought it may be good for the future to have a method to check whether the phase calibrator is resolved and, if so, then the pipeline can perform self-cal in order to derive models and gain accurate phase transfer to the targets.

I think it can be done in two ways. Either use a form of imfit and compare that Peak ~ Integrated or have some sort of function to check that the uv dist vs amp is flat.

jmoldon commented 6 years ago

Hi Jack. Yes, that is an interesting step to implement because the probability of having resolved sources is high, so we should do it. I think there are too many different cases and possibilities: compact core and close jet, a more extended jet, I have also seen cases with some blobs 3-4 arcsec away, or there may be other sources in the field far away from the calibrator (I saw one LIRGI observation with 3+ sources around the phasecal clearly visible in the phases). With so many options it seems difficult to make it automatic and robust. But still I think we can prepare some functions that can be useful for many cases.

I think the base pipeline works in a different regime than the imaging/self-calibration part. Mainly because the base calibration requires few free parameters (apart from manual flagging) than selfcal.

We should start with a very specialized script that only does a selfcalibration round using 4 or 5 user defined parameters: imsize, shortest solint, nterms (or joinchannels), threshold/autothreshold. Maybe then we can define different modes: bright/faint, wide/narrow field that generates the parameters above. With that, we can decide later if we want to include that in the pipeline, as it may work fine for phase calibrators most of the time.

Another thing to decide is if we want to use wsclean. If so, it needs to be a separate script from the pipeline, given the strong requirement.

Later I will copy here a script I have that uses wsclean, does several iterations and a flagdata(mode='rflag') after each a&p self-calibration. It worked fine but the result on an extended bright target was not completely nice. Probably you already have something similar. Let me know if you want to focus on this problem.

jradcliffe5 commented 6 years ago

With so many options it seems difficult to make it automatic and robust. But still I think we can prepare some functions that can be useful for many cases.

I think the main steps I guess would be to firstly check whether there are bright sources near the phase calibrator. I guess we could do a cross check between the VLBA calibrators/ FIRST and NVSS catalogues. Actually AIPS++ used to have a virtual observatory tool but I think that died with AIPS++. I think this should be the first step and then if it passes this step then we can fit to the uv distance plane. Otherwise we will have to image and check that way and use outlier fields on the bright source positions.

I think the base pipeline works in a different regime than the imaging/self-calibration part. Mainly because the base calibration requires few free parameters (apart from manual flagging) than selfcal.

I agree that we should therefore break this into separate parts which include scripts to do all conceivable areas. So we have the basic calibration script, self-calibration & wide-field imaging all separate. Polarisation can be additional to the basic script.

Another thing to decide is if we want to use wsclean. If so, it needs to be a separate script from the pipeline, given the strong requirement.

I think if you have a script then that will be great! We are exploring the idea of using the wsclean image cubes (resulting from their iteration of multi-term multi frequency synthesis) to do the wide band primary beam correction for eMERGE and I'll be more than happy to implement this into your wsclean script once it is ready and tested.

jmoldon commented 6 years ago

Hi Jack. Good plan. For the moment, I implemented a selfcalibration script in branch selfcal. It is preliminary, but it does selfcalibration using wsclean. It uses a single-source MS, and it builds a list of cumulative calibration tables stored as one of those callibs files.

For the moment you need to define a few things at the end of the script, basically the name of the MS. And then decide which steps to perform in the list of selfcal_step. For the imaging, it will use default parameters but you can send different ones in each selfcal_step step, or as a dictionary I called global_args, which will pass any parameter there using **kwargs. Feel free to add or modify anything.

jmoldon commented 1 year ago

This is not completely automatic, but a model of the phase calibrator can be incorporated as an option