deeplycloudy / xlma-python

A future, Python-based version of xlma?
MIT License
6 stars 6 forks source link

Pandas-based NLDN reader #4

Open deeplycloudy opened 5 years ago

deeplycloudy commented 5 years ago

Related to #2, here's a NLDN reader:

def read_nldn(format='stroke_ICCG'):
    """ Draft function for reading NLDN data with Pandas"""
    import pandas as pd
    if format='stroke_ICCG':
        col_names = ['datepart', 'timepart', 'lat', 'lon', 
                     'peak_current', 'ICCG']
    nldn = pd.read_csv('../NLDN_stroke_and_cloud_dN4KG.txt', sep='\s+', 
                        header=None, parse_dates={'time':[0,1]},
                        names=col_names)
    return nldn
deeplycloudy commented 4 years ago

And here's one for the combined/merged NLDN+GLD360 data available to select members of the GLM validation team.

import pandas as pd
nldn_file = '/archive/GLM/gld360/gld360enldnns_20181113_13Z.raw'
nldn = pd.read_csv(nldn_file, sep='\s+', header=None,
                   parse_dates={'time':[0,1]}, names=['datepart', 'timepart', 'lat', 'lon', 
                                                      'peak_current', 'current_unit',
                                                      'multiplicity', 'majorax', 'minorax',
                                                      'axratio', 'angle', 'chi2', 'number',
                                                      'ICCG'])