Widget:SPIM Calculator

lambda  (&times;10-6) wavelength n  refraction index of the medium after the illumination objective db  beam diameter before the first telescope ah  horizontal slit av  vertical slit fill  focal length of the illumination lens fcyl  focal length of the cylindrical lens mag1  magnification of first telescope <span class="param_label">mag2 <input onkeyup="run;" type="text" class="numeric" id="mag2" name="mag2" size="4" value="1" /> magnification of second telescope <span class="param_label">MDetmin <input onkeyup="run;" type="text" class="numeric" id="MDetmin" name="MDetmin" size="4" value="20" /> min magnification of detection objective <span class="param_label">MDetmax <input onkeyup="run;" type="text" class="numeric" id="MDetmax" name="MDetmax" size="4" value="20" /> max magnification of detection objective <span class="param_label">HCCD <input onkeyup="run;" type="text" class="numeric" id="HCCD" name="HCCD" size="4" value="3.6" /> height of the CCD chip <span class="param_label">WCCD <input onkeyup="run;" type="text" class="numeric" id="WCCD" name="WCCD" size="4" value="4.8" /> width of the CCD chip minT = maxT = Mtelescope1 = Mtelescope2 =

function init { }

function toFixed( value, precision ) {       var power = Math.pow( 10, precision || 0 ); return ( Math.round ( value * power ) / power ).toFixed( precision ); }

function set_result( id, v ) {       var elem = document.getElementById( id ); if ( elem.firstChild ) elem.removeChild( elem.firstChild ) elem.appendChild( document.createTextNode( "" + v ) ); }

function compute_minT( db, fill, fcyl, av, HCCD, MDetmin, mag1 ) {       return db * ( fill / fcyl ) * ( av / HCCD ) * MDetmin * mag1; }

function compute_maxT( db, fill, ah, lambda, n, WCCD, MDetmax, mag1 ) {       return ( ( 2.0 * fill ) / ( db * ah ) ) * Math.sqrt( ( 2.0 * lambda ) / ( n * Math.PI * WCCD ) ) * ( ( Math.sqrt( MDetmax ) ) / mag1 ); }

function compute_Mtelescope1( db, fill, fcyl, av, HCCD, MDetmin, mag2 ) {       return ( mag2 / MDetmin ) * ( fcyl / fill ) * ( HCCD / av * db ); }

function compute_Mtelescope2( db, fill, fcyl, av, ah, lambda, n, WCCD, HCCD, MDetmin, MDetmax, mag1 ) {       return Math.sqrt( compute_minT( db, fill, fcyl, av, HCCD, MDetmin, mag1 ) * compute_maxT( db, fill, ah, lambda, n, WCCD, MDetmax, mag1 ) ); }

function run {       var lambda = parseFloat( document.getElementById( 'lambda' ).value ) * 1e-6; var n = parseFloat( document.getElementById( 'n' ).value ); var db = parseFloat( document.getElementById( 'db' ).value ); var ah = parseFloat( document.getElementById( 'ah' ).value ); var av = parseFloat( document.getElementById( 'av' ).value ); var fill = parseFloat( document.getElementById( 'fill' ).value ); var fcyl = parseFloat( document.getElementById( 'fcyl' ).value ); var mag1 = parseFloat( document.getElementById( 'mag1' ).value ); var mag2 = parseFloat( document.getElementById( 'mag2' ).value ); var MDetmin = parseFloat( document.getElementById( 'MDetmin' ).value ); var MDetmax = parseFloat( document.getElementById( 'MDetmax' ).value ); var HCCD = parseFloat( document.getElementById( 'HCCD' ).value ); var WCCD = parseFloat( document.getElementById( 'WCCD' ).value ); var minT = compute_minT( db, fill, fcyl, av, HCCD, MDetmin, mag1 ); var maxT = compute_maxT( db, fill, ah, lambda, n, WCCD, MDetmax, mag1 ); var Mtelescope1 = compute_Mtelescope1( db, fill, fcyl, av, HCCD, MDetmin, mag2 ); var Mtelescope2 = compute_Mtelescope2( db, fill, fcyl, av, ah, lambda, n, WCCD, HCCD, MDetmin, MDetmax, mag1 ); set_result( "minT", toFixed( minT, 5 ) ); set_result( "maxT", toFixed( maxT, 5 ) ); set_result( "Mtelescope1", toFixed( Mtelescope1, 5 ) ); set_result( "Mtelescope2", toFixed( Mtelescope2, 5 ) ); return; } init; run; lambda.focus;