# UAH LTG IDL Library

## Index

### A

ats/modis/ directory

A collection of Moderate Resolution Imaging Spectroradiometer (MODIS) routines.

ats509/ directory

A collection of routines used for ATS509 at UAH.

ats606/ directory

A collection of routines used for ATS606, Data Analysis for Atmospheric Scientists at UAH.

ats606_chi2_example routine in ats606_chi2_example.pro

Provide the code for the chi squared example in ATS606.

ats606_chi2_example.pro .pro file in ats606/ directory

This routine illustrates how to find the best fit parameters via $\chi^2$ minimization.

ats_binomial_example routine in ats_binomial_example.pro

Calculate and plot the binomial distribution.

ats_binomial_example.pro .pro file in ats606/ directory

This routine plots a binomial distribution for a given number of trials N and probability of success p.

ats_bump_axis routine in ats_bump_axis.pro

Given a plot (or other graphic), move one of the axes.

ats_bump_axis.pro .pro file in ats509/ directory

This routine will move one of the axes of a plot (or image, etc) a given amount.

ats_ch4_inset.pro .pro file in ats509/ directory

This script will run the commands that are discussed in the Arrays chapter of the class notes in ATS509.

The main routine that finds the pressures/temperatures corresponding to a dry adiabat.

ats_dry_adiabat.pro .pro file in ats509/ directory

This returns an array of temperatures or pressures that correspond to a dry adiabat curve.

ats_import_armor_nc routine in ats_import_armor_nc.pro

This function will get the variable(s) of interest from a NetCDF file of gridded radar data from ARMOR.

ats_import_armor_nc.pro .pro file in ats509/ directory

This routine will, given a file, return the specified radar variable in an a dictionary.

ats_import_armor_nc_get_var routine in ats_import_armor_nc.pro

This is a helper routine that gets an individual variable from a list of variable names in the NetCDF file.

ats_mc_integrate_example routine in ats_mc_integrate_example.pro

This estimates the integral of the normal distribution betwen the given limits.

ats_mc_integrate_example.pro .pro file in ats606/ directory

In ATS606, we discuss how to integrate a function that is not analytically integrable.

ats_mcmc class
ats_mcmc::AcceptStep routine in ats_mcmc__define.pro

This method decides whether or not to accept the cnadidate link in the chain, based on the passed likelihood and the likelihood at the previous step.

ats_mcmc::CalcModelData routine in ats_mcmc__define.pro

Given the passed parameters, go calculate the model data.

ats_mcmc::cleanup routine in ats_mcmc__define.pro

Cleanup the object.

ats_mcmc::GetLikelihood routine in ats_mcmc__define.pro

Given some model data, calcluate the likelihood.

ats_mcmc::GetPrior routine in ats_mcmc__define.pro

This returns the probability of parameters using the prior distribution.

ats_mcmc::GetProposal routine in ats_mcmc__define.pro

Get a set of proposal candidates for (ideally) the next step in the chain.

ats_mcmc::GetStats routine in ats_mcmc__define.pro

This method will get some rundimentary statistics about the chain.

ats_mcmc::GetVars routine in ats_mcmc__define.pro

This method "gets" properties of the object.

ats_mcmc::init routine in ats_mcmc__define.pro

Initializes the ATS_MCMC object.

ats_mcmc::PlotChains routine in ats_mcmc__define.pro

This method will plot a "time" series of the chain for each parameter and the likelihood (well, $\chi^2$).

ats_mcmc::PlotFit routine in ats_mcmc__define.pro

This method will plot the data provided and the "best fit" parameters to the model.

ats_mcmc::PlotHistos routine in ats_mcmc__define.pro

This method will produce a histogram of the PDF for each parameter, using the thinned chain.

ats_mcmc::step routine in ats_mcmc__define.pro

The method makes one "step" (or link) in the MCMC.

ats_mcmc::stepAll routine in ats_mcmc__define.pro

This method will step through the rest of the MCMC, from wherever you are now.

ats_mcmc::thinChainInd routine in ats_mcmc__define.pro

