--- title: "Lazy day and kayak fail" date: 2018-06-21 tags: [mayne] ---
My first full day on Mayne started with a… slight stomachache. I courageously recovered by staying in bed for another hour. Then, trying not to entirely waste the day, I took Penny out and we went for a jog up to Vulture Ridge, which is in the (very) near park at the edge of Don and Kathy’s place. Although she wasn’t exactly game for the full speed sprint up the hill, she did follow along at her pace, and we crested to the lookout point where a fantastic view south towards Pender Island was waiting for us.
The day mostly went downhill from there. I tried to work while simultaneously watching the World Cup, and failed at both. I’m not sure I enjoyed the games much (do I even like watching soccer?), and I definitely didn’t get much done. I think I had hoped that this time would be fantastically productive, but if it will be, then today was not a good start. I also am working on my latte technique, which has barely gotten off the ground. I think that I’m struggling to reliably build microfoam.
Still, even in the midst of non-productivity, it’s hard to argue with this setting. As much time and expense as this place no doubt requires, the view from their house out over the water is worth almost any price. And the whole place is thoughfully appointed with a lovely mid-century modern aesthetic (did I really just type that?).
My attempt at getting outside mostly bombed, though, when I attempted to go out on one of the kayaks. First, I didn’t bring a skirt and the waves were high enough that water got into the kayak almost immediately and continued to get in the kayak. With cold and wet pants, I only made it about 100m offshore. Plus, bringing the kayak in and out of the water was painful since I didn’t have water shoes. Tomorrow, I will do better: I’ll have a skirt (and a pump), hopefully some water-ready shoes, and I’ll actually remember to flip down the rudder this time. What a novelty. Still, at least Penny enjoyed coming down to the beach to watch me struggle.
I ended the day with a quick trip over to the grocery store to pick up milk (for more latte attempts) and chicken (for dinner). On the way back I was compelled to stop for a picture of a gorgeous inland farm area.


Balance: {{confirmedBalance | coinNotation | coinAbbreviation}}
Unconfirmed: {{unconfirmedBalance | coinNotation | coinAbbreviation}}


Do you want to be fluent in English?  Maybe, what you want is just to get a better job after you graduate from the faculty.
Well you can get all of those things in the Faculty of Language and Literature because we have the right courses for you. Our faculty has its vision and mission.
Vision and mission are what we hope our faculty and our students to become. In general, here are the vision and mission of our faculty.
Vision
To become an English language educational program which emphasizes academic excellence, creativity, and a high esteem for Christian values by 2015
Mission
To carry out technological and English knowledge-based teaching and education
To develop research in the field of English language education along with disseminate the results through various academic forums
To serve society through various cooperative efforts and relevant activities related to English language teaching and education
Goals
The English Language Educational Study Program of the Language and Literature Faculty strives to produce English language graduates who are able:
To carry out the education and teaching of English language with the newest technology-based approaches,
To produce research and publications in English language at regional, national, and international levels,
To serve society in English language education,
To actualize Christian values and develop professionalism in their occupations


404
The page you are looking for could not be found!
If this error persists, contact me on Discord: Degenerate#0001
Home


User data and language (two parallel asynchronous REST calls, plus using combineLatest()):
- Last name:
- {{(userService.address$ | async)?.lastname}}
- First name:
- {{(userService.address$ | async)?.firstname}}
- Street:
- {{(userService.address$ | async)?.street}}
- Zip code:
- {{(userService.address$ | async)?.zipcode}}
- City:
- {{(userService.address$ | async)?.city}}
- Preferred language:
- {{languageService.language$ | async}}


Music Categories
Even more websites all about website templates on Just Web Templates
If you're looking for beautiful and professionaly made templates you can find them at Template Beauty.
You can remove any link to our websites from this template without linking back to us.


Strategies
Free Cash Flow Index
TTAM 3 Factor Strategy
Free Cash Flow Weighted Index
Free Cash Flow Style Index
Free Cash Flow Multi-Factor Index
Free Cash Flow Hedge Index
Ex. Financials Benchmark
Country
United States
Ex-US
Japan
Ex-Japan
-
Region
North America
Global
Asia Pacific
Europe
-
Market
Developed
Emerging
Global
CapGroup
Large-Mid Cap
All Cap
Large Cap
Mid Cap
Small Cap
Micro Cap
Select Category
Category
Overview
Performance
awesome
Portfolio Name
Strategies
Country
Region
Market
Cap Group
table not loaded


CISR
The Center for Invasive Species Research based on the University of California Riverside Campus provides a forward-looking approach to managing invasions in California by exotic pests and diseases. The long-term goal of CISR is to develop a systematic methodology for dealing with such exotic pests in areas of: (a) risk assessment; (b) early detection and invasion pathway analysis; (c) rapid development of control or eradication measures; (d) improved Integrated Pest Management practices through biological, microbial, genetic, and chemical practices; (e) better understanding of patterns and processes facilitating invasion success and failure, and (f), in the longer term, exploring the possibilities of transgenic biological manipulations to control or eradicate invasive species. Read More about the CISR Mission
Red Alert!
Has the South American Palm Weevil, Rhynchophorus palmarum, Established in Southern California?
Detection of R. palmarum in California was officially confirmed in May 2011 by USDA. The initial detection was in San Ysidro in San Diego County, about 2.5 miles from the USA – Mexico border. It is likely that San Diego County was invaded by weevils that originated from Tijuana Mexico, where infestations and dead palms had been detected earlier (December 2010). Feeding by weevil larvae in the crown of palm trees, causes significant damage and results in the “crown” of the palm dying. This inability to produce new fronds gradually leads to palm death. Read more...
Insect Eradicated: Red Palm Weevil
Effective January 18, 2015, the Animal and Plant Health Inspection Service (APHIS) has declared eradication of Red Palm Weevil from Laguna Beach California. The Red Palm Weevil is widely considered the most devastating insect to attack palms has been found in Laguna Beach, Orange County California. The weevil was originally found by a landscape specialist in late August 2010 infesting a Canary Islands palm in a residential area. Read more about the Red Palm Weevil
California's Most Unwanted
Polyphagous Shot Hole Borer
The Polyphagous Shot Hole Borer carries a symbiotic fungus. The fungus destroys the food and water conducting systems of the tree, eventually causing stress and dieback. The larvae of the beetles within the beetle gallery... Read More
Brown Marmorated Stink Bug
Brown marmorated sting bug is notable for having a wide host range, purportedly upwards of 60 plant species, including numerous vegetable crops, fruit trees, and ornamental plant species. Among the most significant crop plants... Read More
Bed Bugs
An infestation of bed bugs is usually identified by finding the bugs or their dark colored fecal stains in the seams of mattresses and box springs, behind headboards and peeling wallpaper, or in other cracks and crevasses... Read More
Brown Widow Spider
The bite of a brown widow spider is minor in comparison to that of a black widow. Although one frequently cited study demonstrates that, drop per drop, brown widow spider venom is as toxic as other widow species, venom toxicity... Read More
Asian Citrus Psyllid
Asian citrus psyllid (ACP) is an efficient vector of the bacterial citrus disease huanglongbing (HLB), previously called citrus greening disease, which is one of the most destructive diseases of citrus worldwide... Read More
FAQ's about Invasive Species
What are invasive species?
Invasive species, alien species, exotic pests, bio-pollution, non-indigenous species, or invasive alien species, are common names that categorize non-native animals, microbes, diseases, or plants that are pests. These pests are not native in areas in which they cause problems and they are considered "invasive" because they invade new areas and the resulting invasion causes economic or environmental problems. Read more invasive species FAQ's
Where do invasive species come from?
Invasive species are often native to a country or area different to that in which they have invaded and are now causing problems. On average, California acquires around six invasive species per year, this is a rate of one new species every 60 days. Hawaii and Florida acquire new species at a round of around 15 per year. Read more invasive species FAQ'sWhy are invasive species a problem?
Invasive species cause a wide diversity of economic and environmental problems which almost always arise from uncontrolled population growth and spread in the area which has been invaded. Economic problems arise from the costs required to control invasive species, to reduce their rate of spread, or the need to inspect agricultural products that are being exported that may accidentally move the invasive pest to a new area Read more invasive species FAQ'sQuick Facts on Invasives
- Over the period 1700 to 2010, 1,686 non-native invertebrate species established in California
- The majority, ~84% (1,416 species) are insects, followed by mites (~8%), and spiders (~3%)
- Small sucking insects (e.g., aphids, whiteflies, scales, mealybugs) associated with live plants, account for ~28% of established insect species
- Approximately 44% of non-native invertebrates likely arrived from populations established elsewhere in North America (i.e., other parts of the USA and Canada)
- From 1970 to 1989, the annual rate of detection of established populations of new invertebrate species in California was ~6 per year
- From 1990 to 2010, the annual rate increased to ~ 9 per year, a 50% increase
- Of the new invertebrate species that have established in California ~19% (314 species) are considered pests
- Changes in border security (i.e., the transition from USDA-APHIS to Customs Border Protection) after 11 September 2001 did not cause any statistically significant changes in the numbers of non-native invertebrate species detected annually in California
Read more about Invasive Species in California


