Error analysis of the photometric redshift technique