This method will go get the indices of a chain that should effectively "thin" the chain.

ats_mcmc__define routine in ats_mcmc__define.pro

Define the ATS_MCMC object.

ats_mcmc__define.pro .pro file in ats606/ directory

This object can be used to estimate the PDFs of parameters that best fit a model using the Markov Chain Monte Carlo (MCMC) method.

ats_mcmc_model_linear routine in ats_mcmc__define.pro

This provides an (internal) example of how the model function should be defined.

ats_mcmc_model_quadratic routine in ats_mcmc__define.pro

This provides an(other) (internal) example of how the model function should be defined.

ats_plot_sounding routine in ats_plot_sounding.pro

Main routine that, given arrays of temperature and pressure, produces a basic plot.

ats_plot_sounding.pro .pro file in ats509/ directory

Given an array of temperatures and pressures, produce a simple temperature profile.

ats_plot_sounding_freezing routine in ats_plot_sounding.pro

Helper routine to plot the freezing level as a horizontal line.

ats_plot_sounding_isobars routine in ats_plot_sounding.pro

Helper routine to plot isobars.

This routine returns the colors and levels for the desired radar variable.

ats_radar_palette.pro .pro file in ats509/ directory

This routine will return appropriate colors and levels for various radar variables.

ats_random_walk routine in ats_random_walk.pro

This will return an array of n+1 locations based on a 1d random walk.

ats_random_walk.pro .pro file in ats606/ directory

A simple one dimensional random walk is an example of a Markov Chain.

### C

convert_tai93_to_unix routine in convert_tai93_to_unix.pro
convert_tai93_to_unix.pro .pro file in lis/ directory

AUTHOR: Veronica Franklin

### E

entln_pulse class
entln_pulse__define routine in entln_pulse__define.pro

Define the structure for a ENTLN pulse.

entln_pulse__define.pro .pro file in ltg/entln/ directory

Define a structure to be used with ENTLN pulse data.

ess_ch4_hw_contour routine in ess_ch4_hw_contour.pro
ess_ch4_hw_contour.pro .pro file in ats509/ directory

This function serves as template from which you tackle one of the homework problems in Chapter 4 of the ATS/ESS 409/509 notes.

ess_get_lma_initiation routine in ess_get_lma_initiation.pro

Given an array of source times and the flash number each sources belongs to, find the initiation source for each flash.

ess_get_lma_initiation.pro .pro file in ats509/ directory

When working with LMA data, you might need to get the initation source of each flash in a time period.

ess_import_lma_flash routine in ess_import_lma_flash.pro

Main routine to import LMA data processed by XLMA into flashes.

ess_import_lma_flash.pro .pro file in ats509/ directory

Given an LMA file which has flash information, this routine reads all the sources as an array of structures.

ess_ingest_ch3_stream routine in ess_ingest_ch3_stream.pro

This routine is used as a wrapper for the commands in Chapter 3 of the ATS509 notes.

ess_ingest_ch3_stream.pro .pro file in ats509/ directory

This file is an example of how to interpet a data stream (here, represented by two bytes) into different values.

ess_lcl_script.pro .pro file in ats509/ directory

In the Structures chapter in ATS/ESS 509, we write a script to find the LCL of a given sounding.

ess_plot_modis routine in ess_plot_modis.pro

Create an image from bands from MODIS.

ess_plot_modis.pro .pro file in ats509/ directory

Working file to get a plot of MODIS data, given three bands that represent the RGB values.

ess_plot_modis_scale routine in ess_plot_modis.pro

This helper routine will do scaling of an array for you and perform histogram equalization.

This function returns data from a MODIS swath (level 1b) file.

ess_read_modis1b.pro .pro file in ats509/ directory

Given a file of level 1B MODIS data (aka, swath data), this function will read the bands and return them in an array of [n, m, nBands].

This routine reads in a test HAMMA file, and returns an array of structures with the data in the file.

ess_read_test_hamma.pro .pro file in ats509/ directory

This file will take a set of "test" HAMMA data and read it in.

