-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_catalog.sh
More file actions
executable file
·64 lines (59 loc) · 2.77 KB
/
get_catalog.sh
File metadata and controls
executable file
·64 lines (59 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# The code for generate data form c2d project table
#20180414 version alpha 1
# example file name: /mazu/users/Jacob975/c2d/OPH/CATALOGS/catalog-OPH-HREL.tbl
if [ "$#" -ne 2 ]; then
echo "Illegal number of parameters"
echo "Usage: ${0} [file name] [argument]"
echo "arguments: star, galaxy, yso. others"
exit 1
fi
case ${2} in
"star")
awk '$15~/star/ && $15!~/dust/ \
{print "["$22"," $26"," $30"," $42"," $60"," $78"," $96"," $114"," \
$23"," $27"," $31"," $43"," $61"," $79"," $97"," $115"],"}' ${1} > star_sed.dat
awk '$15~/star/ && $15!~/dust/ \
{print $25" " $29" " $33" " $45" " $63" " $81" " $99" " $117}' ${1} > star_Q.dat
awk '$15~/star/ && $15!~/dust/ {print FNR }' ${1} > star_tracer.dat
awk '$15~/star/ && $15!~/dust/ {print $3" "$5 }' ${1} > star_coord.dat
awk '$15~/star/ && $15!~/dust/ {print $16" "$17 }' ${1} > star_catalog_Av.dat
exit 0
;;
"galaxy")
awk '$15~/Galc/ \
{print "["$22"," $26"," $30"," $42"," $60"," $78"," $96"," $114"," \
$23"," $27"," $31"," $43"," $61"," $79"," $97"," $115"],"}' ${1} > gala_sed.dat
awk '$15~/Galc/ \
{print $25" " $29" " $33" " $45" " $63" " $81" " $99" " $117}' ${1} > gala_Q.dat
awk '$15~/Galc/ {print FNR }' ${1} > gala_tracer.dat
awk '$15~/Galc/ {print $3" "$5 }' ${1} > gala_coord.dat
awk '$15~/Galc/ {print $16" "$17 }' ${1} > gala_catalog_Av.dat
exit 0
;;
"yso")
awk '$15~/YSOc/ \
{print "["$22"," $26"," $30"," $42"," $60"," $78"," $96"," $114"," \
$23"," $27"," $31"," $43"," $61"," $79"," $97"," $115"],"}' ${1} > ysos_sed.dat
awk '$15~/YSOc/ \
{print $25" " $29" " $33" " $45" " $63" " $81" " $99" " $117}' ${1} > ysos_Q.dat
awk '$15~/YSOc/ {print FNR}' ${1} > ysos_tracer.dat
awk '$15~/YSOc/ {print $3" "$5}' ${1} > ysos_coord.dat
awk '$15~/YSOc/ {print $16" "$17}' ${1} > ysos_catalog_Av.dat
exit 0
;;
"others")
awk '$15~/red/|| $15~/rising/ || $15~/falling/ || $15~/cup-up/ || $15~/cup-down/ || $15~/flat/ \
{print "["$22"," $26"," $30"," $42"," $60"," $78"," $96"," $114"," $23"," \
$27"," $31"," $43"," $61"," $79"," $97"," $115"],"}' ${1} > othr_sed.dat
awk '$15~/red/|| $15~/rising/ || $15~/falling/ || $15~/cup-up/ || $15~/cup-down/ || $15~/flat/ \
{print FNR}' ${1} > othr_tracer.dat
awk '$15~/red/|| $15~/rising/ || $15~/falling/ || $15~/cup-up/ || $15~/cup-down/ || $15~/flat/ \
{print $3" "$5}' ${1} > othr_coord.dat
exit 0
;;
*)
echo wrong argument
echo "arguments: star, galaxy, yso. others"
exit 1
esac