{"action":"created","issue":{"url":"https://api.github.com/repos/ska-sa/pyxis/issues/30","labels_url":"https://api.github.com/repos/ska-sa/pyxis/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/ska-sa/pyxis/issues/30/comments","events_url":"https://api.github.com/repos/ska-sa/pyxis/issues/30/events","html_url":"https://github.com/ska-sa/pyxis/issues/30","id":59501687,"number":30,"title":"pybdsm_search in lsm.py does not work in polarized mode","user":{"login":"modhurita","id":3924929,"avatar_url":"https://avatars.githubusercontent.com/u/3924929?v=3","gravatar_id":"","url":"https://api.github.com/users/modhurita","html_url":"https://github.com/modhurita","followers_url":"https://api.github.com/users/modhurita/followers","following_url":"https://api.github.com/users/modhurita/following{/other_user}","gists_url":"https://api.github.com/users/modhurita/gists{/gist_id}","starred_url":"https://api.github.com/users/modhurita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/modhurita/subscriptions","organizations_url":"https://api.github.com/users/modhurita/orgs","repos_url":"https://api.github.com/users/modhurita/repos","events_url":"https://api.github.com/users/modhurita/events{/privacy}","received_events_url":"https://api.github.com/users/modhurita/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-03-02T16:07:49Z","updated_at":"2015-11-02T12:49:50Z","closed_at":null,"body":"I am using a modified version of a section of the 3C147 pipeline to run pybdsm in polarized mode:\r\n\r\n>lsm.pybdsm_search(image='img_$i.fits',thresh_pix=THRESH_PIX[0],thresh_isl=THRESH_ISL[0],select=\"r.gt.30s\",pol=True);\r\n     lsm.tigger_convert(\"${lsm.PYBDSM_OUTPUT} $DESTDIR/$LSMBASE$SUFFIX+pybdsm-apparent_${i}.lsm.html -f\");\r\n\r\nLooking at the help for `pybdsm_search` (and looking at lsm.py), I gathered that all I needed to change to make pybdsm find polarization properties from an all-Stokes image was to set `pol=True` above.\r\n\r\nLooking at the log file, it seems like it does compute polarization properties:\r\n\r\n>--> Opened 'img_0.fits'\r\nImage size .............................. : (512, 512) pixels\r\nNumber of channels ...................... : 1\r\nNumber of Stokes parameters ............. : 4\r\nBeam shape (major, minor, pos angle) .... : (0.0047, 0.00298, 80.8) degrees\r\nFrequency of image ...................... : 1424.500 MHz\r\nNumber of blank pixels .................. : 0 (0.0%)\r\nFlux from sum of (non-blank) pixels ..... : 0.087 Jy\r\n--> Calculating background rms and mean images\r\nDerived rms_box (box size, step size) ... : (65, 22) pixels\r\n--> Variation in rms image significant\r\n--> Using 2D map for background rms\r\n--> Variation in mean image not significant\r\n--> Using constant background mean\r\nMin/max values of background rms map (I)  : (0.00005, 0.00028) Jy/beam\r\nValue of background mean (I) ............ : -0.0 Jy/beam\r\nDerived rms_box (box size, step size) ... : (65, 22) pixels\r\nMin/max values of background rms map (Q)  : (0.00003, 0.00006) Jy/beam\r\nValue of background mean (Q) ............ : -0.0 Jy/beam\r\nDerived rms_box (box size, step size) ... : (65, 22) pixels\r\nMin/max values of background rms map (U)  : (0.00003, 0.00006) Jy/beam\r\nValue of background mean (U) ............ : -0.0 Jy/beam\r\nDerived rms_box (box size, step size) ... : (65, 22) pixels\r\nMin/max values of background rms map (V)  : (0.00003, 0.00005) Jy/beam\r\nValue of background mean (V) ............ : -0.0 Jy/beam\r\n--> Expected 5-sigma-clipped false detection rate < fdr_ratio\r\n--> Using sigma-clipping ('hard') thresholding\r\nMinimum number of pixels per island ..... : 10\r\nNumber of islands found ................. : 4\r\nFitting islands with Gaussians .......... : [=---] 1/4\r\nFitting islands with Gaussians .......... : [===\\] 3/4\r\nFitting islands with Gaussians .......... : [====] 4/4\r\nTotal number of Gaussians fit to image .. : 4\r\nTotal flux density in model ............. : 0.070 Jy\r\n--> Grouping Gaussians into sources\r\nNumber of sources formed from Gaussians   : 4\r\n\r\n>--> Checking PI image for new sources\r\n--> Calculating background rms and mean images\r\nDerived rms_box (box size, step size) ... : (51, 17) pixels\r\n--> Variation in rms image significant\r\n--> Using 2D map for background rms\r\n--> Variation in mean image not significant\r\n--> Using constant background mean\r\nMin/max values of background rms map .... : (0.00002, 0.00005) Jy/beam\r\nValue of background mean ................ : 4e-05 Jy/beam\r\nMinimum number of pixels per island ..... : 10\r\nNumber of islands found ................. : 0\r\n--> Grouping Gaussians into sources\r\nNumber of sources formed from Gaussians   : 0\r\nNew sources found in PI image ........... : 0 (4 total)\r\nCalculating polarisation properties ....  : [=---] 1/4\r\nCalculating polarisation properties ....  : [===\\] 3/4\r\nCalculating polarisation properties ....  : [====] 4/4\r\n2015/03/02 17:32:55 INFO: writing PyBDSM gaul catalog\r\n--> Wrote ASCII file '3C147-CD-LO-spw0-s3_pybdsm.lsm.html.gaul'\r\n\r\nHowever, in the final LSM, Q,U,V are 0. These aren't 0 in the gaul file. It seems like Q,U,V are not getting written properly into the final LSM. \r\n\r\nLocation of the files, on elwood:\r\n\r\nGaul file: `/home/mitra/PrimaryBeamReduction/3C147-CD-LO-spw0-s3_pybdsm.lsm.html.gaul`\r\nFinal LSM: `/home/mitra/PrimaryBeamReduction/reduction-02Mar15/plots-3C147-CD-LO-spw0/3C147-GdB-spw0+pybdsm-apparent_0.lsm.html`\r\nLog file: `/home/mitra/PrimaryBeamReduction/reduction-02Mar15/log-3C147-CD-LO-spw0.txt`"},"comment":{"url":"https://api.github.com/repos/ska-sa/pyxis/issues/comments/153008446","html_url":"https://github.com/ska-sa/pyxis/issues/30#issuecomment-153008446","issue_url":"https://api.github.com/repos/ska-sa/pyxis/issues/30","id":153008446,"user":{"login":"modhurita","id":3924929,"avatar_url":"https://avatars.githubusercontent.com/u/3924929?v=3","gravatar_id":"","url":"https://api.github.com/users/modhurita","html_url":"https://github.com/modhurita","followers_url":"https://api.github.com/users/modhurita/followers","following_url":"https://api.github.com/users/modhurita/following{/other_user}","gists_url":"https://api.github.com/users/modhurita/gists{/gist_id}","starred_url":"https://api.github.com/users/modhurita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/modhurita/subscriptions","organizations_url":"https://api.github.com/users/modhurita/orgs","repos_url":"https://api.github.com/users/modhurita/repos","events_url":"https://api.github.com/users/modhurita/events{/privacy}","received_events_url":"https://api.github.com/users/modhurita/received_events","type":"User","site_admin":false},"created_at":"2015-11-02T12:49:50Z","updated_at":"2015-11-02T12:49:50Z","body":"Which pipeline do you mean? The 3C147 pipeline doesn't perform source extraction on any full-polarization image."}}