ess_test1_q1 routine in ess_test1_q1.pro
ess_test1_q1.pro .pro file in ats509/ directory

### G

glmdata class
glmdata::_eventVariables routine in glmdata__define.pro
glmdata::_groupVariables routine in glmdata__define.pro
glmdata::_ncScale routine in glmdata__define.pro
glmdata::_ncVarAtt routine in glmdata__define.pro
glmdata::_ncVarEventLFCA routine in glmdata__define.pro
glmdata::_ncVarEventLM routine in glmdata__define.pro
glmdata::_ncVarGroupLFCA routine in glmdata__define.pro
glmdata::_ncVarGroupLM routine in glmdata__define.pro
glmdata::_readEventFields routine in glmdata__define.pro
glmdata::_readGroupFields routine in glmdata__define.pro
glmdata::_writeData routine in glmdata__define.pro
glmdata::cleanup routine in glmdata__define.pro
glmdata::convertLFCATime routine in glmdata__convertlfcatime.pro
glmdata::convertTimeToUnix routine in glmdata__converttimetounix.pro
glmdata::eventCount routine in glmdata__define.pro
glmdata::getChildEvents routine in glmdata__getchildevents.pro
glmdata::getEvents routine in glmdata__getevents.pro
glmdata::getGroups routine in glmdata__getgroups.pro
glmdata::groupCount routine in glmdata__define.pro
glmdata::HasEvents routine in glmdata__define.pro
glmdata::HasGroups routine in glmdata__define.pro
glmdata::init routine in glmdata__define.pro
glmdata::loadFile routine in glmdata__define.pro
glmdata::slice routine in glmdata__define.pro
glmdata__convertlfcatime.pro .pro file in ltg/glm/utilities/ directory
glmdata__converttimetounix.pro .pro file in ltg/glm/utilities/ directory
glmdata__define routine in glmdata__define.pro
glmdata__define.pro .pro file in ltg/glm/ directory
glmdata__getchildevents.pro .pro file in ltg/glm/child_getters/ directory
glmdata__getevents.pro .pro file in ltg/glm/data_getters/ directory
glmdata__getgroups.pro .pro file in ltg/glm/data_getters/ directory
GRAPHIC class
GRAPHIC::bumpaxis routine in graphic__bumpaxis.pro

"Bump" the axis of a graphic by a given amount (in normalized coordinates).

Graphic::VisNames routine in graphic__visnames.pro

Return a Hash of the visualization elements in a graphic.

graphic__bumpaxis.pro .pro file in misc/plotting/ directory

Sometimes, we need to change the position of a graphic (e.g., plot, image, etc.).

graphic__visnames.pro .pro file in misc/plotting/ directory

When dealing with Function Graphics, it's handy to know what visualization elements are in a graphic.

### H

hamma/deprecated/ directory
hamma_convert_hdr_v10 routine in hamma_convert_hdr_v10.pro

Given the raw header data, convert it to the "standard" header

hamma_convert_hdr_v10.pro .pro file in hamma/deprecated/header_conversions/ directory
hamma_convert_hdr_v11 routine in hamma_convert_hdr_v11.pro

Given the raw header data, convert it to the "standard" header

hamma_convert_hdr_v11.pro .pro file in hamma/deprecated/header_conversions/ directory
hamma_convert_hdr_v15 routine in hamma_convert_hdr_v15.pro

Given the raw header data, convert it to the "standard" header

hamma_convert_hdr_v15.pro .pro file in hamma/deprecated/header_conversions/ directory
hamma_convert_hdr_v20 routine in hamma_convert_hdr_v20.pro

Given the raw header data, convert it to the "standard" header

hamma_convert_hdr_v20.pro .pro file in hamma/header_conversions/ directory
hamma_open_file routine in hamma_open_file.pro
hamma_open_file.pro .pro file in hamma/deprecated/ directory

NAME:

hamma_sync_patterns routine in hamma_sync_patterns.pro

Return an array of structures of sync patterns and corresponding version numbers.

hamma_sync_patterns.pro .pro file in hamma/deprecated/ directory

