Is it wrong to study astrology, as medieval scholars did, as long as it isn't used for occult purposes?
The short answer is "yes." The problem is that there are few practitioners of astrology today who do not also dabble in forbidden practices. Thus it may be dangerous to associate with those who also practice magic and divination in other forms.
Natal astrology is not against the law of God because it does not make any claim to predict the future or to assert that human freedom can be determined by the heavenly bodies. Thus, St. Albert the Great, St. Thomas Aquinas, and St. Alphonsus Ligouri all allow it. St. Alphonsus even says that a horoscope written from the point of view of the minute and location of a person's birth is licit, as long as it does not claim to predict the future but only indicates tendencies found in nature.
The real question is whether or not any of the claims of classical astrology (such as you can find in any copy of the Farmers' Almanac for gardening even today) are borne out by what we know in modern terms scientifically. It is clear from Sacred Scripture that God can and does use the heavenly bodies as signs of his will and his plans for us.
After all, the magi who sought the Lord were astrologers, and the star really did guide them to the Savior. But this star, by its behavior, was clearly not one of the fixed stars that are studied in astrology normally. It was utterly unique, even resting over a particular house in which the Savior was to be found with his Blessed Mother.
These are interesting questions, but we must not let them absorb our attention too much. What is clear is that what modern people regard as outmoded superstition does not necessarily contradict the Faith, and so the faithful are free to consider these things and even to believe in them if they find rational justification in them. There are plenty of people who still plant and harvest looking to the indications in the almanac, and they do not sin in doing so. Good luck to them!