-
Notifications
You must be signed in to change notification settings - Fork 0
/
C-table.sh
executable file
·52 lines (51 loc) · 1001 Bytes
/
C-table.sh
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
#!/bin/sh
sort -t, -k "10,10n" objects.csv |
awk -F, '
NR > 1 && $10 != "" {
alpha = $2;
delta = $3;
psa = $4;
x = $5;
y = $6;
pa = $7;
type = $8;
cat_M = $9;
cat_C = $10;
cat_U = $11;
cat_NGC = $12;
cat_IC = $13;
cat_Mel = $14;
cat_Cr = $15;
name = $16;
if (type == "GAL")
type = "Gal";
printf("C%-3d ", cat_C);
printf("&$%04.1f$ $%+03.0f$", alpha / 15, delta)
printf("&%s", psa);
printf("&%-3s", type);
printf("&");
join = "";
if (cat_M != "") {
printf("M%s", cat_M)
join = " = ";
}
if (cat_NGC != "") {
printf("%sNGC %s", join, cat_NGC)
join = " = ";
} else if (cat_IC != "") {
printf("%sIC %s", join, cat_IC)
join = " = ";
} else if (cat_Mel != "") {
printf("%sMel %s", join, cat_Mel)
join = " = ";
} else if (cat_Cr != "") {
printf("%sCr %s", join, cat_Cr)
join = " = ";
}
if (name != "") {
printf("%s%s", join, name)
join = " = ";
}
printf("\\\\\n");
}
' >C-table.tex