or is it entirely the prerogative of the pilot?
Yes, technically totally up to the pilot. But pilot maybe in touch with the airline dispatchers and be under pressure to land at the destination, airlines hate such disruptions as alternate airports, it costs them $$$.