Conditions for condensation and preservation of amorphous ice and crystallinity of astrophysical ices