Determination of the crystal field and nature of x-ray linear dichroism for Co-O with local octahedral, tetrahedral, and tetragonal symmetries