Notebook %This notebook demonstrates the use of the workpackage template, replace with your own. \documentclass[english]{workpackage}[1996/06/02] % input the common preamble content (required by the ipnb2latex converter) \input{header.tex} % then follows the rest of the preamble to be placed before the begin document % this preamble content is special to the documentclass you defined above. \WPproject{Computational Radiometry} % project name \WPequipment{} % equipment name \WPsubject{12K Detailed Sensor Analysis} % main heading \WPconclusions{} \WPclassification{} \WPdocauthor{CJ Willers} \WPcurrentpackdate{\today} \WPcurrentpacknumber{} % work package number \WPdocnumber{} % this doc number hosts all the work packages \WPprevpackdate{} % work package which this one supersedes \WPprevpacknumber{} % work package which this one supersedes \WPsuperpackdate{} % work package which comes after this one \WPsuperpacknumber{} % work package which comes after this one \WPdocontractdetails{false} \WPcontractname{} % contract name \WPorderno{} % contract order number \WPmilestonenumber{} % contract milestone number \WPmilestonetitle{} % contract milestone title \WPcontractline{} % contract milestone line number \WPdocECPnumber{} % ecp\ecr number \WPdistribution{} % this is entered just before the end{document} \newcommand{\atendofdoc}{ \bibliographystyle{IEEEtran} \bibliography{references} } %and finally the document begin. \begin{document} \WPlayout
% this notebook is intended to be exported to LaTeX, so there are much LaTeX formatting shown here.
The atmospheric files are read into a Pandas data frame for later use. Pandas stores information in DataFrames that look like Excel spreadsheets. Data can be accessed by column heading or row index. Furthermore data can be filtered, sorted and otherwise processed. All of this is done using a few lines of code. The code reads in the files and then extracts the distance and altitude from the filename by regular expression parsing. You can, of course, also construct the filename from the known distances and altitudes values and then read in the data. The regular expression parsing is done with a rule like the following. The rule captures the numbers appearing after the $R$ and $H$. Regex is immensely powerful to filter, capture, search or change string contents. The following rule returns a list with altitude and distance extracted from the filename: \lstinline{grps = re.search('H\_([0-9]+)\_R\_([0-9]+).*', fn, re.IGNORECASE)} The values read in from the files are labelled with the height, altitude and path type extracted from the file name. Finally, we extract the unique values for height and altitude from the data frame for future use. The important principle here is that we extract parameters from the data file contents and names, using the minimum parameters coded in the software. This way it is easy to add more files with different distances or altitudes later with no code changes. All the Modtran files are sampled on the same spectral intervals, from 1667 to 3333~\si{\centi\metre^{-1}}. All spectral calculations in this example will be done on the interval defined in the Modtran files. In the following code we make a copy of the Modtran wavenumber `wn` and wavelength `wl` vectors for future reference.