Skip to content

Commit 2537345

Browse files
committed
Added tool to extract HIP stars from GCVS catalog
1 parent 9339f86 commit 2537345

7 files changed

Lines changed: 85206 additions & 0 deletions

File tree

GCVS/format_description.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
GCVS part for Stellarium. This file contains part of Hipparcos stars from GCVS.
2+
Format:
3+
+ One record per line
4+
+ Fields in a record are delimited with the tab character
5+
+ Line beginning with a # character are comments
6+
+ Field are as follows:
7+
- HIP
8+
- GCVS designation
9+
- Type of variability
10+
- Magnitude at maximum brightness
11+
- Magnitude flag code (0=No flag,
12+
1="(" if magMax is an amplitude,
13+
2="<" if magMax is a bright limit,
14+
3=">" if magMax is a faint limit)
15+
- Minimum magnitude or amplitude
16+
- The photometric system for magnitudes
17+
- Epoch for maximum light (Julian days)
18+
- Period of the variable star (days)
19+
- Rising time or duration of eclipse (%)
20+
- Spectral type

GCVS/gcvs5.txt

Lines changed: 54981 additions & 0 deletions
Large diffs are not rendered by default.

GCVS/gcvs_hip_part.dat

Lines changed: 6875 additions & 0 deletions
Large diffs are not rendered by default.

GCVS/gcvs_hip_part_creator.pl

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
#!/usr/bin/perl
2+
3+
#
4+
# Tool for create a GCVS catalog for Stellarium
5+
#
6+
# Copyright (C) 2013, 2019 Alexander Wolf
7+
#
8+
# Permission is hereby granted, free of charge, to any person obtaining a
9+
# copy of this software and associated documentation files (the "Software"),
10+
# to deal in the Software without restriction, including without limitation
11+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
12+
# and/or sell copies of the Software, and to permit persons to whom the
13+
# Software is furnished to do so, subject to the following conditions:
14+
#
15+
# The above copyright notice and this permission notice shall be included
16+
# in all copies or substantial portions of the Software.
17+
#
18+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24+
# SOFTWARE.
25+
#
26+
27+
$SC = "./vcat-hip.dat"; # Source
28+
$OC = "./gcvs_hip_part.dat"; # Destination
29+
30+
open (OC, ">$OC");
31+
open (SC, "$SC");
32+
while (<SC>) {
33+
$rawstring = $_;
34+
$hipstr = substr($rawstring,0,6);
35+
$designationstr = substr($rawstring,15,9);
36+
$vclassstr = substr($rawstring,48,9);
37+
$maxmagstr = substr($rawstring,59,7);
38+
$ampflagstr = substr($rawstring,69,1);
39+
$min1magstr = substr($rawstring,70,6);
40+
$min2magstr = substr($rawstring,83,6);
41+
$flagstr = substr($rawstring,95,2);
42+
$epochstr = substr($rawstring,98,10);
43+
$periodstr = substr($rawstring,118,16);
44+
$mmstr = substr($rawstring,138,2);
45+
$sclassstr = substr($rawstring,144,16);
46+
47+
$hipstr =~ s/(\s+)//gi;
48+
$designationstr =~ s/(\s+)/ /gi;
49+
$vclassstr =~ s/(\s+)//gi;
50+
$maxmagstr =~ s/(\s+)//gi;
51+
$min1magstr =~ s/(\s+)//gi;
52+
$min2magstr =~ s/(\s+)//gi;
53+
$epochstr =~ s/(\s+)//gi;
54+
$periodstr =~ s/(\s+)//gi;
55+
$mmstr =~ s/(\s+)//gi;
56+
$sclassstr =~ s/(\s+)//gi;
57+
$flagstr =~ s/(\s+)//gi;
58+
59+
$designationstr =~ s/alf/α/;
60+
$designationstr =~ s/bet/β/;
61+
$designationstr =~ s/gam/γ/;
62+
$designationstr =~ s/del/δ/;
63+
$designationstr =~ s/eps/ε/;
64+
$designationstr =~ s/zet/ζ/;
65+
$designationstr =~ s/eta/η/;
66+
$designationstr =~ s/the/θ/;
67+
$designationstr =~ s/tet/θ/; # typo
68+
$designationstr =~ s/iot/ι/;
69+
$designationstr =~ s/kap/κ/;
70+
$designationstr =~ s/lam/λ/;
71+
$designationstr =~ s/mu./μ/;
72+
$designationstr =~ s/nu./ν/;
73+
$designationstr =~ s/xi./ξ/;
74+
$designationstr =~ s/omi/ο/;
75+
$designationstr =~ s/pi./π/;
76+
$designationstr =~ s/rho/ρ/;
77+
$designationstr =~ s/sig/σ/;
78+
$designationstr =~ s/tau/τ/;
79+
$designationstr =~ s/ups/υ/;
80+
$designationstr =~ s/phi/φ/;
81+
$designationstr =~ s/ksi/ξ/;
82+
$designationstr =~ s/khi/χ/;
83+
$designationstr =~ s/psi/ψ/;
84+
$designationstr =~ s/ome/ω/;
85+
$designationstr =~ s/V0/V/; # remove leading zero
86+
87+
$ampflag = 0;
88+
if ($ampflagstr eq '(') {
89+
$ampflag = 1;
90+
}
91+
if ($ampflagstr eq '<') {
92+
$ampflag = 2;
93+
}
94+
if ($ampflagstr eq '>') {
95+
$ampflag = 3;
96+
}
97+
98+
print OC $hipstr."\t".$designationstr."\t".$vclassstr."\t".$maxmagstr."\t".$ampflag."\t".$min1magstr."\t".$min2magstr."\t".$flagstr."\t".$epochstr."\t".$periodstr."\t".$mmstr."\t".$sclassstr."\n";
99+
}
100+
close SC;
101+
close OC;

