Problem: Anna Ho has a Keck style star-list file. She wants to generate
Finding Charts via the PTF Marshal.
$ more GrahamAGN.txt
J012016-092028 01 20 16.8 -9 20 28.6 2000 prio=3 18.0m z0.49
J012214+390703 01 22 14.4 39 07 03.3 2000 prio=3 18.3m z1.21
For each source she needs to generate a command like this
http://ptf.caltech.edu/cgi-bin/ptf/variable/fc.cgi?ra=01%3A22%3A14.4&dec=39%3A07%3A03.3&name=J012214%2B390703
Clearly, html protocol requires (html sometimes does not like blanks and explicit symbols such as + and -)
blank -> %3A
+ -> %2B
- -> %2D
1. We need only name, ra and dec. So we get rid of all characters starting
with " 2000" through the end of the line
$ sed 's/ 2000.*//' GrahamAGN.txt > a.txt
J012016-092028 01 20 16.8 -9 20 28.6
J012214+390703 01 22 14.4 39 07 03.3
2. First we change the "+/-" to ASCII code.
$ sed 's/-/%2D/g;s/+/%2B/g' a.txt > b.txt
J012016%2D092028 01 20 16.8 %2D9 20 28.6
J012214%2B390703 01 22 14.4 39 07 03.3
[You can be clever and combine the two
$ sed 's/-/%2D/g;s/+/%2B/g;s/ 2000.*//' GrahamAGN.txt > b
3. Next we add in the cgi/html stuff (here $1 is the first entry, $2 is the
second entry etc.)
$ awk '{bl="%3A"; print ""$1"
"}' b.txt > FC.html
J012016%2D092028
J012214%2B390703
[You can be clever and pipe step 1+2 into step 3]
4. Open the html file
$ open FC.html
and start clicking on sources!