mhardcastle / ddf-pipeline

LOFAR pipeline using killms/ddfacet
GNU General Public License v2.0
23 stars 19 forks source link

Improve Panstarrs cross matching #351

Open twshimwell opened 2 weeks ago

twshimwell commented 2 weeks ago

In offsets.py we attempt to match with Panstarrs to derive offsets per facet after removing extended sources from the LOFAR catalogues.

Current filtering in master branch is very crude (filter=(lofar['E_RA']3600.0)<2.0, filter&=(lofar['E_DEC']3600.0)<2.0, filter&=(lofar['Maj']*3600.0)<20). At low declinations and low galactic lattitude this filtering removes far too many LOFAR sources and the cross matching with Panstarrs doesnt work very well as a result.

In offsets_compact branch ive tweaked the filtering so that it corrects for radial smearing before finding an envelope to separate compact from extended sources (see attached plots - saved as "radial-correction.png" and "fitted-skew-envelope.png" in offsets.py). This leaves far more sources for cross matching compared to the old approach.

Screenshot 2024-06-14 at 11 29 44

Screenshot 2024-06-14 at 11 30 05

twshimwell commented 1 week ago

I tested this new offsets criteria for about 1,400 fields. For each field I ran offsets.py 3 times. Once with the old criteria, again with the new one and finally with simply using all sources in the facet for the panstarrs cross match.

The histogram below shows the derived astrometric error from offsets.py for these 3 different types. Here its clear the old version does the worst (so fewer facets with low astrometry errors) and that the new criteria does the best (the most facets with small astrometric errors) and does very slightly better than simply using all sources which is nice.

So I think this new criteria is all ready to go.

Screenshot 2024-06-24 at 14 54 18

mhardcastle commented 1 week ago

Hurray! Will leave this open till we merge the new branch with master.

mhardcastle commented 1 week ago

PS the code breaks Python 2 compatibility thanks to using a later version of scipy than Py2 supports, but I think we can live with that at this point.

mhardcastle commented 1 week ago

Adding here the possible issue with RA/Dec offsets around the north pole to be looked into before we can close this out.

mhardcastle commented 6 days ago

So I think the correct way to deal with this is:

twshimwell commented 6 days ago

That sounds good. I'm guessing this would also need for offsets.py to be rerun after code changes. Not much of an issue because the expensive bit was the pybdsf step which I dont think will need repeating.

mhardcastle commented 6 days ago

Yes that's right, will require changes to offsets.py .

For the immediate work I'll need a copy of the pybdsf catalogues for each field where you have them.