Python Forum
Time class with picosecond precision - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: Time class with picosecond precision (/thread-28034.html)



Time class with picosecond precision - marcocod - Jul-02-2020

I'm looking for a class that is able to represent the time with the picosecond precision. I found the class numpy.datetime64 that can have this precision but the time span is only 212 days and I need at least 100 years. I could make my own class with a date that represent the year-month-day and an int for the picoseconds but, if available, I prefer to use something already done.
Thanks in advance for the help


RE: Time class with picosecond precision - Larz60+ - Jul-02-2020

curious what you will be using this for.


RE: Time class with picosecond precision - marcocod - Jul-02-2020

For a sar data simulator, the satellite orbit file contains dates saved as string with the picoseconds precision
I'd like to preserve this precision inside the class that represents the orbit


RE: Time class with picosecond precision - Larz60+ - Jul-02-2020

wouldn't it be possible to represent the time in years + months + picoseconds to get around the numpy.datetime64 limitation?


RE: Time class with picosecond precision - marcocod - Jul-02-2020

Yes, it's a possibility
I'm new to python and I don't know very well the python libraries, I asked because I thought maybe this kind of class already exists somewhere


RE: Time class with picosecond precision - Larz60+ - Jul-03-2020

you can find most libraries here: https://pypi.org/
Most if not all can be installed simply from command line with pip install package name
Please note the order by pull-down top right, if you highlight trending, you can find the most popular packages.