Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tom Dwelly
speccy
Commits
0c6913ee
Commit
0c6913ee
authored
Jul 22, 2021
by
Tom Dwelly
Browse files
add sky transmission vector
parent
72f2dede
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
js/speccy.js
View file @
0c6913ee
...
...
@@ -43,6 +43,8 @@ var fluxerrArray= [];
var
skyArray
=
[];
var
modelArray
=
[];
var
residualArray
=
[];
var
skyTransLambdaArray
=
[];
var
skyTransFluxArray
=
[];
var
smoothedArray
=
[];
var
smoothedresidualArray
=
[];
var
templatelambdaArray
=
[];
...
...
@@ -214,6 +216,7 @@ function startUpTasks()
readSpecFile
();
//the get is asynchronous, so don't put anything after this that depends on the read
changeTemplate
();
}
readSkyTrans
();
}
...
...
@@ -546,7 +549,22 @@ function changeTemplate() {
}
function
readSkyTrans
()
{
var
templateURL
=
"
templates/eso_skycalc_transmission_R3000.txt
"
;
//read in the file
var
jQResult
=
jQuery
.
get
(
templateURL
,
function
(
data
)
{
var
lines
=
[];
lines
=
data
.
split
(
"
\n
"
);
//file format: lambda(A),flux
var
templateLength
=
0
;
for
(
var
i
=
0
;
i
<
lines
.
length
;
i
++
)
{
var
data
=
[];
data
=
lines
[
i
].
split
(
"
,
"
);
skyTransLambdaArray
[
i
]
=
Number
(
data
[
0
]);
skyTransFluxArray
[
i
]
=
Number
(
data
[
1
]);
};
})
}
function
plotData
()
{
ctx
.
canvas
.
width
=
Math
.
max
(
1000
,
window
.
innerWidth
*
0.96
);
...
...
@@ -854,6 +872,27 @@ function plotData() {
ctx
.
stroke
();
ctx
.
closePath
();
}
//draw the sky transmission curve
if
(
document
.
getElementById
(
"
ToggleTrans
"
).
checked
)
{
var
skytransmult
=
Math
.
max
(
0.0
,
y0
)
+
0.5
*
(
y1
-
Math
.
max
(
0
,
y0
));
ctx
.
strokeStyle
=
"
#0000aa
"
;
ctx
.
beginPath
();
for
(
var
i
=
0
;
i
<
skyTransLambdaArray
.
length
;
i
++
){
var
x
=
padx1
+
(
skyTransLambdaArray
[
i
]
-
x0
)
*
dx_inv
;
if
(
x
>=
padx1
&&
x
<=
xsize
-
padx2
)
{
var
y
=
ysize
-
pady
-
(
skyTransFluxArray
[
i
]
*
skytransmult
-
y0
)
*
dy_inv
;
var
clip_y
=
Math
.
max
(
Math
.
min
(
y
,
ysize
-
pady
),
pady
);
if
(
i
>=
1
)
{
ctx
.
lineTo
(
x
,
clip_y
);}
else
{
ctx
.
moveTo
(
x
,
clip_y
);}
}
}
ctx
.
stroke
();
ctx
.
closePath
();
}
//draw the model curve
if
(
document
.
getElementById
(
"
ToggleModel
"
).
checked
)
...
...
speccy.html
View file @
0c6913ee
...
...
@@ -242,7 +242,9 @@
<span
style=
"color: #008800;"
>
Lines
</span></label>
<label><input
type=
"checkbox"
onclick=
"plotData();"
value=
"ToggleSky"
id=
"ToggleSky"
>
<span
style=
"color: #00dddd;"
>
Sky
</span>
×
</label>
<input
id=
"skyMult"
type=
"text"
value=
"0.05"
onchange=
"plotData();"
size=
"5"
title=
"Sky flux multiplier"
>
<input
id=
"skyMult"
type=
"text"
value=
"0.05"
onchange=
"plotData();"
size=
"5"
width=
"6"
title=
"Sky flux multiplier"
>
<label><input
type=
"checkbox"
onclick=
"plotData();"
value=
"ToggleTrans"
id=
"ToggleTrans"
title=
"Show a generic model of the sky transmission vector (ESO skycalc, AM=1.3, Paranal)"
>
<span
style=
"color: #0000aa;"
>
Sky Trans.
</span></label>
</td>
</tr>
...
...
templates/eso_skycalc_transmission_R2500.dat
0 → 100644
View file @
0c6913ee
This diff is collapsed.
Click to expand it.
templates/eso_skycalc_transmission_R2500.txt
0 → 100644
View file @
0c6913ee
This diff is collapsed.
Click to expand it.
templates/eso_skycalc_transmission_R3000.dat
0 → 100644
View file @
0c6913ee
This diff is collapsed.
Click to expand it.
templates/eso_skycalc_transmission_R3000.txt
0 → 100644
View file @
0c6913ee
This diff is collapsed.
Click to expand it.
templates/eso_skycalc_transmission_R5000.dat
0 → 100644
View file @
0c6913ee
This diff is collapsed.
Click to expand it.
templates/eso_skycalc_transmission_R5000.txt
0 → 100644
View file @
0c6913ee
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment