Univeristy of Alabama in Huntsville

UAH LTG IDL Library

IDL Routines from Phillip Bitzer and UAH Lightning Group

summary     class     fields     routine details     file attributes

ltg/entln/

pmb_import_entln.pro

Lightning

includes main-level program

This will read in a file containing Earth Networks Total Lightning Network (ENTLN) pulse-level data. The file can be gzipped or not. An array of structures is returned with information about each pulse. See entln_pulse__define for more information regarding the fields returned.

This routine might take a while to work. All lightning detected by ENTLN goes into one file, so there's a LOT of data in each file.

Fair warning: this routine is still in development. Still needs some optimization. I'm not planning to change the fields in the structure, but it *could* happen.

Examples

Pretty straightforward:

file = '/Users/Bitzer/LtgFlashPortions20101025.csv.gz' eni = pmb_import_entln(file)

Author information

Author

Phillip M. Bitzer, University of Alabama in Huntsville, pm.bitzer "AT" uah.edu

History

Modification History:

First written: 20130823 PMB Fixed error when calculating the secPastMidnight 20130823 PMB Fixed errors when setting the date 20131127 PMB Was getting a type conversion error. Fixed. 20131127 PMB Added writing to the new "unix_time" tag 20131127 PMB Added split keyword to split the file by hour 20131202 PMB Added verbose keyword 201312?? PMB Fixed rather signifcant error when reading in time. Basically, I wasn't reading in the full precision. 201312?? PMB Major under the hood change to how the data is read in. These files can get rather large, so we need to chunk the file and read it in. 20131225 PMB Add a keyword to control the size of the chunk. 20140807 PMB "Early" (early 2009) files had an extra field. Added a check for this, and skip it. 20140807 PMB Updated code to use pmb_humantime2unix, available in Misc repo 20140814 PMB Modified read in to only get the first 10 columns - they're the only important ones (according to ENTLN doc) 20140829 PMB

Other file information

Uses:

pmb_is_gz, entln_pulse__define, pmb_humantime2unix

Routines

Routines from pmb_import_entln.pro

result = pmb_import_entln_define_raw_struct(n)

This will define a structure of arrays to hold raw ENTLN data.

result = pmb_import_entln(file [, /Split] [, /Verbose] [, Chunk=long])

Returns an array of structures with ENTLN data.

Routine details

top pmb_import_entln_define_raw_struct

result = pmb_import_entln_define_raw_struct(n)

This will define a structure of arrays to hold raw ENTLN data. Used as a helper routine. AUTHOR NOTE: for speed, use strucutre of arrays, not array of structures

Return value

A structure of arrays, matching the format of the raw ENTLN data format.

Parameters

n in required type=numeric

The number of elements in each array

top pmb_import_entln

result = pmb_import_entln(file [, /Split] [, /Verbose] [, Chunk=long])

Returns an array of structures with ENTLN data.

Return value

An array of structures. See entln_pulse__define

Parameters

file in required type=string

The file name yo wish to read. Can be gzipped or not.

Keywords

Split in optional type=boolean default=0B

DEPRECATED------------------- If set, this will take the file and split it by hours. This is handy as ENTLN files are notoriously large in size. Helps working with files in the future (both in terms of size and speed).

Verbose in optional type=boolean default=0B

If set, informational messages are printed as we proceed through the function.

Chunk in optional type=long default=1000L

Change how much of the file (the chunk size) is read in at once. Might be able to eke out some speed improvement fiddling with this, but the default is pretty darn good.

Other attributes

Uses:

pmb_is_gz, entln_pulse__define, pmb_humantime2unix

File attributes

Modification date: Thu Oct 12 19:01:43 2017
Lines: 88
Docformat: rst rst