MoonTools: A Framework for Hyperspectral Data Processing and Parameter Retrieval
(2026)
Authors:
Henry Eshbaugh, Katherine Shirley, Fiona Henderson, Namrah Habib, Emma Belhadfa, Robert Spry, Kevin Olsen, Neil Bowles
Abstract:
MoonTools is a software framework, written in the Julia programming language [9], allowing straightforward, flexible, and performant processing of multispectral and hyperspectral data products. Designed originally to operate on M3 observations [4, 5], our framework is readily extensible to a wide range of datasets.Drawing from functional programming [6], our framework emphasizes composition of disparate operations. Processing pipelines are constructed in native Julia, parametrised by partial function application. This approach allows for flexibility of use and ease of extensibility, and distinguishes our work from similar tools, e.g. [7]; further, Julia’s just-in-time compilation and parallel-programming tools allow for fast, multithreaded operations on multi-terabyte datasets, including for user-supplied inputs.Implemented operations include thermal and photometric corrections of multispectral radiance cubes, reflectance retrievals, spectral parameter determination, and post-processing amongst others. Additional utilities allow users to search datasets for targets by nomenclature, terrain type, and local solar time. Various dataset export options are available, including HDF5 products and “at a glance” views of regions of interest.We provide an example Julia pipeline in Listing 1, reproducing the detection of spinel at Theophilus crater [1,2]. We begin by importing the MoonTools package; then, we define a RATIO parameter expression. The spectral parameters SPINEL and PYROXENE are implemented as in [2] up to a constant factor using the RATIO definition. Invoked macros produce multithreaded CPU and GPU-kernel implementations of these parameters transparently to the user. Finally, a pipeline is composed: we search M3 data for observations of Theophilus crater, apply parameters, and produce “quicklook” plots of all matching observations; one such plot is shown in Figure 1.Listing 1: Pipeline invocation, including parameter definitions, required to produce Figure 1.using MoonTools@paramdef RATIO(λs, R; λ1, λ2) = sum(R[λ1]) / sum(R[λ2])@param SPINEL RATIO [1400] [1750]@param PYROXENE RATIO [0700, 1200] [0950]observations(:m3) > by_name("Theophilus") > PYROXENE > SPINEL > quicklookFigure 1: One of several quicklook outputs, showing Theophilus crater. Quicklooks are intended to provide overviews of regions of interest (RoIs) indicated by pipeline construction. Plots on the left include a reference narrowband reflectance, and PYROXENE and SPINEL parameter maps across the RoI. The RoI is partitioned into a 3x3 grid of zones; spectra sampled from each zone are plotted on the right in corresponding positions.Striping artifacts exist throughout the M3 dataset, and are prominent in spectral parameter products; state-of-the-art tooling must destripe these images [7,8]. We provide a bespoke destriping algorithm using a wavelet packet decomposition [3]. The modified pipeline is given in Listing 2; a destriped spinel map is shown in Figure 2.Listing 2: Pipeline altered from Listing 1; outputs are shown in Figure 2.observations(:m3) > by_name("Theophilus") > SPINEL > destripe!Figure 2: Destriped spinel parameter map. The before and after of the destriping operation are shown in the left and center plots; the removed signal is shown on the right.Software development is progressing rapidly. We anticipate a release of MoonTools to the scientific community in the coming months; MoonTools will be distributed under the terms of an open-source software license. We will welcome bug reports, feature requests, and contributions.References[1] Dhingra, D., Pieters, C.M., Boardman, J.W., Head, J.W., Isaacson, P.J. and Taylor, L.A., 2011. Compositional diversity at Theophilus Crater: Understanding the Geological Context of Mg‐Spinel-Bearing Central Peaks. Geophysical Research Letters, 38(11).[2] Pieters, C.M., Hanna, K.D., Cheek, L., Dhingra, D., Prissel, T., Jackson, C., Moriarty, D., Parman, S. and Taylor, L.A., 2014. The distribution of Mg-spinel across the Moon and constraints on crustal origin. American Mineralogist, 99(10), pp.1893-1910.[3] Mallat, S., 1999. A Wavelet Tour of Signal Processing. Elsevier.[4] Chandrayaan-1 Moon Mineralogy Mapper Science Team (2011). M3 L1B Gridded Spectral Radiance, Version 3. PDS Cartography and Imaging Sciences Node. https://doi.org/10.17189/1520248.[5] Chandrayaan-1 Moon Mineralogy Mapper Science Team (2011). L2 Gridded Spectral Reflectance (version 1) products. https://doi.org/10.17189/1520414.[6] Backus, J., 1978. Can Programming be Liberated from the von Neumann Style? A Functional Style and its Algebra of Programs. Communications of the ACM, 21(8), pp.613-641.[7] Suárez‐Valencia, J.E., Rossi, A.P., Zambon, F., Carli, C. and Nodjoumi, G., 2024. MoonIndex, an open‐source tool to generate spectral indexes for the moon from M3 data. Earth and Space Science, 11(6), p.e2023EA003464.[8] Shkuratov, Y., Surkov, Y., Ivanov, M., Korokhin, V., Kaydash, V., Videen, G., Pieters, C. and Stankevich, D., 2019. Improved Chandrayaan-1 M3 data: A northwest portion of the Aristarchus Plateau and contiguous maria. Icarus, 321, pp.34-49.[9] Bezanson, J., Karpinski, S., Shah, V.B. and Edelman, A., 2012. Julia: A Fast, Dynamic Language for Technical Computing. arXiv preprint arXiv:1209.5145.