https://github.com/z-vig/m3_pro
Image Processing Software for Lunar M3 Data
https://github.com/z-vig/m3_pro
Last synced: 5 months ago
JSON representation
Image Processing Software for Lunar M3 Data
- Host: GitHub
- URL: https://github.com/z-vig/m3_pro
- Owner: z-vig
- Created: 2023-02-07T22:09:26.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-02T22:34:54.000Z (over 2 years ago)
- Last Synced: 2023-10-03T06:54:28.944Z (over 2 years ago)
- Language: Jupyter Notebook
- Size: 22.7 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# M3 Image Processing
This package aims to process M3 Hyperspectral data with goal of better constraining the location of H~2~O Ice on the Lunar Surface
## HySpec Image Processing File
Here you will find the HDR_Image() class. This class is intended to perform basic image processing techniques such as noise reduction and continuum removal. To begin, load your image into the HDR_Image class as follows:
```
from HySpec_Image_Processing import HDR_Image
myimage = HDR_Image(path_to_image)
```
From here, several methods are available for various kinds of exploratory analysis.
### HDR_Image().hdr
Creates a specPy BilFile object. From this you can get band names, pixel info, metadata and much more. See specPy documentation. \
**return:** BilFile object
### HDR_Image().plot_image(wvl,\*\*kwargs)
Plots reflectance hdr files and supplemental hdr files using a single band or all bands in a 3-dimensional image, and saves these images to a specified folder \
**kwargs:** All_Bands = Boolen, Norm = (All,Image,None), allMax = ndarray, allMin = ndarray, saveImage = Boolean \
**return:** ndarray of image nomalized to itself OR ndarray of image normalized to set max and min OR ndarray of original reflectance image
### HDR_Image().plot_spec(x,y,\*\*kwargs)
Plots the spectrum for a given pixel on the image and saves this to a specified folder \
**kwargs:** saveFig = Boolean, showPlot = Boolean, plot_og, plot_boxcar, plot_cspline, plot_cspline_boxcar, plot_movingAvg, plot_movingAvg_cspline (all plot_ kwargs = Boolean), box_size=(select or type(float)), movingAvg_size=(select of type(float)) \
**return:** ndarray of reflectance values, ndarray of wavelength values
### HDR_Image().find_shadows(\*\*kwargs)
Tests each pixel in the image to see if the average reflectance over all the bands is below a certain threshold. \
**kwargs:** saveImage = Boolean, showPlot = Boolean, threshold = type(float) \
**return:** ndarray with size equal to the original image with pixel values = 1 for non-shadowed regions and pixel values = 0 for shadowed regions
### HDR_Image().wvl_smoothing(x,y)
Smooths the reflectance spectrum and reduces noise using a cubic spline fit. \
**return:** ndarray of modeled wavelengths, ndarray of modeled reflectance
### HDR_Image().get_minima(x,y)
Plots the smoothed spectrum from wvl_smoothing and draws vertical lines at identified absorption bands. \
**return:** list containing the wavelength values of all identified absorption bands
### HDR_Image().get_average_rfl(true_arr,\*\*kwargs)
Assists in finding the average reflectance values for a given mosaic dataset. \
**kwargs:** avg_by_img = Boolean \n
**return:** wavelnegths,average reflectances and standard deviation reflectances OR wavelengths, ndarray of all pixels to be averaged in mosaic