Skip to content

NelisW/ComputationalRadiometry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Computational Optical Radiometry with pyradi

http://dx.doi.org/10.5281/zenodo.9910

The pyradi toolkit is a Python toolkit to perform optical and infrared radiometry (flux flow) calculations. The toolkit is an extendible, integrated and coherent collection of basic functions, code modules, documentation, example templates, unit tests and resources, that can be applied towards diverse calculations in the electro-optics domain.

The notebooks in this series cover the functionality provided by the pyradi Python library. The pyradi package is also available on PyPI: pip install --upgrade pyradi.

The notebooks can be downloaded from Github. These notebooks are constantly revised and updated, revisit from time to time.

This series of notebooks is not intended to be a complete manual, please consult the documentation for more information. Section references in the notebooks indicated as (Sec 5.1) refer to sections in the book.

The links below point to HTML renderings of the notebooks, courtesy of Rackspace. Please have patience, rendering the notebooks may take some time (downloading files, processing the data, and rendering the HTML).

  1. IPython hints and tips.
    This notebook provides a brief summary of how to start up and use the IPython notebook. Introductions are given to magic commands, help functionality, using IPython for scientific work, cell memory, markdown, citations, embedding media files, and a few lesser used functions.

  2. Python whirlwind cheat sheet.
    This notebook serves to give brief one-liner examples of key Python usage and idioms. The approach here is not to spend too much time on general Python constructs, but to move on to Numpy as soon as possible. Numpy is a critical base for any scientific calculation, providing powerful vectorised computation. I make no claim to any level of completeness in this document. You still need to read the books and reference manuals to get the big picture and the details. You still have to read the manuals, but this should help you move on to Numpy quickly.

Introduction to optical radiometry.
A very brief overview of the fundamental theory, from the book.

  1. Introduction to computational radiometry with pyradi.
    This notebook provides a description of the basics of radiometric spectral variables and conversions between spectral densities, generic filter functions, generic detector functions, and reading and plotting spectral data. It then moves on to how to calculate spectral integrals, calculate spectral effective values, spectral convolution, colour coordinate calculations, and spatial integrals.

  2. Plotting with pyradi.
    Demonstrating the variety of plots available with ryplot. The pyradi library has a module, pyradi.ryplot, to simplify plotting. The module is a productivity wrapper around Matplotlib, all that can can be done pyradi.ryplot can be done with raw Matplotlib. The productivity gained with this module stems from the fact that plots and plot properties are all combined into a single function call. So, with just one call a complete graph can be drawn. The code is compact and there is no need to hunt through many pages of documentation to find the appropriate command for some graph attribute. You would have to consult the ryplot documentation for information on the functions long list of parameters.

05a) Plotting With Pyradi - General Introduction and Cartesian Plots This notebook covers a general introduction to plotting and creating Cartesian (x,y) plots. Other plot types are covered in the next notebook in the series.

05b) Polar, three-dimensional, and image plots This notebook covers extends on 05a) and describes polar plots, three-dimensional plots and image plots. Other plot types are covered in the next notebook in the series.

05c) Mayavi

  1. Diverse pyradi utilities. Demonstrate the pulse detection algorithms (ryutils). Demonstrate the range equation solver (ryutils). Absolute humidity function (ryutils). List files in directory tree using a pattern: listFiles (ryfiles). Write LateX code for eps figure: epsLaTexFigure (ryfiles). Write a numpy array to LaTeX: arrayToLaTex (ryfiles). Load a two-dimensional lookup table: read2DLookupTable (ryfiles).

  2. Optical Sources.
    The pyradi library has a reasonably complete collection of Planck radiator models, both spectral and wide band. A comprehensive collection of physical constants, pertinent to optical radiation is also included. This notebook introduces these functions in the pyradi.ryplanck library.

  3. Modtran File Processing.
    The pyradi library has a module to handle Modtran files. The module currently has only one function: to read Modtran tape7 files in an intelligent manner. The function is rymodtran.loadtape7.

  4. Optical Detector Modelling.
    The pyradi rydetector module models the primary functionality of optical detectors. This notebook demonstrates the development of a simple single element InSb detector model suitable for high-level system modelling. The performance of the detector is described in terms of its figures of merit. The theoretical background to this model is covered the text book.

09b) Staring Array Detector Modelling.
The pyradi rystare module models a high level model for CCD and CMOS staring array signal chain modelling. The model accepts an input image in photon rate irradiance units and then proceeds to calculate the various noise components and signal components along the signal flow chain.

  1. Image utilities. Loading raw data files and saving raw data to an image. Performing histogram equalisation on an image. Warping a Siemens Star image from polar to cartesian format. Calculate the three dimensional noise of an image sequence.

Infrared measurement and analysis.
This notebook demonstrates the pyradi tools to read and process a FLIR Inc ptw infrared camera file. First the image header and image data are read and displayed. Measured calibration data is then used to determine the instrument function, which is finally used to calculate the temperature of a laboratory source.

  1. Example simple case studies.

12a) A Simple Flame sensor analysis.
This notebook provides a simple worked example of a small sensor observing a flame on a smokestack. The objective is to calculate the signal of a simple infrared sensor, detecting the presence or absence of a flame in the sensor field of view. The sensor is pointed to an area just outside a furnace vent, against a clear sky background. The sensor must detect a change in signal indicating the presence of a flame at the vent.

12b) Albedo derivation from MODIS data.
This notebook demonstrates the use of Pandas to extract information from MODIS data. The objective here is to determine the spectral albedo of an area in the visual and infrared spectral bands. The data acquisition is done manually and this notebook focuses only on the analysis. The MODIS data provide information in the visual, near infrared and thermal infrared bands, but with a gap from 3 $\mu$m to 10 $\mu$m - you have to consult other sources for this information. The albedo calculated here is based on a multi-year dataset of a single site; over a 7 km by 7 km region at the test site. The albedo is averaged over all the years for the twelve months of the year.

12c) Atmospheric transmittance effect on colour coordinates of sunlit objects. The perceived colour of an object depends on the object's inherent colour as well as the irradiance spectrum. The spectral properties of the three irradiance components on an object at sea level vary dramatically with solar zenith angle. When the sun is at zero zenith angle the sunlight is least attenuated (spectral variation is smaller), and the spectral properties of sky shine is similar to the direct sun irradiance. When the sun is near the horizon the direct sun irradiance shifts towards red, while the sky radiance shifts towards blue. This notebook uses Modtran-calculated atmospheric spectral transmittance for different atmospheric aerosol conditions and zenith angles. The shift in colour coordinates of a few coloured surfaces are then determined for the different atmospheric conditions.

12d) Temperature estimation from spectral data.
A spectral radiometer is used to determine the surface temperature of a hot object exposed to sunlight. The surface normal vector is pointing directly towards the sun. The object is considerably hotter than the environment, hence atmospheric path radiance and reflected ambient flux can be ignored. Ignore atmospheric transmittance between the sun and the object and between the object and the sensor. The measurement results are corrupted by noise. The sun and object both radiate as Planck radiators. Emissivity is constant at all wavelengths. The temperature and emissivity of the object surface, as well as the temperature of the sun are unknown and are determined.