GCVS/get-hip.pl

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#!/usr/bin/perl
2+
3+
#
4+
# Tool for create a GCVS catalog for Stellarium
5+
#
6+
# Copyright (C) 2013, 2015, 2019 Alexander Wolf
7+
#
8+
# Permission is hereby granted, free of charge, to any person obtaining a
9+
# copy of this software and associated documentation files (the "Software"),
10+
# to deal in the Software without restriction, including without limitation
11+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
12+
# and/or sell copies of the Software, and to permit persons to whom the
13+
# Software is furnished to do so, subject to the following conditions:
14+
#
15+
# The above copyright notice and this permission notice shall be included
16+
# in all copies or substantial portions of the Software.
17+
#
18+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24+
# SOFTWARE.
25+
#
26+
27+
28+
use LWP::UserAgent;
29+
30+
$GCVS = "./gcvs5.txt"; # GCVS
31+
$HIPV = "./vcat-hip.dat";
32+
$fpart = "http://simbad.u-strasbg.fr/simbad/sim-id?Ident=";
33+
$lpart = "&NbIdent=1&Radius=2&Radius.unit=arcmin&submit=submit+id";
34+
35+
$ua = LWP::UserAgent->new(
36+
keep_alive=>1,
37+
timeout=>180
38+
);
39+
40+
$ua->agent("Opera/9.80 (X11; Linux i686; U; ru) Presto/2.9.168 Version/11.50");
41+
$i = 0;
42+
open (OUT, ">$HIPV");
43+
open (GV, "$GCVS");
44+
while (<GV>) {
45+
$i++;
46+
$rawstring = $_;
47+
$designation = substr($rawstring,8,9);
48+
$designation =~ s/[ ]{1,}/+/gi;
49+
50+
$URL = $fpart.$designation.$lpart;
51+
52+
$request = HTTP::Request->new('GET', $URL);
53+
$responce = $ua->request($request);
54+
$content = $responce->content;
55+
56+
$content =~ m/>HIP<\/A> ([0-9]+)/gi;
57+
$hipn = $1;
58+
59+
$len = 6-length($hipn);
60+
if ($len<6) {
61+
$add = "";
62+
for ($i=0;$i<$len;$i++) {
63+
$add .= " ";
64+
}
65+
print OUT $hipn.$add."|".$rawstring;
66+
}
67+
if ($i==10) {
68+
$i = 0;
69+
sleep 10;
70+
}
71+
}
72+
close GV;
73+
close OUT;

0 commit comments

Comments
 (0)