[APBeta] an obscure bug in importing?

Roberto Abraham abraham at astro.utoronto.ca
Fri Sep 2 23:47:44 PDT 2011


Dear Paul,

I'm afraid I *may* have uncovered another obscure bug... 

Here's the background. I thought it would be interesting to make a plan containing William Herschel's original double star catalogs. The history of these catalogs is quite interesting, and the story is given here:

http://www.handprint.com/ASTRO/herschel.html

To do this I wrote a little python script which parses the Excel files linked to above and outputs a text file which I can import into AstroPlanner. This text file contains three columns in tab-delimited format. The first column is the WDS ID, which I'm using as the primary ID. The second column is the Name field which is string containing a bunch of other information like Bayer, Flamsteed, and Struve catalog designations, as well Herschel's original designation. The final column contains Herschel's published notes on the object.

This text file is here:

http://dl.dropbox.com/u/1727159/ForPaulRodman/out.txt

The file imports *nearly* successfully into AstroPlanner (as a Generic Text File, with Catalogue lookup based on ID) except a very curious thing happens. Only the objects in the Northern hemisphere are successfully matched to WDS objects in the AstroPlanner catalog. Here's a screenshot showing what the result of the import looks like:

http://dl.dropbox.com/u/1727159/ForPaulRodman/Screen%20Shot.png

Here's a link to the resulting plan:

http://dl.dropbox.com/u/1727159/ForPaulRodman/Herschel.apd

As you can see in the screenshot all objects with negative declinations in their WDS ID's are not matched, while almost all WDS ID's with positive declinations are matched. (Parenthetically, I also note that the screenshot shows that the save button on the dialog box to save the format settings is grayed out... I think this might also be a bug). My original suspicion is that this might have uncovered some sort of unicode bug (i.e. the minus sign in the WDS I.D. might not be an ASCII minus sign and some sort of unicode thing instead) but as far as I can tell it isn't that (I did a search and replace on the minus sign in a text editor).

Anyway, sorry if this isn't a bug and I'm doing something silly here!

Bob

P.S. You might find this amusing: While undertaking the marginal hack above it occurred to me that I could both avoid bugging you and also take this to the next geeky level by simply writing out the plan directly using python and not bothering with the AstroPlanner import step at all. Python has built-in sqlite support and it took five nanoseconds to figure out the required file format for a plan file. But of course you know how this is going to end... badly. It is indeed trivially easy to write out a plan which AstroPlanner will happily load, but of course the plan is useless since the base catalogs appear to be some sort of RealBasic data dump and not sqlite files, so I can't use python to embed CatIdx field needed by AstroPlanner in order to point to the objects in the WDS catalog. Foiled! So I conclude this is never going to work unless you someday decide to revise your catalog format for AstroPlanner 3. But in case you ever decide you want to write out a nearly-working AstroPlanner plan in python, here's a link so you can see how I did it. Note that this reads a simplified version of one of the Excel files above with the header stripped.

http://dl.dropbox.com/u/1727159/ForPaulRodman/make_plan.py

--

Prof. Roberto Abraham             
Dept. of Astronomy & Astrophysics
University of Toronto           
50 St. George St                
Toronto, ON M5S 3H4             
Canada                        

Office: Astronomy Building Room 206
Phone (direct): 416-946-7289
Phone (department): 416-978-2016
Departmental FAX:   416-946-7287
http://www.astro.utoronto.ca/~abraham




More information about the APBeta mailing list