Skip to main content

The NEWTEC HSTI package contains fundamental functions for the data analysis of hyperspectral thermal images (HSTI).

Project description

This package contains functions used in data processing of hyperspectral images captured using a scanning Fabry-Pérot interferometer (FPI). This includes transmission simulations of the FPI itself.


Image handling

HSTI.import_data_cube(path)

This function imports the hyperspectral thermal datacube from the raw output of the camera. The path that the function uses as input must be the one containing the 'images' directory.

HSTI.export_data_cube(cube, folder_name)

This function takes an HSTI numpy array and exports it as individual .ppm images to a folder given by folder_name.

HSTI.remove_stuck_px(cube)

This function removes the dead pixels in the bolometer by replacing them with the average of their non-zero neighbors.

HSTI.remove_outlying_px(cube, cut_off)

This function removes outlying pixel measurements of values higher than the cut off value.

HSTI.median_filter_cube(cube, kernel_size)

This function runs a median filter across the image plane. The size of the kernel must be defined.


Preprocessing

HSTI.remove_vignette(cube)

This function takes a single HSTI as input and returns a new vignetting corrected cube.

HSTI.debend(cube, central_mirror_sep)

This function takes a single HSTI as input and returns a new spectral bending corrected cube. This does however require a vector containing the mirror separation corresponding to each band in the cube.

HSTI.baseline(cube)

This function subtracts the mean pixel value from every band in the datacube.

HSTI.standardize(cube)

This function subtracts the mean pixel value from every band in the datacube and divides all values with the pixel standard deviation.

HSTI.normalize_cube(cube)

This function normalises the entire data cube by dividing all bands by the sum of the bands.

HSTI.normalize_pixel(cube)

This function normalises the entire data cube by dividing all bands by the sum of the bands in each individual pixel.

HSTI.sbtrct_first_band(cube)

This function subtracts the first band from the remaining bands in the datacube, effectively setting the first band to zero.


Common analysis

HSTI.fps(points, n_seeds)

Function which distributes n_seeds (a numper of points) equally within a lists of points to obtain furthest point sampling.

The function takes in a list of points. Every entry in the list contains both the x and y coordinate of a given point. It returns the coordinates of the selected sample points.

HSTI.voronoi(array_2D, n_seeds)

This function accepts a 2-dimensional array (array_2D) and splits it up into N (n_seeds) subdomains. The partitioning is done based on furthest point sampling.

HSTI.mse(lst1, lst2)

This function returns the mean square error (MSE) between two lists of same length.

HSTI.r_sq(y_fit, y_meas)

This function returns the coefficeint of determination (R²) between fit values in list, y_fit, and measured data in list, y_meas.

HSTI.PCA()

HSTI.PCA.calculate_pca(self,matrix)

This function calculates the PCA of a two-dimensional input

HSTI.PCA.apply_pca(self,matrix)

This function returns the PCA loadings


FPI Simulation

HSTI.fpi_sim(mirror_sep, lam, temp)

This function uses the Transfer Matrix Method (TMM) to simulate the transmittance, reflectance of the FPI at given mirror separation (mirror_sep) and wavelength (lam). temp is the substrate temperature since the refractive index of Germanium is temperature dependent. This function DOES NOT take broadening due to substrate bending into account. The functions returns the transmittance, the reflectance, as well as the numeric loss of the simulation.

HSTI.fpi_sim_matrix(mirror_sep, lam, temperature)

The same as HSTI.fpi_sim(), but instead of single values, this function accepts vectors for mirror separation and wavelength. It then returns a 2D array of transmittance values of the FPIwhere each row represents a specific mirror separation while the each column indicates individual wavelengths. This function does take broadaning into account, but only returns the transmittance matrix. Since no loss is included in the model, the reflectance can be found by subtracting the transmittance matrix from a similar-sized matrix of ones.

HSTI.fpi_sim_matrix_angular(mirror_sep, lam, temperature, angle_in_deg)

This function is similar to HSTI.fpi_sim_matrix(), but also takes the angle between the incoming ray and the FPI as an argument.


Contact

For bug reports or other questions please contact mani@newtec.dk or alj@newtec.dk.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

HSTI-0.0.17.tar.gz (7.8 MB view hashes)

Uploaded Source

Built Distribution

HSTI-0.0.17-py3-none-any.whl (7.8 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page