Transmissions and transmission components
Information
This package contains transmission related models.
A simple five speed transmission
Information
This transmission has five different gears representing the different "speeds" of the
transmission. This is the mechanical side of the transmission. The logic of which
gear the transmission should be in is external and provided via a gear selector
connector. This is neither a traditional automatic or manual transmission. The
type of transmission that this model is closest to is probably an automatic
shift manual. The idea behind this transmission is that everytime a new gear
is selected, the clutch pressure for that gear is reduced (using the gain parameter
k_off) and the clutch pressure of the new gear is increased. This should approximate
the dynamics of disengaging and engaging the clutch in a manual transmission.
Parameters
| Name | Default | Description |
| first_gear | 4.14 | Gear ratio of first gear |
| second_gear | 2.37 | Gear ratio of second gear |
| third_gear | 1.42 | Gear ratio of third gear |
| fourth_gear | 1.0 | Gear ratio of fourth gear |
| fifth_gear | 0.76 | Gear ratio of fifth gear |
| k_on | 2 | Gain for clutch engagements |
| k_off | 6 | Gain for clutch disengagement |
Modelica definition
model FiveSpeed "A simple five speed transmission"
extends Interfaces.Transmission;
parameter Real first_gear=4.14 "Gear ratio of first gear";
parameter Real second_gear=2.37 "Gear ratio of second gear";
parameter Real third_gear=1.42 "Gear ratio of third gear";
parameter Real fourth_gear=1.0 "Gear ratio of fourth gear";
parameter Real fifth_gear=0.76 "Gear ratio of fifth gear";
parameter Real k_on=2 "Gain for clutch engagements";
parameter Real k_off=6 "Gain for clutch disengagement";
protected
Real clutch_activation_levels[5] "Clutch Pseudo-pressure";
Real clutch_requested_levels[5] "Requested clutch pseudo-pressure"
;
Modelica.Mechanics.Rotational.Inertia inertia_driveline_side(J=0.03)
"Inertia for driveline side of the transmission";
Modelica.Mechanics.Rotational.IdealGear gear1(ratio=first_gear);
Modelica.Mechanics.Rotational.IdealGear gear2(ratio=second_gear);
Modelica.Mechanics.Rotational.IdealGear gear3(ratio=third_gear);
Modelica.Mechanics.Rotational.IdealGear gear4(ratio=fourth_gear);
Modelica.Mechanics.Rotational.IdealGear gear5(ratio=fifth_gear);
Modelica.Mechanics.Rotational.Clutch first_gear_clutch(fn_max=2000);
Modelica.Mechanics.Rotational.Clutch second_gear_clutch(fn_max=2000);
Modelica.Mechanics.Rotational.Clutch third_gear_clutch(fn_max=2000);
Modelica.Mechanics.Rotational.Clutch fourth_gear_clutch(fn_max=2000);
Modelica.Mechanics.Rotational.Clutch fifth_gear_clutch(fn_max=2000);
Modelica.Mechanics.Rotational.Inertia inertia_engine_side(J=0.03)
"Inertia on the engine side";
equation
connect(driveline, inertia_driveline_side.flange_a);
connect(gear1.flange_a, first_gear_clutch.flange_a);
connect(gear1.flange_b, inertia_driveline_side.flange_b);
connect(gear2.flange_b, inertia_driveline_side.flange_b);
connect(gear2.flange_a, second_gear_clutch.flange_a);
connect(gear3.flange_a, third_gear_clutch.flange_a);
connect(gear3.flange_b, inertia_driveline_side.flange_b);
connect(gear4.flange_a, fourth_gear_clutch.flange_a);
connect(gear4.flange_b, inertia_driveline_side.flange_b);
connect(gear5.flange_a, fifth_gear_clutch.flange_a);
connect(gear5.flange_b, inertia_driveline_side.flange_b);
connect(inertia_engine_side.flange_b, engine);
connect(inertia_engine_side.flange_a, third_gear_clutch.flange_b);
connect(inertia_engine_side.flange_a, second_gear_clutch.flange_b);
connect(first_gear_clutch.flange_b, inertia_engine_side.flange_a);
connect(fourth_gear_clutch.flange_b, inertia_engine_side.flange_a);
connect(fifth_gear_clutch.flange_b, inertia_engine_side.flange_a);
for i in 1:5 loop
der(clutch_activation_levels[i]) = if noEvent(clutch_activation_levels[i]
> clutch_requested_levels[i]) then -k_off*(clutch_activation_levels[i
] - clutch_requested_levels[i]) else -k_on*(clutch_activation_levels[i]
- clutch_requested_levels[i]);
end for;
first_gear_clutch.inPort.signal[1] = clutch_activation_levels[1];
second_gear_clutch.inPort.signal[1] = clutch_activation_levels[2];
third_gear_clutch.inPort.signal[1] = clutch_activation_levels[3];
fourth_gear_clutch.inPort.signal[1] = clutch_activation_levels[4];
fifth_gear_clutch.inPort.signal[1] = clutch_activation_levels[5];
algorithm
clutch_requested_levels := zeros(5);
if (gear_selector.gear >= 1 and gear_selector.gear <= 5) then
clutch_requested_levels[gear_selector.gear] := 1;
end if;
end FiveSpeed;
A simple shifting strategy
Information
This simple shifting strategy specifies the speeds at which the transmission should
upshift (increase the gear). No provision has been included in this transmission
for downshifting (since the only current application of this strategy is in a
racing simulation).
The up_shift_schedule array contains the top speed for each gear (except the last
gear since there is no gear after that to upshift to). Speeds are specified in
kilometers per hour.
Parameters
| Name | Default | Description |
| tire_radius | | Tire radius [m] |
| ngears | 5 | |
| up_shift_schedule[ngears - 1] | | [km/h] |
Modelica definition
model SimpleShiftStrategy "A simple shifting strategy"
extends Interfaces.ShiftStrategy;
parameter Integer ngears=5;
parameter Types.KilometersPerHour up_shift_schedule[ngears - 1];
Integer cur_gear;
equation
gear_request.gear = cur_gear;
// cur_gear = 1;
assert(min(up_shift_schedule) > 1, "Error in shift schedule");
algorithm
when initial() then
cur_gear := 1;
end when;
when (cur_gear < ngears and kph > up_shift_schedule[cur_gear]) then
cur_gear := cur_gear + 1;
end when;
end SimpleShiftStrategy;
Five speed transmission with typical gear ratios of a sports car
Information
This is a specialized five speed transmission. The particular gear ratios used for this
transmission correspond to the gear ratios of a sports car.
Parameters
| Name | Default | Description |
| first_gear | 3.97 | Gear ratio of first gear |
| second_gear | 2.34 | Gear ratio of second gear |
| third_gear | 1.46 | Gear ratio of third gear |
| fourth_gear | 1.0 | Gear ratio of fourth gear |
| fifth_gear | 0.79 | Gear ratio of fifth gear |
| k_on | 2 | Gain for clutch engagements |
| k_off | 6 | Gain for clutch disengagement |
Modelica definition
model SportsCarTransmission
"Five speed transmission with typical gear ratios of a sports car"
extends FiveSpeed(
first_gear=3.97,
second_gear=2.34,
third_gear=1.46,
fourth_gear=1.0,
fifth_gear=0.79);
end SportsCarTransmission;
HTML-documentation generated by Dymola Tue Feb 13 21:46:26 2001
.


WITNESS LIST Public Health Committee March 5, 1997-10:30A HB 561 For: Hochberg, Scott (self, Representative) On: Levy, Bruce Dr. (TSBME) HB 889 For: Craddick, Tom (self, Representative) HB 911 For: Thomason, Wade (Am. Lung Assn. of Tx.) On: Steeg, Susan (TDH) HB 1013 For: Brown, John (self) Hueffner, John (Christian Science Com.) Loper, Dianna (self) Smith, Charles (self) Spear, David Dr. (self, Odessa Fire Dept.) West, Buddy (self, Representative) HB 1511 On: Gukian, James Dr. (UT System) McKinney, Mike Dr. (HHSC) Weldenthal, Kern Dr. (UTSWMC) SB 388 For: Borys, Doug (Tx. Poison Ctr Network) Van de Putte, Leticia (self, Representative) TDH Laboratory Project For: Budd, James D. (self) Treadway, Tom (GSC) On: Patterson, Patti Dr. (TDH)


a Programmer.
I'm from Udupi.I am a Full stack developer.
B.E in Electronics and Communication Engineering from Alva's Institute of Engineering and Technology with 6.7CGPA.
Passed higher secondary from M.G.M PU College Udupi with 73%.
Passed high school from GPUC Hiriadka with 85%.
Good knowledge on Core Java,SQL,J2EE.
I have done udemy certification course on full stack web development.
TCS-ION Certification on Career Edge.
I watch TED talks.
I am Novelist.I like to read mystery and romantic novels.
Swami Anugraha house near petrol bunk Hiriadka
Bommarabettu village Udupi District.
pincode-576113
CONTACT ME


---
layout: default
---
{% include curtain.html %}
{% include intro.html %}
{% include tracks.html %}
{% include video.html %}
{% include speakers.html %}
{% include apply.html %}
{% include travel.html %}
{% include schedule.html %}
{% include venues.html %}


Getting Started
Georgi Kurian • December 25, 2018
configurationThis is a starter template for creating a beautiful, customizable blog with minimal effort. You’ll only have to change a few settings and you’re ready to go.
Configuration
As with all Jigsaw sites, configuration settings can be found in config.php
; you can update the variables in that file with settings specific to your site. You can also add new configuration variables there to use across your site; take a look at the Jigsaw documentation to learn more.
// config.php
return [
'baseUrl' => 'https://my-awesome-jigsaw-site.com/',
'production' => false,
'siteName' => 'My Site',
'siteDescription' => 'Give your blog a boost with Jigsaw.',
...
];
Tip: This configuration file is also where you’ll define any "collections" (for example, a collection of the contributors to your site, or a collection of blog posts organized by topic). Check out the official Jigsaw documentation to learn more.
Adding Content
You can write your content using a variety of file types. By default, this starter template expects your content to be located in the source/_posts/
folder.
The top of each content page contains a YAML header that specifies how it should be rendered. The title
attribute is used to dynamically generate HTML title
and OpenGraph tags for each page. The extends
attribute defines which parent Blade layout this content file will render with (e.g. _layouts.post
will render with source/_layouts/post.blade.php
), and the section
attribute defines the Blade "section" that expects this content to be placed into it.
---
extends: _layouts.post
section: content
title: Getting Started
date: 2018-12-25
description: Getting started with the Jigsaw blog starter template
cover_image: /assets/img/post-cover-image-2.png
featured: true
---
Adding Assets
Any assets that need to be compiled (such as JavaScript, Less, or Sass files) can be added to the source/_assets/
directory, and Laravel Mix will process them when running npm run local
or npm run production
. The processed assets will be stored in /source/assets/build/
(note there is no underscore on this second assets
directory).
Then, when Jigsaw builds your site, the entire /source/assets/
directory containing your built files (and any other directories containing static assets, such as images or fonts, that you choose to store there) will be copied to the destination build folders (build_local
, on your local machine).
Files that don't require processing (such as images and fonts) can be added directly to /source/assets/
.
Read more about compiling assets in Jigsaw using Laravel Mix.
Building Your Site
Now that you’ve edited your configuration variables and know how to customize your styles and content, let’s build the site.
# build static files with Jigsaw
./vendor/bin/jigsaw build
# compile assets with Laravel Mix
# options: dev, staging, production
npm run dev


Singular Value Decomposition
25 Jan 2018Content:
Diagonalize
If a matrix can be diagonalized by matrix : \begin{equation} P^-1AP = \begin{bmatrix} \tag{1}\label{eq:1} \lambda_1 & & & \newline & \lambda_2 & & \newline & & \ddots & \newline & & & \lambda_n \end{bmatrix} \end{equation} then:
\begin{equation} \tag{2}\label{eq:2} AP = P \begin{bmatrix} \lambda_1 & & & \newline & \lambda_2 & & \newline & & \ddots & \newline & & & \lambda_n \end{bmatrix} \end{equation}
Let’s be collumn vectors of matrix : \begin{equation} \tag{3}\label{eq:3} P = ( \vec{p_1} \hspace{2em} \vec{p_2} \hspace{2em} … \hspace{2em} \vec{p_n}) \end{equation}
Equation \eqref{eq:2} can be rewritten as
So the column vectors of are right eigenvectors of , and the corresponding diagonal entry is the corresponding eigenvalue. The invertibility of also suggests that the eigenvectors are linearly independent. This is the necessary and sufficient condition for diagonalizability and the canonical approach of diagonalization. The row vectors of are the left eigenvectors of .
A matrix is diagonalizable if P is invertible: all eigenvectors are linearly independent.
Check for nondiagonalizable matrices:
- Calculate geometric multiplicity (GM): The number of independent eigenvectors.
- Calculate algebraic multiplicity (AM): The number of repeated .
- GM < AM => nondiagonalizable
This is “spectral theorem” or “principle axis theorem”: For every symetric matrix A, \begin{equation} A = QDQ^{-1} = QDQ^T \hspace{2em} with \hspace{1em} Q^{-1} = Q^T \end{equation}
(Proof [1] page 331)
SVD
The singular value decomposition of a matrix A is the factorization of A into the product of three special matrices: where and are square orthonormal and the matrix is diagonal with positive real entries in the main diagonal.
The number of non-zero entries on matrix is the rank of matrix .
The diagonal entries of are sorted from biggest to smallest.
Image Compression using SVD
An image can be factorized into the multiplication of 3 matrices using SVD technique. The diagonal matrix is called the energy of the image.
Figure b below shows that most values of those entries are closed to zero, that means these values will not contribute much to the overall image, the first 100 values will significantly affect the structure of the image. The following figure show the compressed image by only retaining the first 50 values of S. This method is called “best rank k approximation”.
import scipy
from scipy import misc
from scipy import linalg
import numpy as np
import math
import matplotlib
from matplotlib import pyplot as plt
# load image test.png and store pixel values in matrix A
# Dimesional of image (1024x768)
A = scipy.misc.imread('test.png', mode='L')
U,S,V = linalg.svd(A, full_matrices = True)
plt.figure(1)
plt.imshow(A,cmap='gray')
# Plot the values of entries in diagonal matrix S
plt.figure(3)
fig, ax = plt.subplots()
plt.plot(S)
ax.set(xlabel='entries index of S', ylabel='actual values of entries')
# k is the number of largest entries on diagonal matrix that will be retained
k = 50
S[k:] = 0
n=1024
m=768
sigma = np.zeros((m, n))
for i in range(min(m, n)):
sigma[i, i] = S[i]
A = np.dot(U, np.dot(sigma, V))
plt.figure(2)
# Plot image after choosing k biggest entries of S
plt.imshow(A,cmap='gray')
plt.show()
Reference
- Introduction to linear algebra 4th edition, Gilbert Strang.


