caracal-pipeline / caracal

Containerized Automated Radio Astronomy Calibration (CARACal) pipeline
GNU General Public License v2.0
28 stars 6 forks source link

local rms in wsclean continuum image #571

Closed paoloserra closed 4 years ago

paoloserra commented 5 years ago

In the current master, wsclean continuum imaging is done with local-rms enabled by default.

https://github.com/ska-sa/meerkathi/blob/f240b5cf01282c4be6e2a00965278209203f2463/meerkathi/schema/self_cal_schema-0.2.0.yml#L234-L238

This used to be disabled.

While working on some Mk64-4k data, @edeblok and I noticed that this new default results in no cleaning at all. Such a catastrophic outcome might be specific to the field we are working on. However, our result shows that in the general case wsclean + local-rms might miss real, bright sources that should be cleaned.

I propose to revert to the old default of not using local-rms in wsclean.

KshitijT commented 5 years ago

Yeah, I agree, I never got good results with local_rms and saw exactly the same case for some MeerKAT open time data - the model produced is zero. Funnily enough, it is the transfer_model step which causes the crash when it finds the source list empty, before that there is no indication of anything going wrong. Do we also want to have a check if any deconvolution is happening in a given run at all? As far as the revert is concerned, @dane-kleiner can include it in #558 or I can include it in #570 - I am anyway doing several reverts.

paoloserra commented 5 years ago

Cool, then please include it in whatever PR is coming through next, thanks!

Indeed, we also noticed that after the WSClean run with no cleaning the pipeline keeps going. presumably cubical calibrates with a model column filled with ones?

At some point it might be worth adding some checks (e.g., is _model.fits filled with zeros only?), but I'm not sure I'd give it high priority now.

KshitijT commented 5 years ago

Well, Cubical will just look to the MODEL_DATA column, no? So if one of the runs goes through it'll try to calibrate with that, otherwise like you said. But that sounds a bit dangerous. :/ Hopefully the local_rms revert is enough to ensure this doesn't happen. Speaking of which:

Cool, then please include it in whatever PR is coming through next, thanks!

IanHeywood commented 5 years ago

This is weird, I've been using the local-rms switch with automasking forever and it generally behaves very well.

bennahugo commented 5 years ago

Same here - I also always use it together with my own mask. Could it be the latest version of wsclean has a bug?

On Tue, Aug 20, 2019 at 6:51 PM Ian Heywood notifications@github.com wrote:

This is weird, I've been using the local_rms switch with automasking forever and it generally behaves very well.

— 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/meerkathi/issues/571?email_source=notifications&email_token=AB4RE6UFXTG3Z2SSCSFJHDTQFQOIVA5CNFSM4INXT2PKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4W6FNI#issuecomment-523100853, or mute the thread https://github.com/notifications/unsubscribe-auth/AB4RE6SS36Y3KQEGMCMIYG3QFQOIVANCNFSM4INXT2PA .

--

Benjamin Hugo

PhD. student, Centre for Radio Astronomy Techniques and Technologies Department of Physics and Electronics Rhodes University

Junior software developer Radio Astronomy Research Group South African Radio Astronomy Observatory Black River Business Park Observatory Cape Town

KshitijT commented 5 years ago

Or is it the combination of the high threshold for the automasking combined with local rms? Anyway, I am trying out some experiments with imaging with/without local-rms, with the latest stimela, will post results here.

edeblok commented 5 years ago

I suspect that’s the case. Used high threshold (30 sigma, or whatever the current schema 0.2 default is) which due to higher local rms due to dirty beam sidelobes around strong sources resulted in no sources above 30 “sigma”. Could be that local rms kernel default is not big enough for current defaults. However rerunning without local rms works without issues. Current schema 0.2 defaults has less extreme robust value than were used before, this could also affect impact of sidelobes on local rms.

On Tue, 20 Aug 2019 at 21:09, Kshitij Thorat notifications@github.com wrote:

Or is it the combination of the high threshold for the automasking combined with local rms? Anyway, I am trying out some experiments with imaging with/without local-rms, with the latest stimela, will post results here.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ska-sa/meerkathi/issues/571?email_source=notifications&email_token=AH5OSJ5W2Y2XR7K7FL2VLODQFQ6ORA5CNFSM4INXT2PKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4XLHRQ#issuecomment-523154374, or mute the thread https://github.com/notifications/unsubscribe-auth/AH5OSJ56ZGRWY2AUHKXODHDQFQ6ORANCNFSM4INXT2PA .

IanHeywood commented 5 years ago

30 sigma

You can get away with a much lower threshold than that providing you're using -local-rms. My default setup has -auto-mask 5.0.

dane-kleiner commented 5 years ago

Ok, so should I be changing the defaults in my PR? Or are we leaving it for now?

ratt-priv-ci commented 5 years ago

Thats about the same that I normally use. Mask + 4-5 local_rms + auto_mask. The local_rms is recomputed each major cycle.

On Tue, Aug 20, 2019 at 11:05 PM Ian Heywood notifications@github.com wrote:

30 sigma

You can get away with a much lower threshold than that providing you're using -local-rms. My default setup has -auto-mask 5.0.

— 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/meerkathi/issues/571?email_source=notifications&email_token=AEIVPJQNW362ZTASBKACQHLQFRMDDA5CNFSM4INXT2PKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4XVB5Y#issuecomment-523194615, or mute the thread https://github.com/notifications/unsubscribe-auth/AEIVPJTCVCQAVKE7T7TUFCLQFRMDDANCNFSM4INXT2PA .

--


Benjamin Hugo

Junior Software Developer SARAO Black River Park, 2 Fir Street, Observatory, Cape Town, Western Cape, 7925 Contact: [+27] 0716293858 <+27%2071%20629%203858>

PhD. student, Radio Astronomy Techniques and Technologies, Department of Physics and Electronics, Rhodes University

Skype: benna.cn

paoloserra commented 5 years ago

The defaults in the selfcal schema 0.2.0 need to be changed to either:

  image:
    type: map
    desc: Imaging parameter
    mapping:
      auto_mask:
        seq:
          - type: float 
        desc: Auto masking threshold
        required: false
        example: '30, 10, 7'
      local_rms:
        type: bool
        desc: switch on local rms measurement for cleaning
        required: false
        example: 'False'

or

  image:
    type: map
    desc: Imaging parameter
    mapping:
      auto_mask:
        seq:
          - type: float 
        desc: Auto masking threshold
        required: false
        example: '5'
      local_rms:
        type: bool
        desc: switch on local rms measurement for cleaning
        required: false
        example: 'True'

I think that gradually moving from high towards low thresholds relative to the global rms is easy to understand for a first-time user.

Using a low threshold relative to a local rms (which includes thermal noise, PSF sidelobes and artefacts) might be less clear.

I'm in favour of keeping the default as simple and intuitive as possible so I favour the former option (i.e., no local-rms).

Remember that we'll have several template config files. So this default would be used in the minimal config only, while we could switch on local-rms in template config files for more advanced imaging modes (e.g., dynamic range limited).

KshitijT commented 4 years ago

Done via #570 . Closing issue.