A simple function that returns the possible sync patterns for different versions of HAMMA.

header__define.pro .pro file in hamma/deprecated/ directory

### L

lis/ directory

A collection of Lightning Imaging Sensor (LIS) routines.

This function will check the LIS alert flags and return a one if no alerts are present, zero if not.

lis_check_alert.pro .pro file in lis/ directory

Every second, LIS data contains information about the spacecraft and instrument.

Define a color scale for the radiance.

lis_get_colors_radiance.pro .pro file in lis/ directory
ltg/ directory

A collection of routines for working with various lightning data sets.

ltg/entln/ directory

A collection of routined used with Earth Networks Total Lightning Network data.

ltg/glm/ directory
ltg/glm/child_getters/ directory
ltg/glm/data_getters/ directory
ltg/glm/utilities/ directory
ltg/lma/ directory

A collection of Lightning Mapping Array (LMA) routines.

ltg/nldn/ directory

A collection of National Lightning Detection Network (NLDN) routines.

ltg/wwlln/ directory

A collection of World Wide Lightning Detection Network (WWLLN) routines.

ltgData class
ltgdata::_overloadbracketsrightside routine in ltgdata__define.pro

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

ltgdata::cleanup routine in ltgdata__define.pro
ltgData::Count routine in ltgdata__define.pro

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

ltgdata::init routine in ltgdata__define.pro

Initializes the ltgdata object.

ltgdata__define routine in ltgdata__define.pro
ltgdata__define.pro .pro file in ltg/ directory

The implements an object suitable to hold generic lightning data.

### M

mapprojection class
mapprojection::pmbgrid routine in mapprojection__pmbgrid.pro

Deletes the current mapgrid associated with a map and adds a new one.

mapprojection__pmbgrid.pro .pro file in misc/plotting/ directory

The default mapgrid for a map object can be distracting, with labels in the center of the plot, solid grid lines, etc.

misc/ directory

Miscellaneous routines.

misc/file/ directory

Miscellaneous routines for file I/O.

misc/latlon/ directory

Miscellaneous routines for latitude/longitude conversions.

misc/objects/ directory

Miscellaneous routines for working with objects.

misc/plotting/ directory

Miscellaneous routines for manipulating plots.

misc/time/ directory

Miscellaneous routines for handling time values.

### N

nldn_pulse class
nldn_pulse__define routine in nldn_pulse__define.pro

Definition of the structure used for NLDN data.

nldn_pulse__define.pro .pro file in ltg/nldn/ directory

This provides a structure definition for NLDN data.

nldn_stroke class
nldn_stroke__define routine in nldn_stroke__define.pro

Definition of the structure used for NLDN data.

nldn_stroke__define.pro .pro file in ltg/nldn/ directory

This is legacy code to be retired.

### P

pmb_binary routine in pmb_binary.pro

This function will find the binary representation (i.e., the bits) of the argument.

pmb_binary.pro .pro file in misc/ directory

This function accepts a numeric type (or array of numeric types) and returns a byte array that contain the binary representation of the number (i.e., the bits).

pmb_clean_pointers routine in pmb_clean_pointers.pro

Free any pointers in a structure

pmb_clean_pointers.pro .pro file in misc/ directory

This routine takes a structure that contains pointers and releases those pointers from the heap.

pmb_convert_float_to_binary routine in pmb_convert_float_to_binary.pro

Given a float, return the 4 byte value of the float

pmb_convert_float_to_binary.pro .pro file in misc/ directory

Function for converting a float (4 bytes) to it's 4-byte equivelent.

pmb_export_array_mathematica routine in pmb_export_array_mathematica.pro

pmb_export_array_mathematica.pro .pro file in misc/ directory

Often, I will work in IDL and Mathematica simultaneously.

pmb_get_lma_initiation routine in pmb_get_lma_initiation.pro

Given an array of source times and the flash number each sources belongs to, find the initiation source for each flash.

pmb_get_lma_initiation.pro .pro file in ltg/lma/ directory

When working with LMA data, you might need to get the initation source of each flash in a time period.

