Microstructure of variable pitch cholesteric films and its relationship with the optical properties