That was invented during WWII. It was called "counter-battery radar."
Early versions didn't work that well, but they were steadily improved.
The AN/MPQ-4 was a counter-battery radar that worked pretty well. It was used in Vietnam.
I haven’t learned how to address multiple accounts. Sorry.
Counterbattery stuff works. In another life I’d come back as a red-leg rather than grunt but that is another story. The deployed version in the late 70s was nice. It got better.
What I, as an engineer before going in, was familiar with, worked quite well for purely gravity ballistic incoming rounds. The system back-calculated launch position and gave the info to FDC (fire direction control) Incoming stuff that steers via GPS, etc would give the old systems headaches.
Memory says some 4.2” mortar units had the FDC capability.