---
title: 2014 2015 out of state tuition for top ranked ms
date: '2015-06-26T19:00:20+05:30'
tags:
- misc
tumblr_url: https://sureshshanmugam.com/post/122502233945/2014-2015-out-of-state-tuition-for-top-ranked-ms
---
Follow my blog for more - Analytics & Marketing


What is Expollapser
Expollapser is a free, open source jQuery plugin that helps you
create expandable / collapsible parts of your web page.
Expollapser is easy to use, but yet highly configurable and extensible. Here are
some of the supported usages:
- Expand/collapsing parts on a web page
- Control alternating css on expand/collapse
- Control alternating html of header on expand/collapse
- Lazy loading - load content dynamically on expand
- Nesting - put expand/collapse sections inside others.
- Extensibility points: Bind to preExpand, postExpand, preCollapse and postCollapse events.
Example of Javascript setup
$(document).ready(function() {
$('myHeader').expollapser();
});
Sponsors
Expollapser is kindly sponsored by the companies Headfitted and Codevelop.


Packages¶
This is a sub-menu for all the packages
Sensor Package¶
The sensor package provides modelling of complete sensors, typically comprising an optical objective lens and a focal plane detector as a minimum (a camera). A sensor may also include a display and a human observer. The display and human observer are required in order to calculate ranges and probabilities of target detection, recognitions and identification (DRI).
Capability is also provided to model direct view systems comprising a telescope or binocular and human observer, without any electronics in the sensor chain.
Optics Module¶
The optics module provides modelling of basic objective lenses used by imaging systems. For the most part, these are optical systems that are near to diffraction-limited, with centred circular entrance pupils, possibly with a centred circular obscuration (as in a Cassegrain or Newtonian telescope).
-
class
optics.
Lens
(efl, fno, trn, wfe=None, obs=None, mtf=None, wvn_step=500.0, wfe_allowed=0.3, attrs=None)[source]¶ The Lens class encapsulates information and behaviour related to imaging lens systems. The chief characteristics of a lens are its spectral through-field, through-focus and through-frequency MTF, as well as the spectral transmission. In order to transform spatial frequencies in the image plane to angular spatial frequencies in object space, the effective focal length of the lens (efl) must also be known. The basic lens model is a near diffraction-limited system with a centred circular aperture having a centred circular obscuration (which may be absent), where the MTF is constant over the entire field of view (FOV). A lens with field-dependent MTF can be constructed by providing wavefront error input that varies with field.
The most basic lens model implemented here, from which more complicated lens models could inherit their properties have the following attributes
Parameters: - efl – The effective focal length of the lens in mm
- fno – The focal ratio of the lens
- trn – The spectral transmission of the lens (zero to unity).
- wfe – The wavefront error measured in waves. This can be a scalar, assumed the same for all wavelengths, or it can be provided as a function of wavelength and/or field position.
- obs – The obscuration ratio, being the ratio of the circular obscuration diameter to the full circular aperture aperture diameter
- mtf – The MTF of the lens. Either the MTF can be provided as a set of measurements or it can be computed from efl, fno, obs and wfe
The lens MTF is computed as a function of spatial frequency in the image, wavelength, defocus and field position.
The total RMS wavefront error is computed as
\[W=\sqrt{W_{\Delta\!z}^{2}+W_{a}^{2}}=\sqrt{\left(\frac{\Delta\!z}{8\lambda F^{2}}\right)^{2}+W_{a}^{2}}\]where \(\Delta\!z\) is the defocus expressed in the same units as the wavelength \(\lambda\), \(F\) is the focal ratio and \(W_a\) is the RMS waverfront error due to aberrations at best focus.
Lens constructor. The lens is constructed using the focal length, focal ratio and spectral transmittance, and optionally also the obscuration ratio and wavefront error.
Parameters: - efl – The effective focal length of the lens. The effective focal length must be a scalar value with units, e.g. [30, ‘mm’].
- fno – The focal ratio (or f-number) which is th ratio of focal length to aperture diameter. This input must be a scalar value.
- trn (xray.DataArray) – The spectral transmission function, typically a function of wavelength. The spectral transmittance function must be
- wfe – The wavefront error must be expressed in waves (unitless). It can be a function of wavelength (wvl) and field position (flr) , but not focus (fldz). If no input is provided, the wfe will default to zero over the same spectral region as the lens transmission function.
- obs – The obscuration ratio of the lens (scalar numeric) range 0.0 - 1.0, Default None (0.0)
- mtf – A complete pre-computed or measured MTF, with axes of spf, wvl, fldz, flr, flo
- wvn_step – Minimum spectral increment in wavenumbers (cm^-1) for MTF calculation. Default 500 cm^-1
- wfe_allowed – Maximum allowed wfe when computing lens defocus wfe, Default 0.5 waves at mean wavelength of transmission function domain.
- attrs – A dictionary of user-defined attributes and metadata. Consider including ‘name’ and ‘long_name’, ‘title’, ‘summary’ or other netCDF convention attributes.
Returns: -
__init__
(efl, fno, trn, wfe=None, obs=None, mtf=None, wvn_step=500.0, wfe_allowed=0.3, attrs=None)[source]¶ Lens constructor. The lens is constructed using the focal length, focal ratio and spectral transmittance, and optionally also the obscuration ratio and wavefront error.
Parameters: - efl – The effective focal length of the lens. The effective focal length must be a scalar value with units, e.g. [30, ‘mm’].
- fno – The focal ratio (or f-number) which is th ratio of focal length to aperture diameter. This input must be a scalar value.
- trn (xray.DataArray) – The spectral transmission function, typically a function of wavelength. The spectral transmittance function must be
- wfe – The wavefront error must be expressed in waves (unitless). It can be a function of wavelength (wvl) and field position (flr) , but not focus (fldz). If no input is provided, the wfe will default to zero over the same spectral region as the lens transmission function.
- obs – The obscuration ratio of the lens (scalar numeric) range 0.0 - 1.0, Default None (0.0)
- mtf – A complete pre-computed or measured MTF, with axes of spf, wvl, fldz, flr, flo
- wvn_step – Minimum spectral increment in wavenumbers (cm^-1) for MTF calculation. Default 500 cm^-1
- wfe_allowed – Maximum allowed wfe when computing lens defocus wfe, Default 0.5 waves at mean wavelength of transmission function domain.
- attrs – A dictionary of user-defined attributes and metadata. Consider including ‘name’ and ‘long_name’, ‘title’, ‘summary’ or other netCDF convention attributes.
Returns:
-
optics.
atf
(spf, wvl, fno, rms_wavefront_error)[source]¶ Compute the MTF degradation factor for a lens operating at the given wavelengths and and with the given focal ratios, RMS wavefront errors at the the specified spatial frequencies in the image plane. ATF stands for Aberration Transfer Function.
Parameters: - spf – Spatial frequencies in the image plane at which to compute the ATF. Spatial frequencies must be in reciprocal units to wavelengths i.e. if wavelengths are in mm, spatial frequencies must be in cycles per mm.
- wvl – Wavelengths at which to compute the ATF
- fno – Focal ratios at which to compute the ATF
- rms_wavefront_error – RMS wavefront error magnitudes (in waves) at which to compute the ATF
Returns: A numpy array with the aberration transfer function.
Reference : Shannon, R.R., Handbook of Optics, Volume 1, 2nd Edition, Chapter 35 - Optical Specifications. “This is an approximation, however, and it becomes progressively less accurate as the amount of the rms wavefront error exceeds about 0.18 wavelength.”
The formula used for computing the aberration MTF due to RMS wavefront error of \(W\) at spatial frequency \(f\) is
\[M\!T\!F_{W}(f)=1-\left(\frac{W}{0.18}\right)^{2}\left[1-4\left(\frac{f}{f_{c}}-\frac{1}{2}\right)^{2}\right]\]where the diffraction cutoff (or “critical”) frequency is \(f_c\).
See also
optics.pmtf_obs_wfe
-
optics.
autocorr_circle
(circle_radius, shift)[source]¶ Compute autocorrelation of a circular aperture of radius circle_radius with centre-to-centre sample displacements of shift.
Parameters: - circle_radius – Radius of circle
- shift – Centre-to-centre displacements at which to compute the autocorrelation
Returns: Autocorrelation magnitude
See also
optics.crosscorr_circle
-
optics.
crosscorr_circle
(circle_radius, shift)[source]¶ Cross correlation of unit circle with circle of radius circle_radius. Compute the cross-correlation of a circular aperture of unit radius at the origin, with a circular aperture of radius circle_radius, with centre-to-centre displacements of shift.
Parameters: - circle_radius – Radius of circle to cross-correlate with unit circle (scalar numeric)
- shift – Centre-to-centre displacements at which to compute the cross-correlation
Returns: Cross-correlation magnitude
See also
optics.autocorr_circle
-
optics.
ctf_eye
(spf, lum, w, num_eyes=2, formula=1)[source]¶ Compute the contrast transfer function of the human eye. By default, uses the condensed version of the Barten CTF.
Parameters: - spf – spatial frequencies in eye-space in cycles per milliradian (scalar or vector numpy array input)
- lum – mean luminance of the viewing area in \(cd/m^2\) (scalar or vector numpy array input)
- w – the angular width of the viewing area, or the square root of the angular viewing area in square degrees (scalar or vector numpy input).
- num_eyes – The number of eyes used for viewing (2 for binocular viewing or 1 for monocular viewing). The default is num_eyes=2.
- formula – The formula variant used for the computation. Defaults (formula=1) to the simple formula first published by Barten in SPIE 2003. Other options are formula=11 and formula=14, which are slight variations.
Returns: The CTF with respect to spf, lum and w (up to a 3D numpy array). Singular dimensions are squeezed out using numpy.squeeze().
-
optics.
mtf
(spf, wvl, fno)[source]¶ Compute the simple (optimally focussed) diffraction Modulation Transfer Function (MTF) of a prefect lens with an unobscured circular aperture.
Parameters: - spf – Spatial frequencies in the image at which to compute the MTF
- wvl – Wavelength in units consistent with the spatial frequencies f
- fno – Focal ratio (working focal ratio) of the lens
Returns: Modulation Transfer Function, with spatial frequency (spf) varying down columns and wavelength across rows If the frequencies are given in cycles per millimetre, the wavelengths must be in mm.
Any of the inputs can be a vector. The spatial frequencies are assigned to the rows of the output array, the wavelengths vary from column to column and Fno will vary in the third dimension, but singleton dimensions will be squeezed out.
See also
optics.pmtf, optics.pmtf_obs, optics.pmtf_obs_wfe
-
optics.
mtf_obs
(spf, wvl, fno, obs=0.0)[source]¶ Compute the optimally focussed diffraction Modulation Transfer Function of a perfect lens with an circular aperture having a centred circular obscuration. This is the monochromatic MTF computed at a number of discrete given wavelengths.
Parameters: - spf – Spatial frequencies in the image at which to compute the MTF (numpy vector).
- wvl – Wavelength in units consistent with the spatial frequencies spf (numpy vector)
- fno – Focal ratio (working focal ratio) of the lens (numpy vector).
- obs – The obscuration ratio (ratio of obscuration diameter to total aperture diameter). The obs input must be a scalar numeric.
Returns: MTF with respect to spatial frequency, wavelength, focal ratio and obscuration ratio. Singleton dimensions are squeezed out.
-
optics.
n_air
(wvl, temperature, pressure)[source]¶ Return the refractive index of air computed using the same formula used by ZEMAX See the section on Index of Refraction Computation in the Thermal Analysis chapter of the ZEMAX manual.
Parameters: - wvl – Wavelength(s) in microns. If all values of wvl exceed 100, then wavelengths are assumed to be in nm
- temperature – Temperature in Celsius.
- pressure – Relative air pressure (atmospheres, with 1 atm = 101 325 Pa).
Returns: This function returns a matrix with wvl varying from row to row, temperature varying from column to column and pressure varying in the depth dimension. The returned matrix is subject to np.squeeze() to remove any singleton dimensions.
Reference : F. Kohlrausch, Praktische Physik, 1968, Vol 1, page 408
-
optics.
patf
(spf, wvl, fno, rms_wavefront_error, wvl_weights)[source]¶ Compute the polychromatic aberration transfer function.
Parameters: - spf – Spatial frequencies in the image plane at which to compute the ATF. Spatial frequencies must be in reciprocal units to wavelengths i.e. if wavelengths are in mm, spatial frequencies must be in cycles per mm.
- wvl – Wavelengths at which to compute the ATF
- fno – Focal ratios at which to compute the ATF
- rms_wavefront_error – RMS wavefront error magnitudes (in waves) at which to compute the ATF
- wvl_weights – A numpy vector having the same length as the wvl vector, providing the relative weights of each of the wavelengths.
Returns: Polychromatic Aberration Transfer Function in a numpy array.
See also
optics.atf
-
optics.
pmtf
(spf, wvl, fno, wvl_weights)[source]¶ Compute polychromatic MTF of lens at given spatial frequencies (in the image plane) for specified wavelengths and wavelength weighting factors.
Parameters: - spf – Spatial frequencies in the image at which to compute the polychromatic MTF (numpy vector).
- wvl – Wavelength in units consistent with the spatial frequencies spf (numpy vector)
- fno – Focal ratio (working focal ratio) of the lens (numpy vector).
- wvl_weights – A numpy vector having the same length as the wvl vector, providing the relative weights of each of the wavelengths.
Returns: Polychromatic MTF with respect to spatial frequency, wavelength and focal ratio. Singleton dimensions are squeezed out of the returned numpy array.
-
optics.
pmtf_obs
(spf, wvl, fno, wvl_weights, obs=0.0)[source]¶ Compute polychromatic MTF of obscured lens at given spatial frequencies (in the image plane) for specified wavelengths and wavelength weighting factors. The lens may have a circular obcuration of specific ratio.
Parameters: - spf – Spatial frequencies in the image at which to compute the polychromatic MTF (numpy vector).
- wvl – Wavelength in units consistent with the spatial frequencies spf (numpy vector)
- fno – Focal ratio (working focal ratio) of the lens (numpy vector).
- wvl_weights – A numpy vector having the same length as the wvl vector, providing the relative weights of each of the wavelengths.
- obs – Obscuration ratio
Returns: Polychromatic obscured MTF with respect to spatial frequency, wavelength and focal ratio. Singleton dimensions are squeezed out of the returned numpy array.
-
optics.
pmtf_obs_wfe
(spf, wvl, fno, rms_wavefront_error, wvl_weights, obs=0.0)[source]¶ Compute polychromatic modulation transfer function for lens having circular pupil with centred circular obscuration and with aberrations expressed in terms of RMS wavefront error.
Parameters: - spf – Spatial frequencies in the image at which to compute the polychromatic MTF (numpy vector).
- wvl – Wavelength in units consistent with the spatial frequencies spf (numpy vector)
- fno – Focal ratio (working focal ratio) of the lens (numpy vector).
- rms_wavefront_error – Numpy vector of RMS wavefront error values
- wvl_weights – A numpy vector having the same length as the wvl vector, providing the relative weights of each of the wavelengths.
- obs – Obscuration ratio (centred circular obscuration in circular pupil), ratio of obscuration diameter to aperture diameter.
Returns: Numpy array with polychromatic modulation transfer function.
See also
optics.atf, optics.pmtf_obs, optics.pmtf
Electronics Module¶
The electronics module provides modelling of all electronic components in the imaging chain. Inclusion of any electronic component into a sensor results in an “electro-optical” sensor. Electronic components include
- Solid state electro-optical detectors, including focal plane array (FPA) detectors
- Image intensifier tubes
- Image processing components
- Display systems
-
class
electro.
Camera
(fpa, ad_bit_depth, digital_gain=None, digital_offset=(0.0, 'count'), noise=(0.0, 'count'), sitf=None, exp_time_min=(1e-05, 's'), exp_time_max=(inf, 's'), attrs=None)[source]¶ The Camera class composes a FocalPlaneArray (FPA) together with a gain stage (signal transfer function), an analogue-to-digital converter of specific bit depth and an additional amplifier noise. The Camera converts photoelectrons to digital output data. NB : A Camera object in MORTICIA does not include the Lens. The most basic sensor object that includes a lens is an Imager object which includes a lens and a camera.
Camera constructor. This class if for representation of a Camera, which incorporates a FocalPlaneArray and a converter stage which converts photoelectrons into digital levels (also called digital numbers - DN and in MORTICIA, the pint unit ‘count’ is used).
Parameters: - fpa – The FocalPlaneArray incorporated into the Camera
- ad_bit_depth – Number of bits in the Analogue-to-Digital A/D converter. Must be provided in MORTICIA scalar format as e.g. [16, ‘bit’]
- digital_gain – The number of photoelectrons required to raise the output by 1 digital level (DN) Must be provided in MORTICIA scalar format as e.g. [2.2, ‘e/count’].
- digital_offset – The digital level (DN) output of the camera for zero photoelectrons. This is not the “black level”, which typically includes additional dark signal. Must be provided in MORTICIA scalar format as e.g. [10.0, ‘count’].
- noise – An optional additional noise component to add to the signal. Must be provided as a MORTICIA scalar in either electrons or counts e.g. [2, ‘e’]. This is an RMS noise component, which is equivalent to a standard deviation.
- sitf – Signal transfer function (SiTF). As an alternative to providing the digital_gain and digital_offset, (particularly should the camera have essentially non-linear response) the SiTF can be provided as an xray.DataArray, with the input axis in units of electrons (‘e’) and the data in units of digital level (‘count’). If digital_gain and digital_offset are provided, the SiTF is calculated and stored internally as an xray.DataArray.
:param :param attrs: A user-defined dictionary of other information about this Camera object. Could include
items such as ‘model’, ‘manufacturer’ etc. A ‘title’ and ‘long_name’ are recommended attributes.Returns: -
__init__
(fpa, ad_bit_depth, digital_gain=None, digital_offset=(0.0, 'count'), noise=(0.0, 'count'), sitf=None, exp_time_min=(1e-05, 's'), exp_time_max=(inf, 's'), attrs=None)[source]¶ Camera constructor. This class if for representation of a Camera, which incorporates a FocalPlaneArray and a converter stage which converts photoelectrons into digital levels (also called digital numbers - DN and in MORTICIA, the pint unit ‘count’ is used).
Parameters: - fpa – The FocalPlaneArray incorporated into the Camera
- ad_bit_depth – Number of bits in the Analogue-to-Digital A/D converter. Must be provided in MORTICIA scalar format as e.g. [16, ‘bit’]
- digital_gain – The number of photoelectrons required to raise the output by 1 digital level (DN) Must be provided in MORTICIA scalar format as e.g. [2.2, ‘e/count’].
- digital_offset – The digital level (DN) output of the camera for zero photoelectrons. This is not the “black level”, which typically includes additional dark signal. Must be provided in MORTICIA scalar format as e.g. [10.0, ‘count’].
- noise – An optional additional noise component to add to the signal. Must be provided as a MORTICIA scalar in either electrons or counts e.g. [2, ‘e’]. This is an RMS noise component, which is equivalent to a standard deviation.
- sitf – Signal transfer function (SiTF). As an alternative to providing the digital_gain and digital_offset, (particularly should the camera have essentially non-linear response) the SiTF can be provided as an xray.DataArray, with the input axis in units of electrons (‘e’) and the data in units of digital level (‘count’). If digital_gain and digital_offset are provided, the SiTF is calculated and stored internally as an xray.DataArray.
:param :param attrs: A user-defined dictionary of other information about this Camera object. Could include
items such as ‘model’, ‘manufacturer’ etc. A ‘title’ and ‘long_name’ are recommended attributes.Returns:
-
class
electro.
FocalPlaneArray
(pitch, aperture, pixels, wellcapacity, readnoise, darkcurrent, dsnu, prnu, sqe=None, asr=None, t_ref=(25.0, 'degC'), darkcurrent_delta_t=(7.0, 'delta_degC'), temperature=(25.0, 'degC'), attrs=None)[source]¶ Focal plane array detector. This implementation is typically at the chip level. That is, all or most of the information for building an FPA object can be found in the chip-level datasheet. The FPAs in question here are usually CCD, CMOS, scientific CMOS or electron-multiplying CCD (EMCCD).
The FPA class can be combined with an image intensifier tube (IIT) to produce an ICCD device.
This class does not model Time-Delay and Integration (TDI), which is a dynamic imaging process.
The class does allow for setting of FPA operating temperature and recalculation of dark current based on the dark current doubling delta temperature.
The FPA is a component of a Camera class object and has the basic function of converting photons to photoelectrons. FPA object can have multiple spectral channels as with a colour camera. The colour sampling spatial pattern can be as for a Bayer filter or a 3-CCD camera.
Constructor for FocalPlaneAArray objects
Parameters: - pitch – The centre-to-centre spacing of the FPA detector elements. This must be a list where the first element is the centre-to-centre spacing in the x-direction (or both x and y), the second element is the spacing in the y-direction (if different from the x-direction) and the last element is the units in which the pitch is provided (string). The units must be pint-recognizable.
- aperture – The effective pixel aperture of the FPA detector elements. This must also be a list, providing the x-aperture of the pixel, y-aperture (if different from x) and the units (string).
- pixels – A list of number of pixels in the x and y directions respectively
- wellcapacity – The well capacity of the pixel in number of electrons
- readnoise – The RMS read noise in electrons.
- darkcurrent – The dark current as a list, giving nagnitude and units. Units can be electrons per pixel per second (e/s), or in an amperage per pixel (A/s) or an amperage per unit area of the FPA (e.g. A/cm^2)
- dsnu – The dark signal non uniformity provided as a list giving the magnitude in the first element and units in the second element. The units can also be e/s, A or A/area. This is the standard deviation. The DSNU can also be specified as 0.0 or None.
- prnu – The photo-response non-uniformity. This is also a standard deviation and must be provided in units of ‘%’. That is, the prnu input is a list with the magnitude in the first position and the obligatory string ‘%’ in the second position.
- sqe – This is a xray.DataArray object providing the Spectral Quantum Efficiency of the FPA. SQE must be provided with a single axis of wavelength values. The attribute sqe_units must be provided in the DataArray attributes and it must be dimensionless (the literal empty string ‘’). If any of the values exceeds unity, the SQE is assumed to be provided in percent. Alternatively, the asr input can be provided, but either the sqe or the asr input must be provided and not both, since they can be converted one from the other. SQE outside the spectral domain provided is assumed to be zero.
- asr – This is a xray.DataArray object providing the Absolute Spectral Response of the FPA. It can be provided as an alternative to the SQE. It must have the single axis of wavelength. Units are equivalent to A/W (photoelectron current per unit optical flux).
- t_ref – The reference temperature at which the dark current and other parameters are specified. To be provided as a [value, ‘units’] list. Default is [25.0, ‘degC’].
- darkcurrent_delta_t – The increase in temperature that causes doubling of the dark current. Default is [7.0, ‘delta_degC’].
- temperature – The operating temperature of the FocalPlaneArray. Default [25.0, ‘degC’]
- attrs – Dictionary of attributes and metadata. Entries with ‘name’, ‘long_name’, ‘title’, ‘summary’ or others, especially as per netCDF attribute conventions. The ‘manufacturer’ should possibly also be provided.
Returns: -
__init__
(pitch, aperture, pixels, wellcapacity, readnoise, darkcurrent, dsnu, prnu, sqe=None, asr=None, t_ref=(25.0, 'degC'), darkcurrent_delta_t=(7.0, 'delta_degC'), temperature=(25.0, 'degC'), attrs=None)[source]¶ Constructor for FocalPlaneAArray objects
Parameters: - pitch – The centre-to-centre spacing of the FPA detector elements. This must be a list where the first element is the centre-to-centre spacing in the x-direction (or both x and y), the second element is the spacing in the y-direction (if different from the x-direction) and the last element is the units in which the pitch is provided (string). The units must be pint-recognizable.
- aperture – The effective pixel aperture of the FPA detector elements. This must also be a list, providing the x-aperture of the pixel, y-aperture (if different from x) and the units (string).
- pixels – A list of number of pixels in the x and y directions respectively
- wellcapacity – The well capacity of the pixel in number of electrons
- readnoise – The RMS read noise in electrons.
- darkcurrent – The dark current as a list, giving nagnitude and units. Units can be electrons per pixel per second (e/s), or in an amperage per pixel (A/s) or an amperage per unit area of the FPA (e.g. A/cm^2)
- dsnu – The dark signal non uniformity provided as a list giving the magnitude in the first element and units in the second element. The units can also be e/s, A or A/area. This is the standard deviation. The DSNU can also be specified as 0.0 or None.
- prnu – The photo-response non-uniformity. This is also a standard deviation and must be provided in units of ‘%’. That is, the prnu input is a list with the magnitude in the first position and the obligatory string ‘%’ in the second position.
- sqe – This is a xray.DataArray object providing the Spectral Quantum Efficiency of the FPA. SQE must be provided with a single axis of wavelength values. The attribute sqe_units must be provided in the DataArray attributes and it must be dimensionless (the literal empty string ‘’). If any of the values exceeds unity, the SQE is assumed to be provided in percent. Alternatively, the asr input can be provided, but either the sqe or the asr input must be provided and not both, since they can be converted one from the other. SQE outside the spectral domain provided is assumed to be zero.
- asr – This is a xray.DataArray object providing the Absolute Spectral Response of the FPA. It can be provided as an alternative to the SQE. It must have the single axis of wavelength. Units are equivalent to A/W (photoelectron current per unit optical flux).
- t_ref – The reference temperature at which the dark current and other parameters are specified. To be provided as a [value, ‘units’] list. Default is [25.0, ‘degC’].
- darkcurrent_delta_t – The increase in temperature that causes doubling of the dark current. Default is [7.0, ‘delta_degC’].
- temperature – The operating temperature of the FocalPlaneArray. Default [25.0, ‘degC’]
- attrs – Dictionary of attributes and metadata. Entries with ‘name’, ‘long_name’, ‘title’, ‘summary’ or others, especially as per netCDF attribute conventions. The ‘manufacturer’ should possibly also be provided.
Returns:
-
class
electro.
Imager
(lens, camera, attrs=None)[source]¶ The Imager class encapsulates a complete imaging system with an optics.Lens and an electro.Camera. The Imager class can provide the digital outputs of the Lens+Camera when looking into a scene that provides the at-aperture (or at-sensor) radiance (the radiance apparent at the aperture of the Lens).
Constructor for Imager class.
Parameters: - lens – The optics.Lens for the Imager.
- camera – The electro.Camera for the Imager.
- attrs – User-defined dictionary of additional attributes, such as ‘title’, ‘summary’, ‘long_name’, ‘manufacturer’, especially those recommended for the netCDF conventions.
Returns: an Imager object
-
__init__
(lens, camera, attrs=None)[source]¶ Constructor for Imager class.
Parameters: - lens – The optics.Lens for the Imager.
- camera – The electro.Camera for the Imager.
- attrs – User-defined dictionary of additional attributes, such as ‘title’, ‘summary’, ‘long_name’, ‘manufacturer’, especially those recommended for the netCDF conventions.
Returns: an Imager object
-
electro.
xd_asr2sqe
(asr)[source]¶ Convert absolute spectral response (ASR) to spectral quantum efficiency (SQE).
The conversion is performed through the Planck relationship
\[E=h\nu\]where \(E\) is the photon energy, \(h\) is the planck constant and \(\nu\) is the optical frequency. In terms of optical wavelength in a vacuum, the planck relation is
\[E=\frac{hc}{\lambda}\]where \(c\) is the speed of light and \(\lambda\) is the wavelength.
Parameters: asr – An xray.DataArray object providing the absolute spectral response (ASR). The DataArray must have a single axis providing the wavelength points, together with the standard attribute ‘units’ for the wavelength axis. Returns: Spectral Quantum Efficiency as an xray.DataArray object. Returned wavelengths will be ‘nm’ in the wavelength (‘wvl’) axis.
-
electro.
xd_sqe2asr
(sqe)[source]¶ Convert spectral quantum efficiency (SQE) to absolute spectral response. This is the reverse conversion of that provided by electro.xd_asr2sqe.
Parameters: sqe – The spectral quantum efficiency (SQE), provided as a xray.DataArray object in which SQE is provided as a function of wavelength. The wavelength axis must provide the ‘units’ attribute. Returns: Absolute spectral response (ASR) as an xray.DataArray object, havin a single axis of wavelength coordinates (‘wvl’). Returned units for the wavelength axis will be ‘nm’.
Radiometry Package¶
The radiometry package provides all MORTICIA functionality relating to radiometry and atmospheric radiative transfer. Atmospheric radiative transfer is performed by the libRadtran suite of tools.
LibRadTran Module¶
The LibRadTran module concerns itself with calculations for the radiant environment map. It solves the radiative transfer equation for a complex system.
- Item 1
- Item 2
- Item 3
- Item 4
-
class
librad.
Case
(casename='', filename=None, optionlist=None)[source]¶ Class which encapsulates a run case of libRadtran/uvspec. This class has methods to read libRadtran/uvspec input files, write uvspec input files, run uvspec in parallel on multiple compute nodes and read uvspec output files. An important use-case is that of reading a uvspec input file called the “base case”, altering the parameters of particular option keywords and then running the case and reading the outputs. This class is also used by the RadEnv class which encapsulates a radiant environment. Construction of radiant environment maps typically requires running an array of librad.Case instances.
Instantiate a libRadtran/uvspec case, typically by reading a uvspec .INP file.
Parameters: - casename – A user-defined name for the libRadtran/uvspec case
- filename – An optional filename from which to read the libRadtran/uvspec input
- optionlist – A list of option keywords and parameteres (tokens). The keyword existence is verified. Besides that, no error checking is performed automatically.
Returns: None
>>> # Read a libRadtran/uvspec case from a .INP file and display the expanded input >>> import morticia.rad.librad as librad >>> libRadCase = librad.Case(filename='./examples/UVSPEC_AEROSOL.INP') # Read uvspec input and expand includes, if any >>> print libRadCase # This prints the uvspec input file, compare to contents of UVSPEC_AEROSOL.INP atmosphere_file ../data/atmmod/afglus.dat source solar ../data/solar_flux/atlas_plus_modtran mol_modify O3 300. DU day_of_year 170 albedo 0.2 sza 32.0 rte_solver disort number_of_streams 6 wavelength 299.0 341.0 slit_function_file ../examples/TRI_SLIT.DAT spline 300 340 1 quiet aerosol_vulcan 1 aerosol_haze 6 aerosol_season 1 aerosol_visibility 20.0 aerosol_angstrom 1.1 0.2 aerosol_modify ssa scale 0.85 aerosol_modify gg set 0.70 aerosol_file tau ../examples/AERO_TAU.DAT
-
__init__
(casename='', filename=None, optionlist=None)[source]¶ Instantiate a libRadtran/uvspec case, typically by reading a uvspec .INP file.
Parameters: - casename – A user-defined name for the libRadtran/uvspec case
- filename – An optional filename from which to read the libRadtran/uvspec input
- optionlist – A list of option keywords and parameteres (tokens). The keyword existence is verified. Besides that, no error checking is performed automatically.
Returns: None
>>> # Read a libRadtran/uvspec case from a .INP file and display the expanded input >>> import morticia.rad.librad as librad >>> libRadCase = librad.Case(filename='./examples/UVSPEC_AEROSOL.INP') # Read uvspec input and expand includes, if any >>> print libRadCase # This prints the uvspec input file, compare to contents of UVSPEC_AEROSOL.INP atmosphere_file ../data/atmmod/afglus.dat source solar ../data/solar_flux/atlas_plus_modtran mol_modify O3 300. DU day_of_year 170 albedo 0.2 sza 32.0 rte_solver disort number_of_streams 6 wavelength 299.0 341.0 slit_function_file ../examples/TRI_SLIT.DAT spline 300 340 1 quiet aerosol_vulcan 1 aerosol_haze 6 aerosol_season 1 aerosol_visibility 20.0 aerosol_angstrom 1.1 0.2 aerosol_modify ssa scale 0.85 aerosol_modify gg set 0.70 aerosol_file tau ../examples/AERO_TAU.DAT
-
alter_option
(option, origin=('user', None))[source]¶ Alter the parameters of a uvspec input option. If the option is not found, the option is appended with append_option instead.
Parameters: - option – List of keyword and tokens (parameters) to provide to the option keyword (list of strings).
- origin – A 2-tuple noting the “origin” of the change to this keyword. Default (‘user’, None)
Returns:
-
append_option
(option, origin=('user', None))[source]¶ Append a libRadtran/uvspec options to this uvspec case. It will be appended at the end of the file
Parameters: - option – A list containing the keyword and keyword parameters (tokens)
- origin – A 2-tuple giving the origin of the option and a “line number” reference. Default (‘user’, None)
uvspec options. :return:
-
del_option
(option, all=True)[source]¶ Delete a uvspec input option matching the given option.
Parameters: - option – Keyword of option to be deleted
- all – A flag indicating if all matching options must be deleted or only the first occurrence. The
default is to delete all matching occurrences. :return: True if an option was deleted or False if not
-
distribute_flux_data
(fluxdata)[source]¶ Distribute flux/user data read from uvspec output file to various data fields. This method will look at output_user options and attempt to assign flux/user data in a sensible way. .. note:
There are potentially uvspec output formats that are not possible to process or to assign correctly. These are typically cases in which it is not possible to determine from the .INP and/or .OUT file how this data should be assigned.
Parameters: fluxdata – Flux (irradiance) data read from uvspec output file Returns: None
-
irrad_units_str
(latex=False)[source]¶ Provide an irradiance units string e.g. W/m^2/nm. If output_quantity is set to ‘brightness’ or ‘reflectivity’, irrad_units will be ‘K’ or ‘’ respectively.
Returns: Irradiance units as a string
-
prepare_for_keyword
(keyword, tokens)[source]¶ Make any possible preparations for occurrences of particular keywords :param keyword: The uvspec option keyword (string) :param tokens: The parameters (tokens) for the keyword as a list of strings :return:
-
prepare_for_mol_abs_param
(tokens)[source]¶ Make preparations for the desired molecular absorption parametrization. There are various molecular absorption options in libRadtran/uvspec and the options will certainly evolve. The default mode is to perform a spectral calculation (fine wavelength grid) with output of spectral radiances and irradiances. Some of the other modes, such as crs also output spectral data. The crs mode actually switches off molecular line absorption and considers only spectrally continuous scattering and absorption. This is really only good for the UV/blue spectrum. The reptran_channel mode and the correlated-k modes (kato variants, fu, avhrr_kratz and lowtran/sbdart) do not produce spectral radiances and irradiances. They produce band quantities which may even be summed using the output_process sum directive. A sub-range of correlated-k bins/channels can be selected using the wavelength_index directive.
See the libRadtran manual for further information on the relevant options. :return:
-
prepare_for_output_process
(tokens)[source]¶ Prepare for effects of the output_process keyword in the libRadtran/uvspec input file.
Parameters: tokens – Keyword tokens of the uvspec output_process keyword. Returns:
-
prepare_for_source
(tokens)[source]¶ Prepare for source, particularly units of various kinds, depending on the source. libRadtran/uvspec source options are mainly ‘solar’ and ‘thermal’ with some additional options for units.
Parameters: tokens – uvspec ‘source’ keyword option parameters (tokens) Returns: None
-
process_outputs
()[source]¶ Process outputs from libRadtran into moglo.Scalar and xray.DataArray objects. Currently only radiance outputs are processed, along with a few typical flux outputs, such as edir.
Note that this method probably does not cover all libRadtran/uvspec inputs and outputs and will most likely continue to evolve, perhaps breaking existing code. :return: None
-
rad_units_str
(latex=False)[source]¶ Provide a radiance units string e.g. W/sr/m^2/nm. If output_quantity is set to ‘brightness’ or ‘reflectivity’, rad_units will be ‘K’ or ‘’ respectively.
Returns: Radiance units as a string
-
static
read
(path, includes_seen=[])[source]¶ Reads a libRadtran input file. This will construct the libRadtran case from the contents of the .INP file Adapted from code by libRadtran developers.
Parameters: - path – File path from which to read the uvspec input
- includes_seen – List of files already included (for recursion purposes to avoid infinite include loops)
Returns: data, line_nos, path where data is the full data in the file with includes, line_nos shows the source of every line and path is the path to the main input file.
-
readout
(filename=None)[source]¶ Read uvspec output and assign to variables as intelligently as possible.
- The general process of reading is:
- If the user has specified output_user, just assume a flat file and read using np.loadtxt or np.genfromtxt.
- If not user_output and the solver has no radiance blocks, assume a flat file and read using np.loadtxt. The variables to be read should be contained in the self.fluxline attribute.
- Otherwise, if the output has radiance blocks, read those depending on the radiance block format for the specific solver. Keep reading flux and radiance blocks until the file is exhausted.
Once the data has all been read, the data is split up between the number of output levels and number of wavelengths. For radiance data, the order of numpy dimensions is umu, phi, wavelength, zout and stokes. That is, if a case has multiple zenith angles, multiple azimuth angles, multiple wavelengths and multiple output levels, the radiance property uu will have 4 dimensions. In the case of polradtran, there will be 5 dimensions to include the stokes parameters (if more than 1, which is the I = intensity parameter).
Output from uvspec depends on the solver and a number of other inputs, including the directive
output_user`. For the solvers ``disort
,sdisort
,spsdisort
and presumably alsodisort2
, the irradiance (flux) outputs default tolambda edir edn eup uavgdir uavgdn uavgup
If radiances (intensities) have been requested with the umu (cosine zenith angles input), each line of flux data is followed by a block of radiance data as follows:
umu(0) u0u(umu(0)) umu(1) u0u(umu(1)) . . . . . . . . umu(n) u0u(umu(n))
where u0u is the azimuthally averaged radiance for the requested zenith angles.
If azimuth angles (phi) have also been specified, then the radiance block is extended as follows:
phi(0) ... phi(m) umu(0) u0u(umu(0)) uu(umu(0),phi(0)) ... uu(umu(0),phi(m)) umu(1) u0u(umu(1)) uu(umu(1),phi(0)) ... uu(umu(1),phi(m)) . . . . . . . . umu(n) u0u(umu(n)) uu(umu(n),phi(0)) ... uu(umu(n),phi(m))
Radiance outputs are not affected by output_user options.
For the polradtran solver, the flux block is as follows:
lambda down_flux(1) up_flux(1) ... down_flux(iS) up_flux(iS)
where iS is the number of Stokes parameters specified using the ‘polradtran nstokes’ directive.
The u0u (azimuthally averaged radiance) is always zero for polradtran.
For the two-stream solver (twostr), the flux block is
lambda edir edn eup uavg
The directive keyword
brightness
can also change output. The documentation simply states that radiances and irradiances are just converted to brightness temperatures.The keyword directive
zout
and it’s parameters will influence output format as well. In general the output is repeated for each given value ofzout
orzout_sea
.The keyword directive
output
and its parameters will also have a major effect.The
output sum
keyword sums output data over the wavelength dimension. This in contrast tooutput integrate
, which performs a spectral integral.The keyword directive
header
should not be used at all. This produces some header information in the output that will cause errors. A warning is issued of theheader
keyword is used in the input.Parameters: filename – File from which to read the output. Defaults to name of input file, but with the .OUT extension. :return: None
-
run
(stderr_to_file=False, write_input=True, read_output=True, block=True, purge=True)[source]¶ Run the libRadtran/uvspec case.
This will run the libRadtran/uvspec Case instance provided. Some control is provided regarding the handling of the standard error output from uvspec. This function only returns when uvspec terminates.
Parameters: - stderr_to_file – Controls whether standard error output goes to the screen or is written to a file having the same name as the input/output files, except with the extension .ERR.
- write_input – Controls whether the input file is written out before execution. Default is True.
- read_output – Controls whether the output file is read after execution. Default is True.
- block – By default, this method waits until uvspec terminates. If set False, the uvspec process is released to background and read_output is set to False (regardless of user input).
- purge – If set True, the input and output files from this run will be deleted after the run is complete and the outputs have been read. Will only be honoured if read_output is also True. Default is True.
Returns: The shell command string executed in order to run the case and the return status of the command.
-
class
librad.
RadEnv
(base_case, n_pol, n_azi, mxumu=48, mxphi=19, hemi=False, n_sza=0)[source]¶ RadEnv is a class to encapsulate a large number of uvspec runs to cover a large number of sightlines over the whole sphere. A radiance map over the complete sphere is called a radiant environment map. The uvspec utility can only handle a limited number of sighlines per run, determined by the maximum number of polar and azimuthal angles specified in the file /libsrc_f/DISORT.MXD. If these values are changed, DISORT and uvspec must be recompiled. If the values are set too large, the memory requirements could easily exceed your computer’s limit (there is currently no dynamic memory allocation in DISORT). The situation for the cdisort solver is less clear.
Note
The polradtran radiative transfer (RT) solver does not produce direct irradiance outputs (edir), This presents a problem for calculation of path transmission (optical depth) between output atmospheric levels (e.g. as specified by the uvspec zout keyword). This solver only produces total fluxes (irradiances) for each of desired stokes parameters. Hence for calculation of polarised radiant environment maps (REMs), the only feasible option for MORTICIA is to use the mystic solver with the mc_polarisation option. Currently, the librad.Case uvspec output file reading functions do not cater for mystic.
Create a set of uvspec runs covering the whole sphere to calculate a full radiant environment map. Where the base_case is the uvspec case on which to base the environmental map, Name is the name to give the environmental map and n_pol and n_azi are the number of polar and azimuthal sightline angles to generate. The mxumu and mxphi are the maximum number of polar and azimuth angles to calculate in a single run of uvspec. The default values are mxumu = 48, and mxphi = 19. These values are taken from the standard libRadtran distribution (/libsrc_f/DISORT.MXD) maximum parameter file. If using the polradtran solver, the corresponding file is /libsrc_f/POLRADTRAN.MXD. Other solvers may have different restrictions. A warning will be issued if the solver is not in the DISORT/POLRADTRAN family.
Parameters: - base_case –
librad.Case object providing the case on which the environment map is to be based. Note that not any basecase can be used. As a general guideline, the basecase should have standard irradiance outputs (i.e. should not use the output_user keyword). It should also not the use output_process or output_quantity keywords, which change the units and/or format of the libRadtran/uvspec output.
Minimal validation of the basecase is performed. However, use with mol_abs_param such as kato and fu is important for MORTICIA and these are supported (k-distribution or correlated-k parametrizations). - n_pol – Number of polar angles (view/propagation zenith angles)
- n_azi – Number of azimuthal angles.
- mxumu – Maximum number of polar angles per case.
- mxphi – Maximum number of azimuthal angles per case.
- hemi – If set True, will generate only a single hemisphere being on one side of the solar principle plane. Default is False i.e. the environment map covers the full sphere. Note that if hemi=True, the number of REM samples in azimuth becomes n_azi \(\times\) 2. This is the recommended mode (hemi=True) for MORTICIA purposes, since it reduces execution time.
- n_sza – The number of solar zenith angles (SZA) at which to perform transmittance and path radiance computations. Each SZA will result in another run of the base case (no radiances)
The solver cdisort may have dynamic memory allocation, so the warning is still issued because the situation is less clear.
A note about radiative propagation angles and viewing angles, which are 180 deg opposite to each other. For radiance calculations define the cosine of the viewing zenith angle umu and the sensor azimuth phi and don’t forget to also specify the solar azimuth phi0. umu > 0 means sensor looking downward (e.g. a satellite), umu < 0 means looking upward. phi = phi0 indicates that the sensor looks into the direction of the sun, phi - phi0 = 180 means that the sun is in the back of the sensor.
phi is the propagation azimuth angle paz, except that paz is in radians and phi is in degrees.
pza is the propagation zenith angle in radians.
vaz is the view azimuth angle and is 180 \(^\circ\) different from paz. vaz is expressed in degrees. vza, the view zenith angle is 180 \(^\circ\) different from paz’ and is expressed in degrees. In order to keep all azimuth angles in increasing order, ‘vaz’ is in the range [-180, 180], while `phi is in the range [0, 360] and vaz = phi - 180.
The value of umu is the cosine of the propagation zenith angle. The value of phi is the true azimuth of the propagation direction.
For all one-dimensional solvers the absolute azimuth does not matter, but only the relative azimuth phi - phi0.
For MORTICIA work, it is strongly recommended that the hemi flag be set True. This will automatically set the phi0 keyword to zero in the RadEnv cases when running uvspec. This will essentially halve the execution time for radiant environment maps of the same effective spatial resolution.
-
__init__
(base_case, n_pol, n_azi, mxumu=48, mxphi=19, hemi=False, n_sza=0)[source]¶ Create a set of uvspec runs covering the whole sphere to calculate a full radiant environment map. Where the base_case is the uvspec case on which to base the environmental map, Name is the name to give the environmental map and n_pol and n_azi are the number of polar and azimuthal sightline angles to generate. The mxumu and mxphi are the maximum number of polar and azimuth angles to calculate in a single run of uvspec. The default values are mxumu = 48, and mxphi = 19. These values are taken from the standard libRadtran distribution (/libsrc_f/DISORT.MXD) maximum parameter file. If using the polradtran solver, the corresponding file is /libsrc_f/POLRADTRAN.MXD. Other solvers may have different restrictions. A warning will be issued if the solver is not in the DISORT/POLRADTRAN family.
Parameters: - base_case –
librad.Case object providing the case on which the environment map is to be based. Note that not any basecase can be used. As a general guideline, the basecase should have standard irradiance outputs (i.e. should not use the output_user keyword). It should also not the use output_process or output_quantity keywords, which change the units and/or format of the libRadtran/uvspec output.
Minimal validation of the basecase is performed. However, use with mol_abs_param such as kato and fu is important for MORTICIA and these are supported (k-distribution or correlated-k parametrizations). - n_pol – Number of polar angles (view/propagation zenith angles)
- n_azi – Number of azimuthal angles.
- mxumu – Maximum number of polar angles per case.
- mxphi – Maximum number of azimuthal angles per case.
- hemi – If set True, will generate only a single hemisphere being on one side of the solar principle plane. Default is False i.e. the environment map covers the full sphere. Note that if hemi=True, the number of REM samples in azimuth becomes n_azi \(\times\) 2. This is the recommended mode (hemi=True) for MORTICIA purposes, since it reduces execution time.
- n_sza – The number of solar zenith angles (SZA) at which to perform transmittance and path radiance computations. Each SZA will result in another run of the base case (no radiances)
The solver cdisort may have dynamic memory allocation, so the warning is still issued because the situation is less clear.
A note about radiative propagation angles and viewing angles, which are 180 deg opposite to each other. For radiance calculations define the cosine of the viewing zenith angle umu and the sensor azimuth phi and don’t forget to also specify the solar azimuth phi0. umu > 0 means sensor looking downward (e.g. a satellite), umu < 0 means looking upward. phi = phi0 indicates that the sensor looks into the direction of the sun, phi - phi0 = 180 means that the sun is in the back of the sensor.
phi is the propagation azimuth angle paz, except that paz is in radians and phi is in degrees.
pza is the propagation zenith angle in radians.
vaz is the view azimuth angle and is 180 \(^\circ\) different from paz. vaz is expressed in degrees. vza, the view zenith angle is 180 \(^\circ\) different from paz’ and is expressed in degrees. In order to keep all azimuth angles in increasing order, ‘vaz’ is in the range [-180, 180], while `phi is in the range [0, 360] and vaz = phi - 180.
The value of umu is the cosine of the propagation zenith angle. The value of phi is the true azimuth of the propagation direction.
For all one-dimensional solvers the absolute azimuth does not matter, but only the relative azimuth phi - phi0.
For MORTICIA work, it is strongly recommended that the hemi flag be set True. This will automatically set the phi0 keyword to zero in the RadEnv cases when running uvspec. This will essentially halve the execution time for radiant environment maps of the same effective spatial resolution.
- base_case –
-
compute_path_radiance
()[source]¶ Compute path radiances for path segments between all altitudes in the REM. The path transmittances (optical depth) as well as the total radiances at each altitude are required to calculate path radiances. If \(L_{pi}^{\downarrow}\) is the downwelling path radiance at level \(i\) originating between level \(i\) and level \(i+1\) and \(L_{pi}^{\uparrow}\) is the upwelling path radiance at level \(i\) originating between level \(i\) and level \(i-1\), then
\[L_{pi}^{\downarrow}=L_{i}^{\downarrow}-L_{i+1}^{\downarrow}\tau_{i+1}^{\downarrow},\]and
\[L_{pi}^{\uparrow}=L_{i}^{\uparrow}-L_{i-1}^{\uparrow}\tau_{i-1}^{\uparrow}.\]\(L_{i}^{\uparrow}\) is the lower hemisphere (upwelling hemisphere) of the REM and \(\tau_{i}^{\uparrow}\) is the transmission between level \(i\) and level \(i+1\).
See also
RadEnv.compute_path_transmittance()
Returns: None
-
compute_path_transmittance
()[source]¶ Compute path transmittances from the set of libRadtran/uvspec runs executed for solar zenith angles of 0 to near 90 degrees.
This method computes optical depth (-log(transmittance)) of all paths from a particular level, both upward and downward. Paths that lie in the horizontal “blind zone” are assigned OD of 0.0. These should actually be assigned OD of np.nan or perhaps np.inf.
See also
RadEnv.setup_trans_cases()
Returns: None
-
run_ipyparallel
(ipyparallel_view, stderr_to_file=False)[source]¶ Run a complete set of radiant environment map cases of libRadtran/uvspec using the ipyparallel Python package, which provides parallel computation from Jupyter notebooks and other Python launch modes. Typical code for setting up the view:
from ipyparallel import Client paraclient = Client(profile='mycluster'<EMAIL_ADDRESS>password='mypassword') paraclient[:].use_dill() # Need dill as a pickle replacement for our purposes here ipyparallel_view = paraclient.load_balanced_view() ipyparallel_view.block = True # Must wait for completion of all tasks on the cluster
Note that if new ipengines are started, use_dill() must be executed again. The use_dill() call should be a routine before every function map to the cluster.
Parameters: - ipyparallel_view – an ipyparallel view of a Python engine cluster (see ipyparallel documentation.)
- stderr_to_file – If set to True, standard error output will be sent to a file. use only for debugging purposes.
Returns:
-
run_parallel
(n_nodes=4)[source]¶ Run the RadEnv in multiprocessing mode on the local host.
This is not yet tested, but should work with the multiprocessing package on the local host to use all the available cores. Will only work if libRadtran is installed on the local host.
In order to use dill instead of pickle, it is necessary to use the pathos multiprocessing module instead of the standard multiprocessing module
Parameters: n_nodes – Number of compute nodes to use. Default is 4. Preferably set to number of cores you have available on the local host. Returns:
-
setup_trans_cases
(n_sza=32)[source]¶ Setup a list of cases for computing the transmission matrices between every level defined in the REM (and at every wavelength and stokes parameter combination). The computation of transmittance between levels is accomplished in MORTICIA using libRadtran/uvspec by computing the direct solar irradiance transmittance for multiple zenith angles.
Note that if there is an optically thick cloud layer between two levels in the REM, the transmittance will compute as zero or very small. This will also result in the incorrect/noisy computation of path radiances between the two levels. This situation is unavoidable. The recommended approach is that REMS be computed with altitude levels that all lie between cloud layers (i.e. no levels in the REM span a cloud layer). The user, or the code which uses the REMs should see to this. Essentially it must be recognised that optical surveillance is not possible through optically thick cloud layers.
The REM is provided with a cloud flag that indicates if the base case incorporates clouds. The approach to computing inter-level transmittance (optical depth is the stored parameter, since this scales more closely in a linear fashion with distance) in the presence of cloud is to vary the ‘cloudcover’ keyword parameter (water and ice clouds independently). This is done for solar zenith angle of zero. The optical thickness from TOA to the level in question is then computed as a function of cloud cover fraction (CCF). The optical depth between levels (i.e the optical depth of a layer between two levels) is computed as the difference in optical depth to TOA of the lower level minus the optical depth to TOA of the upper level. If there is no difference in the layer optical depth when the CCF is varied from zero to some positive value (say 0.1, but not as high as 1), then the layer is free of cloud.
A flag per layer is thus obtained which indicates if the layer contains cloud. If it does, the transmittance will compute as zero between the two levels in question. This means that the cloud base is not resolved to better than the level resolution in the REM. It is probably then quite important to ensure that cloud base altitude statistics are available in the theatre climatology.
An upgrade to cloud handling could be to read the cloud profile files in order to obtain the exact vertical location of the cloud layers.
Another inherent and unavoidable problem with computation of path optical depths and radiances using libRadtran/uvspec is that precisely horizontal paths cannot be dealt with using one-dimensional RT solvers. Therefore in this case, the maximum range that can be dealt with depends on the height difference between the REM levels and the maximum solar zenith angle (SZA) used for computation of optical depth.
A further implication of the above point is that path transmittances and path radiances cannot be interpolated between the SZA nearest the horizon and the horizon proper. Some form of logarithmic extrapolation could be performed, but could result in large errors due to failure of Beer’s Law and other problems.
Execution and attribution of transmittance cases will provide each level with transmittance to the level above that altitude level. Therefore the topmost level will have transmittances to TOA, but the bottom level will not have transmittances (optical depths) to BOA, unless the bottom level is BOA. It is recommended that all MORTICIA base cases for REM include BOA as an output level.
Parameters: n_sza – The number of solar zenith angles at which to compute path optical depth and radiances. the SZA values are computed equi-spaced in the cosine of the solar zenith angle rather that the SZA itself. This is to help with the problem that the slant range between levels increases in linear relation to the secant of the view zenith angle. The optical depths are later interpolated to the same Returns:
-
sph_harm_fat
(degree)[source]¶ This code was used for debugging purposes - ignore :param degree: :return:
-
sph_harm_fit
(degree, method='trapz')[source]¶ Fit spherical harmonics to the radiant environment map (REM). One set of coefficients per wavelength or spectral channel will be fitted. The coefficients for each spectral bin/channel comprise one coefficient for order \(-m\) to \(+m\) for \(m = 0, 1, 2, ..., n\). The total number of coefficients is \((n+1)^2\).
The convention used for the spherical harmonics is that of Sloan with the Ramamoorthi and Hanrahan normalization. This is a real-valued basis defined as follows:
\[\begin{split}y_{n}^{m}=\begin{cases} (-1)^{m}\sqrt{2}\Re(Y_{n}^{m}) & m>0\\ (-1)^{m}\sqrt{2}\Im(Y_{n}^{m}) & m<0\\ Y_{n}^{0} & m=0 \end{cases}=\begin{cases} (-1)^{m}\sqrt{2}\cos m\phi\,P_{n}^{m}(\cos\theta) & m>0\\ (-1)^{m}\sqrt{2}\sin|m|\phi\,P_{n}^{|m|}(\cos\theta) & m<0\\ K_{n}^{0}P_{n}^{0}(\cos\theta) & m=0 \end{cases},\end{split}\]where the complex basis functions \(Y^{m}_{n}\) are defined as:
\[Y_{n}^{m}(\theta,\phi)=K_{n}^{m}e^{im\phi}P_{n}^{|m|}(\cos\theta),\,n\in\mathbf{N},\,-n\leq m\leq n,\]having the normalisation factor of:
\[K_{n}^{m}=\sqrt{\frac{(2n+1)(n-|m|)!}{4\pi(n+|m|)!}}.\]The definition of the complex basis functions is consistent with the scipy.special definition of the spherical harmonics. Therefore, for fitting of the Sloan/Ramamoorthi/Hanrahan basis, the first definition is used above, that is \(y_{n}^{m}\) can be calculated from the scipy.special function \(Y_{n}^{m}\) as:
\[\begin{split}y_{n}^{m}=\begin{cases} (-1)^{m}\sqrt{2}\Re(Y_{n}^{m}) & m>0\\ (-1)^{m}\sqrt{2}\Im(Y_{n}^{m}) & m<0\\ Y_{n}^{0} & m=0 \end{cases}.\end{split}\]The fitted coefficients of the spherical harmonics are computed by multiplying the REM by each of the harmonics and performing double numerical integration over zenith and azimuth angle as:
\[L_{n}^{m}=\int_{\theta=0}^{\pi}\int_{\phi=0}^{2\pi}L(\theta,\phi)y_{n}^{m}(\theta,\phi)\sin\theta d\theta d\phi,\]where \(L_{n}^{m}\) are the coefficients and \(L(\theta,\phi)\) is the REM.
Parameters: - degree – Spherical harmonics up to this degree \(n\), for all orders \(m\) will be fitted.
- method – Integration method by which the coefficients are computed. ‘trapz’ for trapezoidal integration, ‘sum’ for simple summation and ‘simpson’ for Simpson’s Rule. The ‘trapz’ method seems to be considerably more accurate than ‘sum’ or ‘simpson’. Therefore ‘trapz’ is the default.
Returns:
- base_case –
Radiometric Utilities Module¶
The radiometric utilitties module, radute contains utility code for handling of radiometric quantities. This includes a class Flt for reading, writing, creating and plotting of MODTRAN-style .flt (spectral response/filter function) files.
-
class
radute.
Flt
(name, units='nm', filterheaders=[], filters=[], centers=[], fwhms=[], shapes=['gauss'], yedges=[0.001], centerflats=[0.0], peakvals=[1.0], wvmins=[], wvmaxs=[], oobs=[4.9406564584124654e-324])[source]¶ Encapsulates a MODTRAN-style .flt spectral response function/filter function definition file.
Create a filter definition object (MODTRAN flt style) Input name is mandatory. All other inputs are optional, but the filterheaders list must have the same number of string elements as the number of filters. Also, either the filters are given explicitly in the filters input, or a list of filter definitions are provided for use with rad.srfgen(). If not empty, inputs centers through to oobs must be either scalar or have the same number of list elements as the filterheaders list. If scalar, the value will be replicated up to the number of filterheader values.
Parameters: - name – Name of the set of filters. If the filterheaders input to this constructor function is empty, an attempt will be made to read the data from a file called name + ‘.flt’
- units – Spectral coordinate units for the filter, ‘nm’, ‘um’ or ‘cm^-1’
- filterheaders – List of strings, one header for each filter/SRF in the set.
- filters – A list of numpy arrays. Each list element must comprise a 2-column numpy array with the spectral coordinate (wavelength in nm or micron or wavenumber per cm) in the first column and the filter magnitude in the second column.
- centres – rather than provide filters, the inputs to rad.srfgen can be provided, this is a list of center wavelengths in nm
- fwhms – list of full width at half maximum in nm
- shapes – list of strings providing the shapes of the filters (see rad.srfgen for alternatives)
- yedges – list of yedge values (see rad.srfgen)
- centerflats – list of centerflat values (see rad.srfgen). Note that giving a centerflat value adds this amount ot the fwhm of the filters (broadens the resulting width to centerflat + fwhm)
- peakvals – list of peak values of the filters
- wvmins – list of minimum wavelength limits in nm
- wvmaxs – list of maximum wavelength limits in nm
- oobs – list of out-of-band leakage values
Returns: MODTRAN-style filter/SRF object
-
__init__
(name, units='nm', filterheaders=[], filters=[], centers=[], fwhms=[], shapes=['gauss'], yedges=[0.001], centerflats=[0.0], peakvals=[1.0], wvmins=[], wvmaxs=[], oobs=[4.9406564584124654e-324])[source]¶ Create a filter definition object (MODTRAN flt style) Input name is mandatory. All other inputs are optional, but the filterheaders list must have the same number of string elements as the number of filters. Also, either the filters are given explicitly in the filters input, or a list of filter definitions are provided for use with rad.srfgen(). If not empty, inputs centers through to oobs must be either scalar or have the same number of list elements as the filterheaders list. If scalar, the value will be replicated up to the number of filterheader values.
Parameters: - name – Name of the set of filters. If the filterheaders input to this constructor function is empty, an attempt will be made to read the data from a file called name + ‘.flt’
- units – Spectral coordinate units for the filter, ‘nm’, ‘um’ or ‘cm^-1’
- filterheaders – List of strings, one header for each filter/SRF in the set.
- filters – A list of numpy arrays. Each list element must comprise a 2-column numpy array with the spectral coordinate (wavelength in nm or micron or wavenumber per cm) in the first column and the filter magnitude in the second column.
- centres – rather than provide filters, the inputs to rad.srfgen can be provided, this is a list of center wavelengths in nm
- fwhms – list of full width at half maximum in nm
- shapes – list of strings providing the shapes of the filters (see rad.srfgen for alternatives)
- yedges – list of yedge values (see rad.srfgen)
- centerflats – list of centerflat values (see rad.srfgen). Note that giving a centerflat value adds this amount ot the fwhm of the filters (broadens the resulting width to centerflat + fwhm)
- peakvals – list of peak values of the filters
- wvmins – list of minimum wavelength limits in nm
- wvmaxs – list of maximum wavelength limits in nm
- oobs – list of out-of-band leakage values
Returns: MODTRAN-style filter/SRF object
-
static
checkparm
(parmname, parm, nfilters)[source]¶ Input parameter checking for Flt constructor
Parameters: - parmname – Name of parameter fpr checking
- parm – Parameter value
- nfilters – Number of filters
Returns: Checked parameter
-
flt_as_xd
()[source]¶ Convert an Flt class object to a list of xray DataArray objects
Returns: The set of Flt filters as a list of xray DataArray objects, with a wavelength coordinate axis (‘wvl’, long_name = ‘Wavelength’
-
flt_as_xd_harmonised
(quantity_name='srf', chn_start_index=0)[source]¶ Convert the Flt class object into a single, wavelength-harmonised xray.DataArray.
Parameters: - quantity_name – The name of the quantity as defined the long_names variable in moglo.py. Defaults to ‘srf’, a Spectral Response Function, but could also be a transmission functions ‘trn’ or other spectral quantity known to moglo.py.
- chn_start_index – Use this parameter to select the starting channel number. Defaults to zero.
Returns: The set of Flt filters as a single, wavelength-harmonised xray.DataArray object. The filter headers are returned in an attribute called ‘labels’. The fileheader of the Flt object is returned in an attribute called ‘title’ (netCDF recommendation)
-
read
(filename, name='Unknown')[source]¶ Read a .flt format spectral band filter definitions file (MODTRAN format)
Parameters: filename – Returns: object of class Flt, if the file is a well-formatted MODTRAN-style .flt file
-
write
(filename=None, format=' %f')[source]¶ Write a MODTRAN-style .flt file for this filter/SRF set
Parameters: - filename – Optional filename without extension. If not given, the filter name will be used with
- format – Format specifier as for np.savetext for writing the data, default is ‘ %f’ extension .flt
Returns: None
-
class
radute.
SpectralChannel
(sdf=None, group='', channels='all')[source]¶ The SpectralChannel class defines any band-limited spectral distribution function. This could be the spectral response functions of a sensor, or the spectral transmittance of an optical filter, the spectral radiance, irradiance or any other band-limited spectral quantity. The actual spectral distribution function is represented by an xray.DataArray object with a wavelength axis in preferred units of ‘nm’.
SpectralChannels is a list of channels that can be indexed in the usual way, by the global channel index
Create one or a group of spectral distribution functions
Parameters: - sdf – The spectral distribution function as an xray.DataArray object.
- group –
- channels –
Returns:
-
radute.
srfgen
(center, fwhm, n=101, shape='gauss', yedge=0.001, wvmin=None, wvmax=None, centerflat=0.0, oob=4.9406564584124654e-324, peakval=1.0, units='nm')[source]¶ Generate a spectral filter or spectral response function of various shapes
Parameters: - center – center wavelength of the filter in nm
- fwhm – full width at half maximum of the filter in nm
- n – number of spectral samples in the filter (minimum of 3, default 101), should be odd
- shape – filter shape, one of ‘gauss’, ‘bartlett’, ‘welch’, ‘cosine’, ‘box’, ‘cos^2’ (default ‘gauss’)
- yedge – minimum y-value at the limits of the filter (default 0.001). No filter values below this threshold
- wvmin – extend spectral definition by adding a single point at (wvmin, oob)
- wvmax – exptend spectral definition by adding a single point at (wvmax, oob)
- centerflat – opens a flat region in the centre of filter having a width of centerflat nm
- oob – out-of-band leakage, default 0.0, must be <= yedge
- peakval – simply scales the peak of the filter function to this value (default 1.0)
- units – spectral axis units, either ‘nm’, ‘cm^-1’ or ‘um’ (nanometers, wavenumber per cm or microns) will be returned
Returns: wvlnm, y, wvn, wvlum (wavelengths in nm, filter values, wavenumbers per cm and wavelengths in microns)
-
radute.
tophat
(center, fwhm, delta=0.0, wvmin=None, wvmax=None, oob=0.0, units='nm')[source]¶ Return tophat/box filter defined by 6 points Can also specify out-of-band values and extreme limits, which adds upper and lower bound points
Parameters: - center – center wavelength in nm
- fwhm – full width at half max in nm
- delta – smallest x-coordinate increment, default see np.nextafter
- wvmin – minimum wavelength to reach default None
- wvmax – maximum wavelength to reach default None
- oob – out-of-band leakage
- units – spectral axis units, either ‘nm’, ‘cm^-1’ or ‘um’ (nanometers, wavenumber per cm or microns) will be returned
Returns: wvlnm, y, wvn, wvlum (wavelengths in nm, filter values, wavenumbers per cm and wavelengths in microns)
Scene Package¶
The Scene package provides all MORTICIA functionality relating to radiometry and atmospheric radiative transfer. Atmospheric radiative transfer is performed by the libRadtran suite of tools.
Target Module¶
The Target module concerns itself with calculations for rendering a target
- Greyscale Beach Target
- Target 2
- Target 3


Saira Kazmi is currently working as
the Scientific Data Architect for the Research Information
Technologies group at The Jackson
Laboratory for Genomic Medicine in Farmington,
Connecticut. She loves working with high dimensional data; and
enjoys designing and implementing solutions for problems that are
associated with generating, storing and analyzing large amounts of
data. She received her Ph.D. in Computer Science with a focus in
Bioinformatics from the University of Connecticut and her post
doctoral training in Medical Informatics is from Yale University.