This module provides functionality to read the contents of files in the PTW file format and convert the raw data to source radiance or souorce temperature (provided that the instrument calibration data is available).
Functions are provided to read the binary Agema/Cedip/FLIR Inc PTW format into data structures for further processing.
The following functions are available to read PTW files:
readPTWHeader(ptwfilename)showHeader(header)getPTWFrame (header, frameindex)
readPTWHeader(ptwfilename) : Returns a class object defining all the header information in ptw file.
showHeader(header) : Returns nothing. Prints the PTW header content to the screen.
getPTWFrame (header, frameindex) : Return the raw DL levels of the frame defined by frameindex.
The authors wish to thank FLIR Advanced Thermal Solutions for the permission to publicly release our Python version of the ptw file reader. Please note that the copyright to the proprietary ptw file format remains the property of FLIR Inc.
This package was partly developed to provide additional material in support of students and readers of the book Electro-Optical System Analysis and Design: A Radiometry Perspective, Cornelius J. Willers, ISBN 9780819495693, SPIE Monograph Volume PM236, SPIE Press, 2013. http://spie.org/x648.html?product_id=2021423&origin_id=x646
Container to describe the calibration data of a Jade camera.
Calculate the mapping functions between digital level, radiance and temperature
Using the spectral curves and DL vs. temperature calibration inputs calculate the various mapping functions between digital level, radiance and temperature. Set up the various tables for later conversion.
Load the camera calibration data from files and preprocess spectrals data
Calculate the radiance associated with a DL and Tint pair. Interpolate linearly on Tint radiance not temperature.
Calculate the radiance associated with a DL and parametric pair. The parametric variable was calculated once and used for all DL values.
Calculate the temperature associated with a DL and Tint pair. Here we interpolate linearly on Tint temperature - actually we must interpolate linearly on radiance - to be done later. Note that dicLookupRadTemp is available for both Tint values, but it has the same value in both cases.
Plot DL level versus radiance for both camera temperatures
Plot digital level versus temperature for both camera temperatures
Plot all spectral radiance data for the calibration temperatures.
Plot all spectral curve data to a single graph.
Plot temperature versus radiance for both camera temperatures
Plot optics radiance versus instrument temperature
Write the calibration data file data to a string and return string.
Class to store the ptw file header information.
Given a ptw filename, read the header and return the header to caller
Utility function to print the PTW header information to stdout
Retrieve a single PTW frame, given the header and frame index
This routine also stores the data array as part of the header. This may change - not really needed to have both a return value and header stored value for the DL valueheader. This for a historical reason due to the way GetPTWFrameFromFile was written
Retrieve a number of PTW frames, given in a list of frameheader.