Converting a region-of-interest from a ROLO brick slice into radiance values

K. Fisher canopus56@yahoo.com 9-28-2009 Rev. 1.2

Summary

An image processing protocol to extract camera values for a 4 x 3 pixel region-of-interest near Cabeus A from a 512 x512 ROLO archive lunar image taken 2001-02-13 UT09:59 from the ROLO facility near Flagstaff, Arizona is illustrated. The median radiance of the 12 pixel region-of-interest is reduced as 0.0456363 Watts m-2 sr-1 nm-1 with a standard deviation of 0.00189995 Watts m-2 sr-1 nm-1 (4.1 %) at 550nm.

Example materials

The example data file, this notebook and other materials discussed here can be downloaded from the author's project directory.

http : // members.csolutions.net/fisherka/astronote/observed/LCROSS/20090927 mpsaskaf/

To be opened as illustrated below, the example datafile "mm295302_11.bin" must be downloaded and stored as local file.   Data extracted in this illustration also has been stored in an Excel 2003 format spreadsheet, available at url:

http : // members.csolutions.net/fisherka/astronote/observed/LCROSS/20090927 mpsaskaf/tabROLOClippedROIs.xls

Example image data

The example image was provided courtesy of the USGS ROLO image archive.

Rolo band 550 nm
Filename mm295302_ 11. bin
DN Camera pixel value normalized for 1 second exposure time
Dimensions 512 x 512
Format Binary - slice of ROLO data "brick" formatted for ISIS
Image scale 4.08250 arcsecs per pixel
Time 2001 - 02 - 13 T09 : 59 : 01.734 Z
JD 2451953.916
PHASE 69.784
BRIGHT_LIMB 107.73
POSITION_AXIS 18.769
SUB_EARTH _LATITUDE - 5.825
SUB_EARTH _LONGITUDE 8.299
SUB_SOLAR _LATITUDE - 1.04
SUB_SOLAR _LONGITUDE 298.518
Observing Point Flagstaff, Arizona
Source USGS ROLO Lunar Image Archive
Source website http://www.moon-cal.org/index.php

The libration in longitude (+8.3 degrees) for this image differs from the LCROSS Oct. 9 target impact condition (-3.5 degrees in latitude but -2.5 degrees in longitude).  The image was selected on the basis that the sun altitude near Cabeus A was within one - half percent of  LCROSS impact conditions.  At Cabeus A on Oct. 9, the solar altitude will be -1.5 degrees vs. -1.4 degrees in the example image.   This image's 298.5 degree solar colongitude compares favorably with a solar colongitude of 294.8 degrees on Oct. 9.  Because the libration-in-longitude of the example image differs greatly from circumstances on Oct. 9, it may not be appropriate to extrapolate  radiance measurements taken from this image to Oct. 9.   Conversely,  since only  lunar photometry for circumstances that match the circumstances on Oct. 9 is very limited, this may be the best data that is available.

Convert image data to table

Set working directory

SetDirectory["C:\\Documents and Settings\\fisherka\\My Documents\\Mathematica"]

Check the files in your working directory to confirm your working directory is set properly.

FileNames[]

Import image to table

Manually open the file, import the data via a binary read of individual cell values into a table and then close the file.  Attempting to import a ROLO image file using a bulk import command results in anomalous read errors.

Open["mm295302_11.bin"]

tabROLO  = Table[BinaryRead["mm295302_11.bin","Real32"],{i,1,512},{j,1,512}]

Close["mm295302_11.bin"]

This is a good-sized table  that contains  (512^2) cells.

Dimensions[tabROLO]

Display options for image data that aid identifying region-of-interest coordinates

There are variety of ways to display the image data inorder to select  the best region-of-interest for a first low-resolution  review.

ArrayPlot[tabROLO]

ReliefPlot[tabROLO,ColorFunction->GrayLevel]

ListPlot3D[tabROLO, ColorFunction->(ColorData["GrayTones"])]

