There is Hollywood, and then there is real life. On that particular show the data shown was not possible passively in the scenario shown with a non-cooperative target, although naturally it could have been acquired with active means. By passive I mean your platform not transmitting a signal, and only listening, active would be involving a transmission from your platform, like radar.
Sure, Navy ships can get a direction on many different types of emitted signals by passive means. But direction and range, a real position plot, is a different story.
Passive systems:
Passively you can get an instantaneous (meaning as it is right now) direction of arrival from a single stationary platform. Over time you can start to develop a plot of possible location via Target Motion Analysis. If the source of the emitted signal is well understood you can make calculations on range. i.e I am monitoring the surface search radar (or some other emission) of a target, and I know the ERP of that specific model of emitter, I can start to estimate range. So now I have a direction to the target, and a range window that the target can be in, no closer than X, no further than Y.
If I can combine two platforms, say my ship and a drone or helicopter with DF capability, I can get a positional fix. I’ll leave how that might be done to your imagination.
Active systems:
Radar and LIDAR, and combinations of IRST and laser range finders. Of course these can give a 3D fix, but you also must give away your position to do it.
This thread has discussed scanning antennas and Doppler detection (simulated scans), but there is also none moving or simulated movement angle of arrival detection. Systems like TDOA (Time Difference Of Arrival) and PDOA (Phase Difference Of Arrival). Typically the moving antennas and the simulated motion systems are “old school”, while current technology leans more towards non-moving and no simulation of movement.
The ship in the series The Last Ship is a fictional ship, DDG-151, USS Nathan James. The exterior shots of a real US Navy ship, when required, are typically of the USS Halsey, DDG-97, an Arleigh Burke destroyer. Decidedly not “old school”.
Old school RF detection systems (think of it as your cars radar detector, with a Department of Defense budget):
Things like the AN/WLR-1, AN/WLR-8, and AN/WLR-11 used a combination of fixed omni antennas and moving (spinning) antennas. The signals were detected on the omnis (such as AS-1174/1175/66131) and then the systems switched over to the spinning antennas (such as AS-571/616/899) to find direction of arrival. These spinning antennas often were quite bulky, but still spun at 150 to 300 PRM.
New School RF, no moving parts:
Systems like the AN/SLQ-32 (primarily a missile defense system, but also with other RF capabilities) use fixed, none moving, antennas for both omni and DF work. One of the techniques used is a Rotman lens array.
And lets not forget that SONAR is a valid passive tool, although of VERY limited use to a surface ship in port.
T!