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/

ltgdata__define.pro

Lightning


The implements an object suitable to hold generic lightning data. The data is stored in a dictionary, but can be accessed similar to how you might for an array of structures. There should some performance improvement doing it this way, since the data need not be laid in one memory chunk.

Each entry in the ltgdata object is a different attribute of lightning data (e.g., lat, lon, etc.). The value for each entry is an array.

Since this inherits dictionary, all methods for that object can be used here. The only exception is count. For a dictionary, this will return the number of entries. Here, it will return the number lightning "events" (which corresponds to length of one of the arrays).

There are some restrictions (relative to a dictionary) in how the object can be initialized. You can initialize a null object (no data), an object with a single parameter of an array of keys (not recommended), an object with a single parameter of a structure, or an object or an object with two paramters (entries and values). See https://harrisgeospatial.com/docs/DICTIONARY.html for more info.

See the examples for other differences.

Examples

First, simulate some lightning data:

lats = [34.5, 33.2, 35.1, 35.3] lons = [-86.6, -86.9, -87.4, -88.1] currs = [-35, -10, 20, -5]
This could correspond to four different strokes, as detected by ENTLN or NLDN.

Create a ltgdata object, and add these:

ltg = ltgdata() ltg['lat'] = lats ltg['lon'] = lons ltg['curr'] = currs
We can access the data as you would with any dictionary:
print, ltg.lat print, ltg['lat']
Find the number of lightning "events":
print, ltg.count()
The ltgdata has an overloaded method for the brackets (on the right hand side of an assignment). This allows the user to easily select a subsect of lightning events. For example, to get the first lightning event:
subLtg = ltg[0]
Or the last three:
subLtg = ltg[1:-1]

Author information

Author

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

History

Modification History:

First release: Aug 24, 2017

Class description for ltgData

Inheritance

All ancestor classes: DICTIONARY HASH COLLECTION IDL_OBJECT

Routines

Routines from ltgdata__define.pro

result = ltgData::Count( [/dictionary])

This method will return the number of "sources/events/strokes" for the data.

result = ltgdata::_overloadbracketsrightside(isRange, sub1, sub2)

For this object, we want to be able to return all the keys corresponding to a set of indices.

ltgdata::cleanup
result = ltgdata::init(a1, a2)

Initializes the ltgdata object.

ltgdata__define

Routine details

top ltgData::Count

result = ltgData::Count( [/dictionary])

This method will return the number of "sources/events/strokes" for the data.

Return value

The count of data sources/events/strokes

Keywords

dictionary in optional type=boolean

If set, return the count as determined by the inherited dictionary object

top ltgdata::_overloadbracketsrightside

result = ltgdata::_overloadbracketsrightside(isRange, sub1, sub2)

For this object, we want to be able to return all the keys corresponding to a set of indices. This method overloads the brackets so that you can do so, much like you would for an array of structures.

Return value

An ltgdata object containing just the specified indices, if you provide an index array (or integer). If you provide a string, this is passed to the inherited dictionary object and the entry for that key is returned (if the key is valid).

Parameters

isRange
sub1
sub2

top ltgdata::cleanup

ltgdata::cleanup

top ltgdata::init

result = ltgdata::init(a1, a2)

Initializes the ltgdata object.

Return value

1 on success

Parameters

a1 in required type=varies

This parameter is passed to the dictionary initialization

a2 in required type=varies

This parameter is passed to the dictionary initialization

top ltgdata__define

ltgdata__define

File attributes

Modification date: Thu Aug 24 21:32:44 2017
Lines: 55
Docformat: rst rst