#!/usr/bin/ruby
######## CONSTANTS ##########
$imageloc = '../images'
require 'cgi'
cgi = CGI.new("html4Fr")
if cgi['instrument']=="BOK"
@maestro_disp="1.00"
@maestro_eff="25"
@mmt_rad="230.0"
@n_rnoise="2"
@dark="0.9"
else
@maestro_disp="0.75"
@maestro_eff="50"
@mmt_rad="800.0"
@n_rnoise="3.4"
@dark="0.0"
end
cgi.out{
CGI.pretty(
cgi.html{cgi.title{"ETC Test Code"} +
cgi.head{""} +
cgi.body("bgcolor"=>"#C0C0C0","margin"=>"0px"){
"
" +
cgi.div("style"=>"margin-left:auto; margin-right:auto; width:1000px; border:10px solid black; height:720px; background-color:#20B2AA; background-image:url('#{$imageloc}/bg2.png'); background-repeat:no-repeat; background-position:0px 90px; background-size:100% 100%; "){
cgi.table( "style"=>"width:1000px; padding:0px; margin:0px; background-color:#000000;"){
cgi.tr("style"=>"width:996px; margin:0px; padding:0px;"){
cgi.td("colspan"=>"6","style"=>"width:996px; margin:0px; padding:0px;"){""+
cgi.img("src"=>"#{$imageloc}/banner.jpg","width"=>"996px","height"=>"125px","padding"=>"0px","margin"=>"0px","align"=>"center")+""}} +
cgi.tr("height"=>"50%","width"=>"100%"){
cgi.td("style"=>"background-image:url('#{$imageloc}/button1.png'); backgroundColor:'#000000'; background-size:100% 100%;", \
"height"=>"100%","align"=>"center","onmouseover"=>"style.backgroundColor='#808080'", \
"onmouseout"=>"style.backgroundColor='#000000'","width"=>"13%"){
cgi.a("href"=>"http://www.mmto.org","target"=>"_blank","style"=>"text-decoration:none"){
"MMT HOME"}} +
cgi.td("style"=>"background-image:url('#{$imageloc}/button1.png'); backgroundColor:'#000000'; background-size:100% 100%;", \
"height"=>"100%","align"=>"center","onmouseover"=>"style.backgroundColor='#808080'", \
"onmouseout"=>"style.backgroundColor='#000000'","width"=>"18%"){
cgi.a("href"=>"../MAESTRO/index.html","target"=>"_blank","style"=>"text-decoration:none"){
"MAESTRO HOME"}} +
cgi.td("style"=>"background-image:url('#{$imageloc}/button1.png'); backgroundColor:'#000000'; background-size:100% 100%;", \
"height"=>"100%","align"=>"center","onmouseover"=>"style.backgroundColor='#808080'", \
"onmouseout"=>"style.backgroundColor='#000000'","width"=>"15%"){
cgi.a("href"=>"manual.cgi","target"=>"_blank","style"=>"text-decoration:none"){
"ETC MANUAL"}} +
cgi.td("style"=>"background-image:url('#{$imageloc}/button1.png'); backgroundColor:'#000000'; background-size:100% 100%;", \
"height"=>"100%","align"=>"center","onmouseover"=>"style.backgroundColor='#808080'", \
"onmouseout"=>"style.backgroundColor='#000000'","width"=>"18%"){
cgi.a("href"=>"esotablewait.cgi?separation=0&xmin=3500.0&xmax=10000.0",
"target"=>"_blank","style"=>"text-decoration:none"){
"NIGHT SKY
MODEL SPECTRUM"}} +
cgi.td("style"=>"background-image:url('#{$imageloc}/button1.png'); backgroundColor:'#000000'; background-size:100% 100%;", \
"height"=>"100%","align"=>"center","onmouseover"=>"style.backgroundColor='#808080'", \
"onmouseout"=>"style.backgroundColor='#000000'","width"=>"24%"){
cgi.a("href"=>"http://physics.uwyo.edu/~chip/misc/Obsplan/obsplan.cgi","target"=>"_blank","style"=>"text-decoration:none"){
"CHIP KOBULNICKY'S
AIRMASS CALCULATOR"}} +
cgi.td("style"=>"background-image:url('#{$imageloc}/button1.png'); backgroundColor:'#000000'; background-size:100% 100%;", \
"height"=>"100%","align"=>"center","onmouseover"=>"style.backgroundColor='#808080'", \
"onmouseout"=>"style.backgroundColor='#000000'","width"=>"18%"){
cgi.a("href"=>"http://www.as.arizona.edu","target"=>"_blank","style"=>"text-decoration:none"){
"UA HOME"}} }} +
#Table containing Form 1
cgi.table("width"=>"100%","padding"=>"0","style"=>"margin:0px;"){
cgi.tr("height"=>"100%"){
cgi.td("cellpadding"=>"0","cellspacing"=>"0","width"=>"28%","style"=>"vertical-align: top;"){
cgi.form("ACTION" => "etc.cgi", "METHOD" => "POST","name"=>"output","target"=>"testsum","accept-charset"=>"utf-8"){
cgi.hr +
cgi.h3("ALIGN"=>"CENTER","WIDTH"=>"100%"){" Instrument: "+cgi.select("NAME"=>"instrument","onclick"=>""){
if cgi['instrument']=="BOK"
# cgi.option("VALUE"=>"BOK"){"B&C (BOK)"} +
cgi.option("VALUE"=>"MAESTRO"){"MAESTRO (MMT)"}
else
cgi.option("VALUE"=>"MAESTRO"){"MAESTRO (MMT)"}
# cgi.option("VALUE"=>"BOK"){"B&C (BOK)"}
end
}}} +
cgi.form("ACTION" => "etc_out.cgi", "METHOD" => "POST",
"name"=>"output","target"=>"content","accept-charset"=>"utf-8"){
#Table containing Form 2
cgi.table("Border"=>"0","WIDTH"=>"100%"){
cgi.tr{
cgi.td("ALIGN"=>"CENTER","WIDTH"=>"20%"){"EXPOSURE
TIME (sec)"} +
cgi.td("ALIGN"=>"CENTER","WIDTH"=>"20%"){"NUMBER of EXPOSURES"} +
cgi.td("ALIGN"=>"CENTER","WIDTH"=>"20%"){"SLIT
WIDTH"}} +
cgi.tr{
cgi.td("ALIGN"=>"CENTER","WIDTH"=>"20%"){cgi.text_field("NAME"=>"exptime","VALUE"=>"3600","style"=>"width: 70%")} +
cgi.td("ALIGN"=>"CENTER","WIDTH"=>"20%"){cgi.text_field("NAME"=>"nexp","VALUE"=>"1","style"=>"width: 70%")} +
cgi.td("ALIGN"=>"CENTER","WIDTH"=>"20%"){cgi.select("NAME"=>"slitwidth","style"=>"width: 70%"){
cgi.option("VALUES"=>"0.5"){'0.5"'} +
cgi.option("VALUES"=>"0.7"){'0.7"'} +
cgi.option("VALUES"=>"1.1","SELECTED"=>"true"){'1.1"'} +
cgi.option("VALUES"=>"1.2"){'1.2"'}}}} +
cgi.tr{
cgi.td("ALIGN"=>"CENTER","WIDTH"=>"20%"){"AB
MAG" +
cgi.span("align"=>"center","style"=>"font-weight:bold",
"title"=>"Use the NICMOS Unit Conversion FORM to convert from Vega to the AB system. (CLICK ME FOR MORE INFORMATION)"){
cgi.a("href"=>"http://www.stsci.edu/hst/nicmos/tools/conversion_form.html","target"=>"_blank"){
cgi.img("src"=>"#{$imageloc}/infoicon.png","border"=>"0","height"=>"35%","width"=>"20%")}}} +
cgi.td("ALIGN"=>"CENTER","WIDTH"=>"20%"){"MOON
PHASE"} +
cgi.td("ALIGN"=>"CENTER","WIDTH"=>"20%"){"AIRMASS"}} +
cgi.tr{
cgi.td("ALIGN"=>"CENTER","WIDTH"=>"20%"){cgi.text_field("NAME"=>"magnitude","VALUE"=>"18","style"=>"width: 70%")} +
cgi.td("ALIGN"=>"CENTER","WIDTH"=>"20%"){
cgi.select("NAME"=>"moonphase","style"=>"width: 70%"){
cgi.option("VALUES"=>"0"){"0 New"} +
cgi.option("VALUES"=>"3"){"3"} +
cgi.option("VALUES"=>"7"){"7 Qtr"} +
cgi.option("VALUES"=>"10"){"10"} +
cgi.option("VALUES"=>"14"){"14 Full"}}} +
cgi.td("ALIGN"=>"CENTER","WIDTH"=>"20%"){
cgi.text_field("NAME"=>"airmass","VALUE"=>"1","style"=>"width:70%" )}} +
cgi.tr{
cgi.td("ALIGN"=>"CENTER","WIDTH"=>"20%"){"SEEING (FWHM)"+
cgi.span("title"=>"The median seeing above MMT is 0.7 arcseconds. (CLICK ME FOR MORE INFORMATION)"){
cgi.a("href"=>"http://www.mmto.org/node/149","target"=>"_blank"){
cgi.img("src"=>"#{$imageloc}/infoicon.png","border"=>"0","height"=>"35%","width"=>"20%")}}} +
cgi.td("ALIGN"=>"CENTER","WIDTH"=>"20%"){"SPATIAL BINNING"} +
cgi.td("ALIGN"=>"CENTER","WIDTH"=>"20%"){"SPECTRAL BINNING"}} +
cgi.tr{
cgi.td("ALIGN"=>"CENTER","WIDTH"=>"20%"){
cgi.text_field("NAME"=>"seeing","VALUE"=>"0.7","style"=>"width:70%" )} +
cgi.td("ALIGN"=>"CENTER","WIDTH"=>"20%"){
cgi.select("NAME"=>"binspat","style"=>"width: 70%"){
cgi.option("VALUES"=>"1"){"1"} +
cgi.option("VALUES"=>"2","SELECTED"=>"true"){"2"} +
cgi.option("VALUES"=>"3"){"3"} +
cgi.option("VALUES"=>"4"){"4"}}} +
cgi.td("ALIGN"=>"CENTER","WIDTH"=>"20%"){
cgi.select("NAME"=>"binspect","style"=>"width: 70%"){
cgi.option("VALUES"=>"1"){"1"} +
cgi.option("VALUES"=>"2"){"2"} +
cgi.option("VALUES"=>"3","SELECTED"=>"true"){"3"} +
cgi.option("VALUES"=>"4"){"4"}}}}} +
cgi.table("Border"=>"0","WIDTH"=>"100%","align"=>"center"){
cgi.tr{
cgi.td("width"=>"50%","align"=>"center"){
cgi.br +
cgi.input("type"=>"reset","alt"=>"Reset Form","style"=>"background-color:#696969; color:#FFFFFF; font-weight:bold; width: 100%",
"VALUE"=>"RESET","onmouseover"=>"style.backgroundColor='#999999'","onmouseout"=>"style.backgroundColor='#696969'")} +
cgi.td("width"=>"50%","align"=>"center"){
cgi.br +
cgi.input("type"=>"submit","alt"=>"Submit Form","style"=>"background-color:#990000; color:#FFFFFF; font-weight:bold; width: 100%",
"VALUE"=>"CALCULATE","onmouseover"=>"style.backgroundColor='#CC3333'","onmouseout"=>"style.backgroundColor='#990000'")}}} +
cgi.hr +
cgi.hr +
cgi.br +
cgi.br +
cgi.br +
cgi.br +
cgi.br +
cgi.br +
cgi.br +
cgi.a("href"=>"mailto:kiminkid@gmail.com?subject=ETC HELP","style"=>"text-decoration:none; margin-left:10px;","align"=>"center"){"Need Help?"} +
cgi.p("align"=>"left","style"=>"margin-left:10px;"){"© Daniel Kiminki 2011"}
}} +
cgi.td("align"=>"left","cellpadding"=>"0","cellspacing"=>"0","width"=>"72%","height"=>"100%","style"=>"vertical-align: center;"){
""}}} #table
} #div
} #body
} #Html
) #Pretty
} #Out