I have co-authored a paper on portable infrared laser spectroscopy for on-site mycotoxin analysis, which nicely demonstrates future applications of spectroscopy — a combination of new powerful laser light sources (quantum cascade lasers) paired with machine learning allows for extraction of information from spectra of complex samples such as food and environmental matrices.
In this case toxin concentrations of a potent natural carcinogen (Aflatoxin B1) were used to discriminate samples at (the very low, 8 ppb) established legal limits.
Portable sensors are most useful for preliminary large scale screening on site.
It took a bit of time, but here are some simple procedures to work with netCDF output that I get from my atmospheric chemistry model runs in Matlab.
Here is an example for pollutant concentrations obtained in .nc format from a CAABA/MECCA run:
% Read 4D-double data from .nc file for the following variables
time = ncread('caaba_mecca.nc','time');
o3_data = ncread('caaba_mecca.nc','O3');
oh_data = ncread('caaba_mecca.nc','OH');
no_data = ncread('caaba_mecca.nc','NO');
no2_data = ncread('caaba_mecca.nc','NO2');
ch4_data = ncread('caaba_mecca.nc','CH4');
co_data = ncread('caaba_mecca.nc','CO');
% Extract concentration data from 4D double matrix and write to new variable
o3_data2 = squeeze(o3_data(1,1,1,:));
oh_data2 = squeeze(oh_data(1,1,1,:));
no_data2 = squeeze(no_data(1,1,1,:));
no2_data2 = squeeze(no2_data(1,1,1,:));
ch4_data2 = squeeze(ch4_data(1,1,1,:));
co_data2 = squeeze(co_data(1,1,1,:));
Starting here you can resume regular Matlab code to work with the variables defined