pmb_humantime2unix routine in pmb_humantime2unix.pro

This function will take a "human" time (month, day, year) and convert it to Unix time.

pmb_humantime2unix.pro .pro file in misc/time/ directory

Takes a "Human" time and converts it to Unix time.

pmb_import_entln routine in pmb_import_entln.pro

Returns an array of structures with ENTLN data.

pmb_import_entln.pro .pro file in ltg/entln/ directory

This will read in a file containing Earth Networks Total Lightning Network (ENTLN) pulse-level data.

pmb_import_entln_define_raw_struct routine in pmb_import_entln.pro

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

pmb_import_lma_data routine in pmb_import_lma_data.pro

The main routine.

pmb_import_lma_data.pro .pro file in ltg/lma/ directory

LMA data is saved into text files, but the format of the files is not very uniform.

pmb_import_nldn routine in pmb_import_nldn.pro

Given a file from Vaisala, read it in and return a structure

pmb_import_nldn.pro .pro file in ltg/nldn/ directory

The function will read in NLDN stroke data.

pmb_import_wwlln routine in pmb_import_wwlln.pro

This routine will read in a WWLLN file and output an array of structures.

pmb_import_wwlln.pro .pro file in ltg/wwlln/ directory

The function will read in WWLLN stroke data.

pmb_import_wwlln_parse_param routine in pmb_import_wwlln.pro

Define the attributes need to parse the actual data file.

pmb_is_gz routine in pmb_is_gz.pro

Find out if a file is gzipped or not

pmb_is_gz.pro .pro file in misc/file/ directory

This routine will attempt to determine if a file is "gzipped" or not by peeking at the file extension.

pmb_is_leap routine in pmb_is_leap.pro

Function to determine if a year is a leap year

pmb_is_leap.pro .pro file in misc/time/ directory

Determines if the passed year is a leap year

pmb_lma_source class
pmb_lma_source__define routine in pmb_lma_source__define.pro

Define the structure for a LMA source.

pmb_lma_source__define.pro .pro file in ltg/lma/ directory

This file defines the structure for a LMA source.

pmb_logistic_regression routine in pmb_logistic_regression.pro

This routine performs the logistic regression of a simple linear model.

pmb_logistic_regression.pro .pro file in ats606/ directory

This routine performs logistic regression for a simple linear model.

pmb_logistic_regression_logL routine in pmb_logistic_regression.pro

This helper routine find the log likelihood for a given set of parameters.

pmb_logistic_regression_nr routine in pmb_logistic_regression.pro

This helper routine performs one iteration of the Newton-Raphson method to find the maximum likelihood estimators.

pmb_meshgrid routine in pmb_meshgrid.pro
pmb_meshgrid.pro .pro file in ats606/ directory
pmb_object_cleanup routine in pmb_object_cleanup.pro

Call the cleanup method for an object-based GUI.

pmb_object_cleanup.pro .pro file in misc/objects/ directory

Generic routine handler for cleaning up object based GUIs.

pmb_object_event_handler routine in pmb_object_event_handler.pro

Call the event handler for an object based GUI.

pmb_object_event_handler.pro .pro file in misc/objects/ directory

Generic event handler for object based GUIs.

pmb_plot_lis routine in pmb_plot_lis.pro

This is a routine that can be used to plot LIS data.

pmb_plot_lis.pro .pro file in lis/ directory

Go ahead and plot LIS data

pmb_plot_lis_get_colors routine in pmb_plot_lis.pro

Define a color scale for the radiance.

pmb_plot_lis_orbit routine in pmb_plot_lis_orbit.pro
pmb_plot_lis_orbit.pro .pro file in lis/ directory
pmb_plot_modis routine in pmb_plot_modis.pro

Create an image from bands from MODIS.

pmb_plot_modis.pro .pro file in ats/modis/ directory

Working file to get a plot of MODIS data, given three bands that represent the RGB values.

pmb_plot_modis_scale routine in pmb_plot_modis.pro

This helper routine will do scaling of an array for you and perform histogram equalization.

