lofar-astron / factor

Facet calibration for LOFAR
http://www.astron.nl/citt/facet-doc
GNU General Public License v2.0
19 stars 12 forks source link

Additional flag before imaging #192

Closed nudomarinero closed 7 years ago

nudomarinero commented 7 years ago

Is there any way to tell factor to ignore one group of 10 subbands or even a complete band (40 subbands) for the imaging? I have one group of 10 subbands with systematical problems in their self-calibration solutions (the data looks OK but it is flanked by two gaps in the frequency coverage and the errors in the self-calibration are clear). I will investigate the origin of the problems but, meanwhile I would like to just ignore the band if that is possible.

rvweeren commented 7 years ago

Could you not simply remove the input MS in "dir_ms" so factor does not include it?

nudomarinero commented 7 years ago

I am working on this. When resuming factor with the removed MS files, the self-cal steps run OK but there is an error in the imaging step. It is like it remembers that some images were processed, try to skip them and then fails. I am trying to manually change the values of the state pickle files to make factor forget.

nudomarinero commented 7 years ago

I was able to make it forget removing the imaging step from the "completed_operations" key of the state files.

The problem now seems to be related to the missing chunk.

2017-02-22 17:57:47 DEBUG   facetimage_facet_patch_594: Pipeline start time: 2017-02-22T17:57:47
2017-02-22 17:57:47 INFO    facetimage_facet_patch_594: LOFAR Pipeline (facetimage_facet_patch_594) starting.
2017-02-22 17:57:47 INFO    facetimage_facet_patch_594: SASID = , MOMID = , Feedback method = None
NYI: validate_steps
2017-02-22 17:57:47 INFO    facetimage_facet_patch_594: Beginning step update_mapfile_hosts
2017-02-22 17:57:47 INFO    facetimage_facet_patch_594: Beginning step create_ms_map
2017-02-22 17:57:47 INFO    facetimage_facet_patch_594: Beginning step create_msmulti_map
2017-02-22 17:57:47 INFO    facetimage_facet_patch_594: Beginning step expand_merged_parmdb_map
2017-02-22 17:57:47 INFO    facetimage_facet_patch_594: Beginning step expand_sourcedb_all_facet_sources
2017-02-22 17:57:47 ERROR   facetimage_facet_patch_594: *******************************************
2017-02-22 17:57:47 ERROR   facetimage_facet_patch_594: Failed pipeline run: facet_patch_594
2017-02-22 17:57:47 ERROR   facetimage_facet_patch_594: Detailed exception information:
2017-02-22 17:57:47 ERROR   facetimage_facet_patch_594: <type 'exceptions.ValueError'>
2017-02-22 17:57:47 ERROR   facetimage_facet_patch_594: PipelineStep_mapfileSingleToGroup: length of /mnt/scratch/data/cal/results/facetselfcal/facet_patch_594/mapfiles/make_sourcedb_new_facet_sources.mapfile and /mnt/scratch/data/cal/results/facetimage/facet_patch_594/mapfiles/input_files_grouped.mapfile differ
2017-02-22 17:57:47 ERROR   facetimage_facet_patch_594: *******************************************
2017-02-22 17:57:47 ERROR   facetimage_facet_patch_594: LOFAR Pipeline finished unsuccesfully.
2017-02-22 17:57:47 WARNING facetimage_facet_patch_594: recipe facetimage_facet_patch_594 completed with errors
nudomarinero commented 7 years ago

Manually editing make_sourcedb_new_facet_sources.mapfile seems to do the trick but I have to check that there are no additional errors entered

nudomarinero commented 7 years ago

Factor runs but the solutions seem to be wrong for the whole 40 sb block so this did not work at the end removing only the bad 10 sub-band block. I will try to remove the whole 40 sb block.

I suppose that the different bands for the final images are generated directly by wsclean. Is the final full bandwidth image a combination of the individual bands in the image plane or does wsclean do something more complex?

darafferty commented 7 years ago

Did you reset the direction (by adding -r facet_patch_594 to the runfactor command) after removing the band? You can also make sure that the state is fully reset by deleting the dir_working/state and the dir_working/results/facetselfcal/facet_patch_594 directories. I suspect somehow there is still some old state left somewhere...

For the full bandwidth image, WSClean does a joint clean across all the channels (so does not combine them in the image plane).

nudomarinero commented 7 years ago

No, I did not reset the direction. I thought that factor may try to rerun the calibration for the direction if I resetted it (?).

One added problem is that, for this block of 40 sb (08, 09, 10, 11), 2 groups of 10 sb were already flagged (09 and 11). The solutions for the group 10 were bad but for group 08 were good. If the solutions are in some sense inter/extrapolated in the self-cal step I suppose that the bad solutions of the group 10 might be affecting the solutions of the group 08. Selfcal took a very long time and would not like to repeat it if possible.

Now I am running WSClean without the whole block but it rearranges the bands in groups of 5:

INFO - factor:facet_patch_594 - Detected a frequency gap of 4 bands; setting wsclean_nchannels_factor to 5 to avoid having a fully flagged WSClean channel

This is good to get a deep image but it is bad to compare intra-band images between different observations of my field given the different configuration of the bands.