pysat / pysatCDF

Python reader for NASA CDF file format
BSD 3-Clause "New" or "Revised" License
10 stars 7 forks source link

No CDF Epoch #1

Closed mattkjames7 closed 8 years ago

mattkjames7 commented 8 years ago

Hi, I have been experimenting with pysatCDF, which can successfully read the data that I am trying to look at. The only problem I have is that there is no "epoch" entry in the cdf.data dict. There is definitely an epoch in the file as it is listed in the metadata, not to mention that I can get the epoch values using IDL (yuck!). Is there something that I am missing? Cheers, Matt.

rstoneback commented 8 years ago

Hi Matt,

Thanks for checking out pysatCDF. My guess is the epoch variable is of type EPOCH16, which isn’t supported yet. I’ll get it fixed up. Is the CDF file you are loading available publicly so I can check it out?

Cheers, Russell

On Mar 11, 2016, at 6:06 AM, mattkjames7 notifications@github.com wrote:

Hi, I have been experimenting with pysatCDF, which can successfully read the data that I am trying to look at. The only problem I have is that there is no "epoch" entry in the cdf.data dict. There is definitely an epoch in the file as it is listed in the metadata, not to mention that I can get the epoch values using IDL (yuck!). Is there something that I am missing? Cheers, Matt.

— Reply to this email directly or view it on GitHub.

mattkjames7 commented 8 years ago

Hi Russell, Thanks for the quick reply! The CDF files I am using are publicly available here. Cheers, Matt.

rstoneback commented 8 years ago

Hi Matt,

I’ve pushed some code to the repo that should fix things up.

When re-running 'python setup.py install' if it doesn’t re-compile the Fortran clear out the build directory.

Cheers, Russell

import pysatCDF dd = pysatCDF.CDF('rbspa_efw-l3_20120919_v01.cdf')

dd.data['epoch'] Out[5]: array(['2012-09-18T19:00:20.472515072-0500', '2012-09-18T19:00:26.771920896-0500', '2012-09-18T19:00:33.071325952-0500', ..., '2012-09-19T18:58:34.048406016-0500', '2012-09-19T18:58:41.560549888-0500', '2012-09-19T18:58:49.072690944-0500'], dtype='datetime64[ns]')

On Mar 11, 2016, at 10:20 AM, mattkjames7 notifications@github.com wrote:

Hi Russell, Thanks for the quick reply! The CDF files I am using are publicly available here. Cheers, Matt.

— Reply to this email directly or view it on GitHub.

mattkjames7 commented 8 years ago

Brilliant, thank you so much for that! It's a great help!