How to handle observational data

Here I introduce how to handle observational data in python.

packages

You need to have the CDF C library and spacepy installed in your environment.
These websites are helpful to install.
https://pythonhosted.org/SpacePy/pycdf.html
https://stackoverflow.com/questions/37232008/how-read-common-data-formatcdf-in-python
http://shinkon-kyoto-ahaha.hatenablog.com/entry/2017/05/25/112338 #Japanse

Read CDF (Common Data Format) file

Information about CDF is here, https://cdf.gsfc.nasa.gov.
You can obtain data from https://cdaweb.sci.gsfc.nasa.gov/index.html/.

An example data here is the data magnetic fields and solarwind parameters from ACE between 21-01-2005 and 22-01-2005.

Check data packed in the CDF file

check the information of the data

If your data is writtein in csv,

convert the cdf format into a panda data frame

Plot data

How to handle missing data values

If you find missing (or unphysical such like '1e30') data values as follows,

Easy way is to replace missing data into "nan" using np.where and np.nan

note: spacepy does not support numpy'fancy indexing'.