Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93028020
pclJP
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Nov 25, 16:12
Size
2 KB
Mime Type
text/x-perl
Expires
Wed, Nov 27, 16:12 (2 d)
Engine
blob
Format
Raw Data
Handle
22549397
Attached To
R1448 Lenstool-HPC
pclJP
View Options
#!/usr/local/bin/perl
$[
=
0
;
# set array base to 1
$,
=
' '
;
# set output field separator
$\
=
"\n"
;
# set output record separator
do
'frames.pl'
;
print
">Usage: pcl [clean] [ext/int] [critic/caustic]"
;
if
(
$ARGV
[
0
]
eq
"clean"
)
{
system
(
"xpaset -p ds9 regions deleteall"
);
}
open
(
ds9
,
">cl.reg"
);
#----------------------------------------------
$color
=
"red"
;
$n
=
0
;
$pixelx
=
$pixel
;
if
(
$type
eq
'fk5'
)
{
(
$hh
,
$mm
,
$ss
)
=
split
(
':'
,
$ra
);
(
$dd
,
$nn
,
$tt
)
=
split
(
':'
,
$dec
);
$sign
=
1
;
if
(
substr
(
$dec
,
0
,
1
)
eq
'-'
)
{
$sign
=-
1
;
$dd
=
abs
(
$dd
);
}
$pixel
=
3600
;
$ycpix
=
$sign
*
(
$dd
+
$nn
/60+$tt/
3600
);
$xcpix
=
(
$hh
+
$mm
/60+$ss/
3600
)
*
15
;
$pixelx
=-
3600
*
cos
(
$ycpix
/
180
*
3.1415926
);
}
if
(
$ARGV
[
1
]
ne
"ext"
)
{
open
(
in
,
"ci.dat"
);
while
(
<in>
)
{
chop
;
# strip record separator
(
$id
[
$i
],
$xi
,
$yi
,
$xs
,
$ys
)
=
split
;
$xxi
[
$i
]
=
$xi
/$pixelx+$xcpix; $yyi[$i]=$yi/
$pixel
+
$ycpix
;
$xxe
[
$i
]
=
$xs
/$pixelx+$xcpix; $yye[$i]=$ys/
$pixel
+
$ycpix
;
$i
++
;
}
$n
=
$i
;
close
(
in
);
for
(
$i
=
1
;
$i
<
$n
;
$i
++
)
{
if
(
$id
[
$i
]
==
$id
[
$i
-
1
])
{
if
(
$ARGV
[
2
]
ne
"caustic"
)
{
printf
ds9
"$type;line(%f,%f,%f,%f) # color=red line=0 0\n"
,
$xxi
[
$i
-
1
],
$yyi
[
$i
-
1
],
$xxi
[
$i
],
$yyi
[
$i
];
}
if
(
$ARGV
[
2
]
ne
"critic"
)
{
printf
ds9
"$type;line(%f,%f,%f,%f) # color=yellow line=0 0\n"
,
$xxe
[
$i
-
1
],
$yye
[
$i
-
1
],
$xxe
[
$i
],
$yye
[
$i
];
}
}
}
}
if
(
$ARGV
[
1
]
ne
"int"
)
{
open
(
in
,
"ce.dat"
);
while
(
<in>
)
{
chop
;
# strip record separator
(
$id
[
$i
],
$xi
,
$yi
,
$xs
,
$ys
)
=
split
;
$xxi
[
$i
]
=
$xi
/$pixelx+$xcpix; $yyi[$i]=$yi/
$pixel
+
$ycpix
;
$xxe
[
$i
]
=
$xs
/$pixelx+$xcpix; $yye[$i]=$ys/
$pixel
+
$ycpix
;
$i
++
;
}
$n
=
$i
;
close
(
in
);
for
(
$i
=
1
;
$i
<
$n
;
$i
++
)
{
if
(
$id
[
$i
]
==
$id
[
$i
-
1
])
{
if
(
$ARGV
[
2
]
ne
"caustic"
)
{
printf
ds9
"$type;line(%f,%f,%f,%f) # color=red line=0 0\n"
,
$xxi
[
$i
-
1
],
$yyi
[
$i
-
1
],
$xxi
[
$i
],
$yyi
[
$i
];
}
if
(
$ARGV
[
2
]
ne
"critic"
)
{
printf
ds9
"$type;line(%f,%f,%f,%f) # color=yellow line=0 0\n"
,
$xxe
[
$i
-
1
],
$yye
[
$i
-
1
],
$xxe
[
$i
],
$yye
[
$i
];
}
}
}
}
close
(
ds9
);
system
(
"cat cl.reg | xpaset ds9 regions"
);
Event Timeline
Log In to Comment