Lab
4 

 Lab
4 Statistics,
Source
Detection,
and
Noise
in
the
Optical/Infrared 




 Lab
4 

 Lab
4 Statistics,
Source
Detection,
and
Noise
in
the
Optical/Infrared 



Lab
4 Statistics,
Source
Detection,
and
Noise
in
the
Optical/Infrared Log
into
your
department
unix
account
and
start
X
Windows
using
the
“startx”
command.
In
a
terminal,
change
directories
to
the
data
subdirectory
of
your
home
directory,
and
then
start
IDL:
cd
~/data
idl
Once
IDL
has
been
started,
also
open
an
IDL
plotting
window
and
start
the
IDL
Help
interface:
IDL>
window,0
IDL>
?
This
interface
may
be
used
to
search
for
standard
IDL
procedures,
their
descriptions,
and
the
syntax
for
using
them.
For
example,
within
the
Search
box,
type
“mean”
and
click
the
“Search”
button.
Much
like
an
index,
the
interface
will
return
different
pages
discussing
“mean.”
Find
the
IDL
procedure
that
may
be
used
to
determine
the
mean
pixel
value
of
an
array
or
image.
Likewise,
find
the
IDL
procedures
that
may
be
used
to
determine
the
median
and
standard
deviation
of
the
pixel
values
of
an
array
or
image.
IDL
procedures
that
have
been
developed
specifically
for
astronomy
are
not
standard
IDL
procedures.
Thus,
the
IDL
Help
interface
cannot
be
used
to
search
these
astronomy‐specific
procedures.
One
of
the
largest,
most
widely
used
IDL
astronomy
libraries
is
astrolib,
distributed
by
NASA
Goddard
Space
Flight
Center.
Load
this
library:
IDL>
astrolib
To
access
a
list
of
the
astrolib
procedures,
open
the
following
file:
~/idl_libs/astrolib/contents.txt
in
a
text
editor.
This
file
also
includes
a
brief
description
of
the
function
of
each
procedure.
For
more
details
about
a
procedure,
including
the
syntax
for
using
it,
you
must
refer
to
the
procedure
itself.
The
astrolib
procedures
are
found
in
the
following
directory:
~/idl_libs/astrolib/pro
Just
as
you
could
read
a
FITS
image
file
into
ds9,
you
may
also
read
them
into
IDL
using
the
astrolib
procedure
readfits.
Read
in
the
K‐band
image
for
B35A
that
was
previously
saved
in
your
data
directory,
and
determine
the
mean
pixel
value
in
the
image
using
the
following
IDL
statements:
IDL>
image_B35A_K
=
readfits(“B35A_K.fits”,
hdr_B35A_K)
IDL>
mean_B35A_K
=
mean(image_B35A_K)
IDL>
print,
mean_B35A_K
Note
that,
instead
of
first
saving
the
mean
as
named
variable
and
then
printing
it,
you
may
simply
print
it:
IDL>
print,
mean(image_B35A_K)
Now,
determine
the
median
and
standard
deviation
of
the
pixel
values
in
the
image.
Record
these
“Full
Image
Statistics”
in
the
table
in
Question
1
of
the
homework
assignment.
Let’s
now
use
the
standard
IDL
procedure
histogram
to
construct
a
histogram
of
the
pixel
values
in
the
image.
As
an
example,
for
a
bin
size
of
0.3
ADU,
the
IDL
statement
would
be:
IDL>
hist_B35A_K
=
histogram(image_B35A_K,
binsize=0.3,
locations=bins_B35A_K,
/nan)
This
statement
saves
the
locations
of
the
bin
centers
in
named
variable
bins_B35A_K
and
the
histogram
values
as
hist_B35A_K.
You
may
view
the
resulting
histogram
by
using
the
plot
procedure,
with
psym
set
to
10:
IDL>
plot,
bins_B35A_K,
hist_B35A_K,
psym=10
Alternatively,
you
may
save
the
plot
by
creating
a
PostScript
(ps)
file.
The
details
concerning
the
creation
of
such
files
may
be
complicated,
and
are
beyond
the
scope
of
this
lab.
But,
you
may
create
a
PostScript
file,
with
filename
“histogram_B35A_K.ps”,
by
using
set_plot
and
device
statements
before
and
after
the
plot
statement
as
follows:
IDL>
set_plot,
‘ps’
IDL>
device,
filename=’histogram_B35A_K.ps’,
/landscape
IDL>
plot,
bins_B35A_K,
hist_B35A_K,
psym=10
IDL>
device,
/close
IDL>
set_plot,
’x’
You
may
then
view
this
file
using
gv
in
a
terminal
separate
from
that
running
IDL:
gv
histogram_B35A_K.ps
&
You
should
choose
a
bin
size
that
provides
at
least
a
few
bins
on
either
side
of
the
distribution
peak,
without
creating
a
“noisy”
distribution
by
setting
the
bin
size
too
small.
Remake
the
histogram
with
different
bin
sizes
until
you
achieve
a
smooth
and
well
sampled
distribution
around
the
peak.
Also,
using
the
IDL
Help
interface,
scan
the
documentation
for
plot
to
determine
how
to
change
the
range
of
the
x‐
and
y‐
axes
and
how
to
label
these
axes.
Save
your
final
histogram
as
a
PostScript
file
and
print
it.
Based
on
the
histogram,
estimate
the
mode
of
the
distribution
and
record
it
on
the
printed
copy.
Turn
in
this
printed
copy
at
the
end
of
the
lab.
Now,
start
the
PhotVis
interface:
IDL>
photvis
Load
the
image
by
selecting
the
Open
FITS
Image
option
under
the
File
menu,
and
browse
for
the
B35A_K.fits
image.
After
the
image
has
been
loaded,
adjust
the
grayscale
by
changing
the
Min
and
Max
values
on
the
PhotVis
interface.
Note
that
whenever
any
value
in
a
PhotVis
box
has
been
changed,
this
change
must
be
followed
by
a
<RETURN>
while
the
cursor
is
active
in
that
box
in
order
for
the
change
to
take
effect.
The
grayscale
should
be
set
such
that
you
can
see
the
background
level
and
faint
sources
barely
above
the
background
level.
You
will
find
that
zooming
in
on
different
regions
of
the
image
(using
the
zoom
buttons
and
dragging
the
display
box
found
to
the
right
of
these
buttons)
will
help
you
to
set
the
grayscale
appropriately.
Under
the
Info
menu,
you
will
find
the
FITS
Header
and
Statistics
options.
The
former
option
displays
the
header,
similar
to
the
ds9
capability.
The
latter
option
displays
the
basic
statistics
of
the
image
pixel
values.
2
The
mean,
median,
and
standard
deviation
returned
by
PhotVis
should
be
the
same
as
those
you
previously
found
and
recorded
in
Question
1
of
the
homework
assignment.
Moving
the
cursor
into
the
main
PhotVis
image
display
and
clicking
the
left
mouse
button
causes
a
box
to
appear.
This
box
may
be
moved
to
isolate
different
regions
of
the
image.
The
“Local
Statistics”
for
pixel
values
in
that
box
are
shown
in
the
upper
right
of
the
PhotVis
interface.
Place
a
box
in
the
upper
left
(northeastern;
NE)
quadrant
of
the
image,
in
a
region
free
of
sources,
and
record
the
local
mean,
median,
and
standard
deviation
in
the
table
in
Question
1
of
the
homework
assignment.
Similarly,
repeat
for
regions
in
the
upper
right
(NW),
lower
left
(SE),
and
lower
right
(SW)
quadrants.
Record
these
local
statistics
in
the
table
in
Question
1
of
the
homework
assignment.
Are
these
statistics
consistent
with
those
found
for
the
full,
entire
image?
Based
on
the
local
statistics
and
the
full
image
statistics,
settle
on
single
values
(to
the
nearest
0.1
ADU)
to
adopt
for
the
median
and
standard
deviation.
The
adopted
value
for
the
standard
deviation
will
be
used
later
in
the
source
detection
routine.
Next,
zoom
in
on
a
region
with
at
least
three
well
isolated,
non‐saturated
sources.
Place
the
cursor
over
the
center
of
one
of
these
sources
and
click
the
left
mouse
button.
Profiles
of
the
pixel
values
along
that
row
and
along
that
column
will
appear
in
the
black
window
located
in
the
lower
right
of
the
PhotVis
interface.
Use
these
profiles
to
estimate
the
FWHM
(in
pixels)
of
this
source.
Record
this
FWHM
estimate
as
well
as
the
Column
and
Row
numbers
in
the
table
in
Question
2
of
the
homework
assignment.
Repeat
for
the
two
other
isolated
sources,
and
record.
From
these
three
separate
FWHM
estimates,
settle
on
a
FWHM
estimate
(to
the
nearest
0.1
pixel).
This
adopted
FWHM
will
be
used
for
the
source
detection
routine.
Configure
the
automatic
source
detection
by
selecting
the
Object
Detection
option
under
the
Configuration
menu.
A
PhotVis
Config:
Object
Detection
window
will
appear.
Change
the
FWHM
value
to
be
appropriate
for
your
image,
and
then
<RETURN>.
Choice
of
the
Intensity
Threshold
(above
the
local
background)
may
be
expressed
in
terms
of
the
Standard
Deviation
by:
Intensity
Threshold
=
N
x
(Standard
Deviation)
For
this
lab,
choose
a
threshold
that
is
50
times
the
standard
deviation,
or
N
=
50.
Again,
always
remember
that
whenever
any
value
in
a
PhotVis
box
has
been
changed,
this
change
must
be
followed
by
a
<RETURN>
while
the
cursor
is
active
in
that
box
in
order
for
the
change
to
take
effect.
Do
not
change
any
of
the
other
object
detection
parameters.
Initiate
the
automatic
detection
by
selecting
the
AutoDetect
Active.
How
many
objects
were
detected
(and
accepted)
by
the
PhotVis
AutoDetect
routine?
This
number
is
displayed
in
the
upper
right
of
the
PhotVis
interface.
Record
this
number
in
the
table
in
Question
3
of
the
homework
assignment.
Zoom
in
near
the
center
of
the
lower
left
(SE)
quadrant
of
the
image,
displaying
a
field
that
is
about
1/16
of
the
area
of
the
full
image.
Within
this
sub‐region,
sources
that
were
detected
above
the
intensity
threshold
and
accepted
as
real
sources
are
identified
by
green
squares.
Sources
that
were
detected
above
the
threshold,
but
rejected
by
other
criteria,
are
identified
by
red
squares.
You
may
examine
each
source
in
detail
by
placing
the
cursor
over
that
source
and
clicking
the
right
mouse
button.
In
this
way,
“judge”
for
yourself
whether
each
detection
that
was
accepted
(green
square)
by
the
AutoDetect
routine
represents
a
real
or
anomalous
source.
Record
the
number
of
anomalous
detections
in
this
sub­region
in
the
table
in
Question
3
of
the
homework
assignment.
Also,
record
in
that
table
the
total
number
of
detections
that
were
accepted
(green
squares)
by
the
AutoDetect
routine.
Finally,
save
the
PhotVis
session
by
selecting
the
Save
Current
Session
option
under
the
File
menu.
Use
a
filename
with
extension
“.idl”
(e.g.,
PhotVis_B35A_K.idl).
This
PhotVis
session
may
be
loaded
anytime
by
starting
IDL
and
PhotVis,
and
selecting
the
Load
Current
Session
option
under
the
File
menu.
3

Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement