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
ef909283
Commit
ef909283
authored
May 20, 2016
by
Tom Dwelly
Browse files
trying to sort out screw up with version mix up
parent
f969728a
Pipeline
#3439
skipped
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
speccy.js
View file @
ef909283
...
...
@@ -77,7 +77,6 @@ var x0=1e10; //will derive values of these params from spectrum
var
x1
=
0.0
;
//
var
y0
=
0.0
;
//
var
y1
=
0.0
;
//
//var y1=1e-19; //
var
orig_x0
;
var
orig_x1
;
var
orig_y0
;
...
...
@@ -313,7 +312,6 @@ function readSpecFileASCII()
fluxerrArray
[
j
]
=
Number
(
data
[
2
]);
skyArray
[
j
]
=
Number
(
data
[
3
]);
modelArray
[
j
]
=
Number
(
data
[
4
]);
<<<<<<<
HEAD
residualArray
[
j
]
=
Number
(
fluxArray
[
j
]
-
modelArray
[
j
]);
if
(
modelArray
[
j
]
>
1.0
*
fluxerrArray
[
j
]
)
{
// the numeric value is the number of sigmas to accept
...
...
@@ -322,19 +320,6 @@ function readSpecFileASCII()
if
(
fluxArray
[
j
]
>
-
1
e10
)
{
fluxMean
=
fluxMean
+
Number
(
fluxArray
[
j
]);
nfluxMean
++
;
=======
//calculate a clipped version of the mean of the flux
if
(
lambdaArray
[
j
]
>=
3800
.
&&
lambdaArray
[
j
]
<=
10000
.
)
{
if
(
Math
.
abs
(
fluxerrArray
[
j
]
-
modelArray
[
j
])
<
1.0
*
Math
.
abs
(
modelArray
[
j
]))
{
// the numeric value is the number of multiples of model flux to accept
if
(
fluxArray
[
j
]
<
y0
)
y0
=
fluxArray
[
j
];
if
(
fluxArray
[
j
]
>
y1
)
y1
=
fluxArray
[
j
];
if
(
fluxArray
[
j
]
>
-
1
e10
)
{
fluxMean
=
fluxMean
+
Number
(
fluxArray
[
j
]);
nfluxMean
++
;
}
>>>>>>>
858
bb76ec0b7e93cf95cf382ac1e8982d056066a
}
}
}
...
...
@@ -345,10 +330,7 @@ function readSpecFileASCII()
var
str
=
"
There was a problem with the specified specfile='
"
+
specfile
+
"
' (lambdaArray.length=
"
+
lambdaArray
.
length
+
"
)
"
;
alert
(
str
);
}
else
{
if
(
y1
<=
y0
)
{
y1
=
y0
+
1.0
;
fluxMean
=
0.5
*
(
y0
+
y1
);}
//catch cases where no valid points
// console.log(y0);
// console.log(y1);
dy
=
(
y1
-
Math
.
max
(
y0
,
0.0
))
*
0.02
;
//expand the range a little
dy
=
(
y1
-
Math
.
max
(
y0
,
0.0
))
*
0.02
;
//only expand the range a little
y1
=
y1
+
dy
;
if
(
y0
>=
0.0
)
{
y0
=
y0
-
dy
;
...
...
@@ -391,7 +373,7 @@ function readSpecFileASCII()
function
readSpecFile
()
{
var
extension
=
specfile
.
split
(
'
.
'
).
pop
();
//
console.log(extension);
console
.
log
(
extension
);
if
(
extension
===
"
fits
"
)
{
readSpecFileFITS
();
}
else
{
...
...
@@ -520,7 +502,7 @@ function plotData() {
ctx
.
textAlign
=
"
center
"
;
var
zratio
=
(
1
.
+
znow
)
/
(
1
.
+
modelz0
);
var
dx_inv
=
(
xsize
-
padx
)
/
(
x1
-
x0
);
var
dy_inv
=
(
ysize
-
2
.
*
pad
y
)
/
(
y1
-
y0
);
var
dy_inv
=
(
ysize
-
pad
x
)
/
(
y1
-
y0
);
var
dx2_inv
=
(
xsize
-
padx
)
*
(
1
.
+
znow
)
/
(
x1
-
x0
);
ctx
.
clearRect
(
0
,
0
,
canvas
.
width
,
canvas
.
height
);
ctx
.
strokeStyle
=
"
#000000
"
;
...
...
@@ -1171,20 +1153,17 @@ document.body.addEventListener('mousedown', function (evt){
var
ysize
=
canvas
.
height
;
if
(
mousePos
.
x
>=
0.0
&&
mousePos
.
x
<=
xsize
&&
mousePos
.
y
>=
0.0
&&
mousePos
.
y
<=
ysize
)
{
var
dl_dx
=
(
x1
-
x0
)
/
(
xsize
-
padx
);
var
dflux_dy
=
(
y1
-
y0
)
/
(
ysize
-
2
.
*
pady
);
var
lobs
=
(
mousePos
.
x
-
padx1
)
*
dl_dx
+
x0
;
var
flux
=
(
ysize
-
mousePos
.
y
-
pady
)
*
dflux_dy
+
y0
;
//https://en.wikipedia.org/wiki/AB_magnitude
var
Jy
=
3.34e4
*
(
lobs
*
lobs
)
*
flux
*
1
e
-
17
;
var
AB
=
-
2.5
*
Math
.
log10
(
Jy
/
3631
.);
var
lrest
=
lobs
/
(
znow
+
1
.);
var
str
=
sprintf
(
"
(%s,%s,F%s,AB)=(%.2f%s, %.2f%s, %.2f%s, %.2f)
"
,
var
dx
=
(
x1
-
x0
)
/
(
xsize
-
padx
);
var
dy
=
(
y1
-
y0
)
/
(
ysize
-
2
.
*
pady
);
var
lobs
=
(
mousePos
.
x
-
padx1
)
*
dx
+
x0
;
var
flux
=
(
ysize
-
mousePos
.
y
-
pady
)
*
dy
+
y0
;
var
lrest
=
lobs
/
(
znow
+
1
.);
var
str
=
sprintf
(
"
(%s,%s,F%s)=(%.2f%s, %.2f%s, %.2f%s)
"
,
String
.
fromCharCode
(
955
,
8338
),
String
.
fromCharCode
(
955
,
7523
),
String
.
fromCharCode
(
955
),
lobs
,
String
.
fromCharCode
(
8491
),
lrest
,
String
.
fromCharCode
(
8491
),
flux
,
String
.
fromCharCode
(
215
)
+
"
10
"
+
String
.
fromCharCode
(
8315
,
185
,
8311
)
+
"
erg cm
"
+
String
.
fromCharCode
(
8315
,
178
)
+
"
s
"
+
String
.
fromCharCode
(
8315
,
185
)
+
"
"
+
String
.
fromCharCode
(
8491
,
8315
,
185
)
,
AB
);
ctx
.
clearRect
(
xsize
-
4
7
.
*
padx2
,
ysize
-
0.6
*
pady
,
xsize
,
ysize
);
ctx
.
fillText
(
str
,
xsize
-
2
3
.
*
padx2
,
ysize
-
0.2
*
pady
);
String
.
fromCharCode
(
215
)
+
"
10
"
+
String
.
fromCharCode
(
8315
,
185
,
8311
)
+
"
erg cm
"
+
String
.
fromCharCode
(
8315
,
178
)
+
"
s
"
+
String
.
fromCharCode
(
8315
,
185
)
+
"
"
+
String
.
fromCharCode
(
8491
,
8315
,
185
));
ctx
.
clearRect
(
xsize
-
4
4
.
*
padx2
,
ysize
-
0.6
*
pady
,
xsize
,
ysize
);
ctx
.
fillText
(
str
,
xsize
-
2
2
.
*
padx2
,
ysize
-
0.2
*
pady
);
}
}
else
...
...
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