The ListDensityPlot is the form most analogous to a fits or tiff grayscale image.

ListDensityPlot[tabROLO, ColorFunction->GrayLevel]

Select first high-level low-resolution region-of-interest

Display the image with a grid

Displaying a grayscale image with a scale and an overlaying grid is one easy way to ascertain the data table coordinates that correspond to a region-of-interest.

ListDensityPlot[tabROLO, ColorFunction->GrayLevel,MeshStyle->{Directive[Opacity[0.5],White]},Mesh->20]

Identify coordinates of the region-of-interest

Here, the first-tier region-of-interest consists of the lunar south and southwest pole between Malapert E and Cabeus.   The corner coordinates of the region-of-interest box are : upper left 20, 440; lower right 80, 340.

Import["http://members.csolutions.net/fisherka/astronote/observed/LCROSS/20090927mpsaskaf/ROLOImageROICoords.jpg"]

Clip the region-of-interest from the base image

With the image - table coordinates of the region-of-interest (ROI), the ROI can be extracted into a smaller and more managable sub-table -

tabROLOROI1 = tabROLO[[340;;440, 20;;80]]

Dimensions[tabROLOROI1]

The subtable is identified as "ROLOROI1" for "region-of-interest no. 1."

ListDensityPlot[tabROLOROI1, ColorFunction->GrayLevel,AspectRatio->1.4]

This subtable is sufficiently small that it can be exported to MS - Excel 2003 format - which is limited to tables with 256 columns - subjected to further analysis using a spreadsheet tool.

Export["tabROLOROI1.xls",tabROLOROI1]

The raw camera values in this clipped region-of-interest also can be exported to a fits file for analysis using amateur image processing software.

Export["tabROLOROI1.fits",tabROLOROI1]

Examine the high-level region-of-interest to identify a detailed resolution region-of-interest

As with the base image, the clipped subtable can be reviewed in order to identify the next more detailed tier region-of-interest -

ListPlot3D[tabROLOROI1, ColorFunction->(ColorData["GrayTones"])]

and rotated in 3 D to better examine candidate regions -

ListPlot3D[tabROLOROI1, ColorFunction->(ColorData["GrayTones"])]

ListPlot3D[tabROLOROI1, ColorFunction->(ColorData["GrayTones"])]

Select the second detail high-resolution region-of-interest

Display the image with coordinate grid

Again, a coordinate scale and grid is an easy way to identify the next smaller region-of-interest.

ListDensityPlot[tabROLOROI1 ,ColorFunction->GrayLevel,MeshStyle->{Directive[White]},Mesh->20, AspectRatio->1.4]

Compare the first tier region-of-interest with finder maps to identify a high-resolution region-of-interest

Exporting the low-resolution region-of-interest to a graphics file and comparing it to finder maps also is a good aid in finding the image coordinates of the next higher resolution region-of-interest.

Import["http://members.csolutions.net/fisherka/astronote/observed/LCROSS/20090927mpsaskaf/KAF9_10_2009Finder.jpg"]

Import["http://members.csolutions.net/fisherka/astronote/observed/LCROSS/20090927mpsaskaf/ROLOClippedImageROI1RotatedSharpened.jpg"]

Identify the coordinates of the high-resolution region-of-interest

The coordinates of the high-resolution region-of-interest are identified as before -

Import["http://members.csolutions.net/fisherka/astronote/observed/LCROSS/20090927mpsaskaf/ROLOClippedROI2CoordsMesh.jpg"]

- but careful inspection and interpolation of the detailed region- of-interest should be done to avoid capturing shadow artifacts in the clipped region, illustrated as follows :

ListDensityPlot[tabROLOROI1[[34 ;; 52, 26 ;; 39]],ColorFunction->GrayLevel,MeshStyle->{Directive[White]},Mesh->5, AspectRatio->1]

