Effects of structural fluctuations on the photonic bandgap during fabrication of a photonic crystal: a study of a photonic crystal with a finite number of periods