HyperScience

Into the Supercontinuum

Some good news: we got funded to purchase a supercontinuum IR source and a high-speed IR camera. The idea is to couple the light source into a spectrometer after being absorbed by flow, allowing for fast and easy broadband absorption spectra.

I had hoped that NKT would have an IR supercontinuum source available, but apparently they have stopped supplying it for some reason (perhaps the power was lower than they would have liked, or there may have been other problems that I’m unaware of). I have managed to find a French supplier of these sources, so hopefully I’ll still be able to do it. It would be great to be able to see entire vibrational bands of CO2 and CO with this source. CO has bands at 2.3 microns and CO2 at 2.0, and both have bands around 4-4.5 microns. If I can hit that wavelength region, I should be able to hit both species and look at Mars entry problems in this region. The really nice thing about getting so much spectral information in the IR is that you can see any vibrational nonequilibrium in the flow, and absorption is strong, so low density flows can be measured.  It may be difficult to avoid water vapour at these wavelengths, however.

from Roller et al. (2002) Applied Optics 41(28):6018.

Now I need to do the maths to make sure that we get enough absorption signal and that the source puts enough light out to be detected by the camera over the intended wavelength range, and to find the filters I need to get to limit the detected wavelengths.

This would be a good project for an Australian PhD student with an interest in laser diagnostics and hypersonics. Contact me if you are interested.

Org-babel for J

As part of my emacs org-mode work flow, I have been using org-babel for a while. This allows you to insert code blocks into org buffers and have those blocks be executed when your file is compiled. This is a really handy method for doing reproduceable research. For example, you can call the source code function in R to do the statistical calculations for data in a table. If the data in the table changes, so will the calculation of the output data change. This prevents the perennial problem of having data in one file (typically a spreadsheet) and not knowing whether the document you generated for a paper used the 12th of September or the 15th of September version of the spreadsheet. By having explicit links to data and to the algorithm that manipulates that data, you can explicitly record the calculations you used to produce your data. And so can anyone else if they want to. This is very important for producing believeable data.

Org-babel is built into emacs org-mode, and supports an amazing array of programming languages, from compiled languages like C to interpreted languages like python or MATLAB, to specialised scripting languages like awk or gnuplot.

The best feature for me is that org-mode can read from or write to org tables, allowing a seamless integration between code and document. However, this capability differs between programming languages. Some languages, like python and common lisp, seem to be very well catered for in this regard. However my favourite programming language, J, is rather less well catered for. In particular, there does not seem to be a built-in way to pass variables to and from the code block. Instead, you can run your code as if it were a script, and the source block will provide the last calculated value as an output. For example,

#+BEGIN_SRC j :exports both
 NB. The square root of the sum of the squares of the numbers
 NB. between 1 and 10
	    [a =: %: +/ *: 1 + i.10
#+END_SRC
#+RESULTS:
: 19.6214

The output, as stated by the comment, produces the Euclidean norm of the integers between 1 and 10 inclusive, which is 19.6214, and displays it as the result from evaluating the source block. However, for other programming languages one could supply a variable argument using the :var command in the header, to pass a variable argument to a function. So, for example, the 10 in the example above could be replaced by each of the values in the column of a table.

Like most things in emacs, the code for executing commands in code blocks is available as elisp. So, in theory, it should be possible to modify the existing elisp export code to pass variables, including rows and columns in tables, to a J function. At the moment though, my understanding of elisp is not sufficiently good to be able to work out how to do this, but it sounds like a very useful thing to do, and necessary if J is to be seriously used from within org-mode. If anyone has managed to do this, I’d be very interested to know how it’s done. If not, I’ll need to learn some more elisp and try to reverse engineer how it’s already been done for MATLAB code to see if I can do something equivalent for J.

Oh, and happy new year for 2021. I wanted to get one more blog entry done before the end of 2020, as an old-year’s resolution…