Terahertz detection and identification of defects in layered polymer composites and composite coatings