Clip the detailed region-of-interest from the previous low-resolution region-of-interest

As before, this new region-of-interest is extracted into a sub-subtable -

tabROLOROI2 = tabROLOROI1[[41 ;; 43, 28 ;; 31]]

TableForm[tabROLOROI2]

- that contains only twelve pixels.

Dimensions[tabROLOROI2]

This new region-of-interest can also be exported to MS Excel 2003 for further analysis in a spreadsheet context.

Export["tabROLOROI2.xls",tabROLOROI2]

Examine the detail region-of-interest for appropriateness as a measuring region

A plot  of the pxiels show that it is free of any bias effects from nearby bright or dark regions.

ListDensityPlot[tabROLOROI2,ColorFunction->GrayLevel,MeshStyle->{Directive[White]},Mesh->5, AspectRatio->1]

Convert the high-resolution region-of-interest values to radiance

Convert the high-resolution region-of-interest 2D table to a 1D list

In order determine descriptive statistics for the 12 pixels in a 2 D format, it is necessary to convert the 2 D table -

TableForm[tabROLOROI2]

- into a 1 D list.

lstROLOROI2 = Flatten[tabROLOROI2]

TableForm[lstROLOROI2]

Examine descriptive statistics of the raw camera values from the high-resolution region-of-interest

Descriptive statistics for the raw camera values are :

Mean[lstROLOROI2]

Median[lstROLOROI2]

StandardDeviation[lstROLOROI2]

100 × StandardDeviation[lstROLOROI2]/ Median[lstROLOROI2]

Transform the camera values to radiance

The calibration transformation provided by the ROLO archive' s Tom Stone is - 

CALIBRATION = 0.2949425 E - 04 
EXTINCTION = 1.3185471 E + 00 
Then pixel radiance (Watts/m^2 sr nm) [ Watts m-2 sr-1 nm-1] =
 DN*CALIBRATION*EXTINCTION 

 -  implemented as follows:

conCalibrationCoeff = 0.2949425 × (10^(-4)) × 1.3185471

lstROLOROI2Radiance = lstROLOROI2 × conCalibrationCoeff

TableForm[lstROLOROI2Radiance]

Descriptive statistics for the resulting radiance values are:

Median[lstROLOROI2Radiance]

StandardDeviation[lstROLOROI2Radiance]

100 × StandardDeviation[lstROLOROI2Radiance]/ Median[lstROLOROI2Radiance]

Export the radiance values

Finally, the radiance values also can be exported into a spreadsheet table.

Export["tabROLOROIRadiance.xls",lstROLOROI2Radiance]

Alternative method:  Measuring using amateur image processing software

As mentioned above,  raw camera values in a  region-of-interest also can be exported to a fits file for analysis using amateur image processing software.

Export["tabROLOROI1.fits",tabROLOROI1]

Here we see a screen shot from AIP4WIN, a popular amateur astronomical imaging processing package, demonstrating using its pixel measuring tool to determine the descriptive statistics for the region north of Cabeus A.

Import["http://members.csolutions.net/fisherka/astronote/observed/LCROSS/20090927mpsaskaf/AIP4WINMeasuring.JPG"]

A word of caution when using such tools.  The minimum region size that can be evaluated in AIP4WIN in the ROLO example image can be larger than a suitable flat region.  A suitable measuring region is not encroached by adjacent crater shadows or bright mountain peaks.

The table clipping approach presented here is more labor intensive but provides for better control of the selected region and better interrogation of the region.  For example,  only slightly expanding the detailed region - of - interest used in the ROLO example image, reveals adjacent crater shadows that may not be visible during inspection using  AIP4WIN.  Those artifacts might be captured in the AIP4WIN measuring tool results.

ListDensityPlot[tabROLOROI1[[34 ;; 52, 26 ;; 39]],ColorFunction->GrayLevel,MeshStyle->{Directive[White]},Mesh->5, AspectRatio->1]

End