pmb_plot_param class
pmb_plot_param::cleanup routine in pmb_plot_param__define.pro

Cleanup the object.

pmb_plot_param::GetProperty routine in pmb_plot_param__define.pro

Overload the IDL_OBJECT GetProperty method for this object.

pmb_plot_param::init routine in pmb_plot_param__define.pro

Initialization method.

pmb_plot_param::IsValid routine in pmb_plot_param__define.pro

Check the property x (an axis structure) and its tag x to see if a valid transformation is here.

pmb_plot_param::load routine in pmb_plot_param__define.pro

Load the plot parameters stored in the object to the current workspace

pmb_plot_param::save routine in pmb_plot_param__define.pro

Save the current plot parameters into the object

pmb_plot_param::SetProperty routine in pmb_plot_param__define.pro

Overload the IDL_OBJECT SetProperty method for this object.

pmb_plot_param__define routine in pmb_plot_param__define.pro

Define the object.

pmb_plot_param__define.pro .pro file in misc/plotting/ directory

This is an object that load/save plot parameters.

Given a structure of gridded radar data, make a plot.

This file takes gridded radar data and plots the data.

pmb_poisson_pdf routine in pmb_poisson_pdf.pro

For given value(s) of x, calculate the Poisson probability(ies).

pmb_poisson_pdf.pro .pro file in stats/ directory

This routine returns the Poisson probability distribution function for a given value(s) and mean.

Given a radar variable, return a structure with appropariate colors and levels

This routine will appropriate colors and levels for radar variables.

This function returns data from a MODIS swath (level 1b) file.

pmb_read_modis1b.pro .pro file in ats/modis/ directory

Given a file of level 1B MODIS data (aka, swath data), this function will read the bands and return them in an array of [n, m, nBands].

pmb_spatial_temporal_limits routine in pmb_spatial_temporal_limits.pro

This function will limit spatial-temporal data within the given limits.

pmb_spatial_temporal_limits.pro .pro file in misc/ directory

Given arrays of times, x, y, and z, and corresponding limits, return a set of indices in which all the data falls within the given limits.

pmb_swap_plot_parameters routine in pmb_swap_plot_parameters.pro

Swap the plot parameters of the system variables !P, !X, !Y

pmb_swap_plot_parameters.pro .pro file in misc/plotting/ directory

When dealing with programs (GUI's, usually) with a lot of plot windows, it's useful to be able to quickly swap the plot parameters.

pmb_unix2human routine in pmb_unix2human.pro

Calculate the human time from Unix time.

pmb_unix2human.pro .pro file in misc/time/ directory

Given a (or array) of Unix times, convert these into a human format.

pmb_warn_old_routine routine in pmb_warn_old_routine.pro

Warn a user when they use an old routine.

pmb_warn_old_routine.pro .pro file in misc/ directory

This very simple routine can be added to "old" or "deprecated" routines to warn users.

pmb_xyz2lla routine in pmb_xyz2lla.pro

Convert a set of values from XYZ coordinates to lat, lon, altitude.

pmb_xyz2lla.pro .pro file in misc/latlon/ directory

Given a set of Cartesian (i.e., XYZ) coordinates, convert to latitude, longitude, altitude.

### R

raw_header__define.pro .pro file in hamma/deprecated/ directory

raw_header_old__define.pro .pro file in hamma/deprecated/ directory

The purpose of this procedure is to read in orbit information from a set of LIS (Lightning Imaging Sensor) HDF VData files and return a single variable containing an array of structures of the field values.

read_lis.pro .pro file in lis/ directory

The purpose of this procedure is to read in orbit information from a set of LIS (Lightning Imaging Sensor) HDF VData files and return a single variable containing an array of structures of the field values.

### S

stats/ directory

Statistical routines

### W

wwlln_stroke class
wwlln_stroke__define routine in wwlln_stroke__define.pro

Define the structure for a WWLLN stroke

wwlln_stroke__define.pro .pro file in ltg/wwlln/ directory

Define a structure to be used with WWLLN stroke data.