Spherical doubly warped spacetimes for radiating stars and cosmology