Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
speccy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tom Dwelly
speccy
Commits
d58e51be
Commit
d58e51be
authored
May 20, 2016
by
Tom Dwelly
Browse files
Options
Downloads
Patches
Plain Diff
added flux-model residual curves to speccy
parent
4ee0c99a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
speccy.html
+2
-0
2 additions, 0 deletions
speccy.html
speccy.js
+25
-1
25 additions, 1 deletion
speccy.js
with
27 additions
and
1 deletion
speccy.html
+
2
−
0
View file @
d58e51be
...
...
@@ -204,6 +204,8 @@
<span
style=
"color: #aaaaaa;"
>
Noise
</span></label>
<label><input
type=
"checkbox"
onclick=
"plotData();"
value=
"ToggleModel"
id=
"ToggleModel"
checked
>
<span
style=
"color: #dd0000;"
>
Model
</span></label>
<label><input
type=
"checkbox"
onclick=
"plotData();"
value=
"ToggleResidual"
id=
"ToggleResidual"
>
<span
style=
"color: #ff8c00;"
>
Residual
</span></label>
<br>
<label><input
type=
"checkbox"
onclick=
"plotData();"
value=
"ToggleLines"
id=
"ToggleLines"
checked
>
<span
style=
"color: #008800;"
>
Lines
</span></label>
...
...
...
...
This diff is collapsed.
Click to expand it.
speccy.js
+
25
−
1
View file @
d58e51be
...
...
@@ -40,7 +40,9 @@ var fluxArray = [];
var
fluxerrArray
=
[];
var
skyArray
=
[];
var
modelArray
=
[];
var
residualArray
=
[];
var
smoothedArray
=
[];
var
smoothedresidualArray
=
[];
var
templatelambdaArray
=
[];
var
templatefluxArray
=
[];
var
templateLength
=
0
;
...
...
@@ -310,6 +312,7 @@ function readSpecFileASCII()
fluxerrArray
[
j
]
=
Number
(
data
[
2
]);
skyArray
[
j
]
=
Number
(
data
[
3
]);
modelArray
[
j
]
=
Number
(
data
[
4
]);
residualArray
[
j
]
=
Number
(
fluxArray
[
j
]
-
modelArray
[
j
]);
if
(
modelArray
[
j
]
>
1.0
*
fluxerrArray
[
j
]
)
{
// the numeric value is the number of sigmas to accept
if
(
fluxArray
[
j
]
<
y0
)
y0
=
fluxArray
[
j
];
...
...
@@ -357,7 +360,8 @@ function readSpecFileASCII()
//calc the smoothed flux array
var
boxsize
=
$
(
"
input[type='radio'][name='smoothing']:checked
"
).
val
();
smoothArray
(
fluxArray
,
smoothedArray
,
boxsize
)
smoothArray
(
fluxArray
,
smoothedArray
,
boxsize
);
smoothArray
(
residualArray
,
smoothedresidualArray
,
boxsize
);
plotData
();
writePipeInfo
();
...
...
@@ -749,6 +753,25 @@ function plotData() {
ctx
.
closePath
();
}
//draw the residual flux curve
if
(
document
.
getElementById
(
"
ToggleResidual
"
).
checked
)
{
ctx
.
strokeStyle
=
"
#ff8c00
"
;
ctx
.
beginPath
();
for
(
var
i
=
0
;
i
<
lambdaArray
.
length
;
i
++
){
var
x
=
padx1
+
(
lambdaArray
[
i
]
-
x0
)
*
dx_inv
;
if
(
x
>=
padx1
&&
x
<=
xsize
-
padx2
)
{
var
y
=
ysize
-
pady
-
(
smoothedresidualArray
[
i
]
-
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
)
{
...
...
@@ -850,6 +873,7 @@ function updateSmoothing(){
//re-calc the smoothed flux array
var
boxsize
=
$
(
"
input[type='radio'][name='smoothing']:checked
"
).
val
();
smoothArray
(
fluxArray
,
smoothedArray
,
boxsize
);
smoothArray
(
residualArray
,
smoothedresidualArray
,
boxsize
);
plotData
();
}
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
sign in
to comment