BenDB3199 / Attitude_from_quaternions

The code takes in quaternions and a timestamp along with TLE data from the OPS-SAT and outputs satellite attitude information like roll, pitch, yaw and angle to nadir.
0 stars 0 forks source link

Use datetime string pattern parsing #1

Closed georgeslabreche closed 3 years ago

georgeslabreche commented 3 years ago

Instead of this: https://github.com/BenDB3199/Attitude_from_quaterions/blob/2652221e4459defa3480e511e178650a9bcacc3f/interpret_TM_short.py#L24-L29

You'll want to use datetime.datetime.strptime. Here's a tutorial: https://stackabuse.com/converting-strings-to-datetime-in-python/

BenDB3199 commented 3 years ago

Used: f_q = open('quaternion.txt', 'r') f_q_line = f_q.read() f_q_line = f_q_line.split() date_time_str = f_q_line[0] + ' ' + f_q_line[1] date_time_obj = datetime.strptime(date_time_str, '%Y-%m-%d %H:%M:%S.%f')