Wednesday, March 21, 2018

Colorful binary star systems for small telescopes: Part 1

I recently got a small telescope (a Celestron NexStar 6SE) in order to introduce the kids to the wonders of the sky, albeit somewhat dulled by suburban light pollution.

While waiting for the weather to become warm enough to actually use it I've been pondering what interesting objects can actually be seen given the constraints of the hardware. Randomly looking at things without knowing what they are can only get you so far, especially with kids.

One class of (non-Solar-system) object that can be visually impressive are visual double stars with a significant difference in color. Differences in color are easy for kids to understand as differences in temperature, which leads on to understanding there are different types of stars...

That thought lead me to this nice article,"Colored Double Stars, Real and Imagined" by Bob King, Sky & Telescope, December 14 2016. Its a good article, with images, information and even an HTML table of the objects, rough coordinates, magnitude and spectral types. I've reproduced the table below:

Star R.A. Dec. Mag A Mag B Sep. P.A. Color difference Spec. Class
η Cas 00h 49m +57° 49' 3.5 7.2 13" 317° 1.7 G0, K7
1 Ari 01h 50m +22° 16' 5.9 7.2 2.9" 164° 3.5 K1, A6
γ And 02h 04m +42° 20' 2.1 4.8 9.8" 64° 3.5 K3, B8
ι Tri = 6 Tri 02h 12m +30° 18' 5.3 6.7 4" 69° 1.0 G5, F5
η Per 02h 51m +55° 54' 3.8 8.5 28" 301° 3.0 K3, A3
32 Eri 03h 54m –02° 57' 4.8 5.9 7" 254° 2.6 G8, A2
ρ Ori 05h 13m +02° 52' 4.6 8.5 7" 64° 1.7 K3, F7
14 Aur 05h 15m +32° 41' 5.0 7.4 15" 226° 0.4 A9, F3
ι Ori 05h 35m +05° 57' 2.9 7.0 10.9" 142° 0.2 O9, B1
γ Lep 05h 44m –22° 27' 3.6 6.3 97" 350° 1.6 F6, K2
h3945 CMa 07h 17m –23° 19' 5.0 5.8 26.8" 52° 2.0 K0, F0
ι Cnc 08h 47m +28° 46' 4.0 6.6 30.6" 307° 2.6 G8, A2
24 Com 12h 35m +18° 23' 5.1 6.3 20" 270° 2.2 K0, A9
ξ Boo 14h 51m +19° 06' 4.8 7.0 6" 343° 0.5 G8, K4
α Her 17h 15m +14° 23' 3.1 5.4 5" 106° 1.7 M5, G8
95 Her 18h 02m +21° 36' 4.9 5.2 6" 258° 2.3 A5, G8
ζ Lyr 18h 45m +37° 36' 4.3 5.6 44" 150° 1.1 B7, A8
Albireo 19h 31m +27° 57' 3.4 4.7 35" 54° 3.5 K3, B8
31 Cyg 20h 14m +46° 44' 3.8 4.8 107" 325° 2.9 K2, B3
β Cap 20h 21m –14° 47' 3.2 6.1 207" 267° 3.2 K0, B8
γ Del 20h 47m +16° 07' 4.4 5.0 9" 267° 1.4 K1, F7
δ Cep 22h 29m +58° 25' 4.1 6.3 40.9" 191° 2.5 G2, B7

But it and the article still leave me with many questions I'd like to know answers for *before* actually trying to observe these systems and show them to my kids:
  • How far away are these stars?
  • What type of star are they? (main sequence dwarfs? Giants?)
  • What is their true luminosity, mass, radius, and temperature compared to the Sun?
  • How long do stars like these live?
  • How far apart physically are these stars?
  • Are they actually a binary (or multiple) star systems, or just chance alignments?
In addition to these questions, there are some issues with the list as presented that make it hard to use it.
  • What are the names/identifiers of the companion stars? The names given above are presumably the Primary, i.e. visually brightest, member of the pair. But what are the other member or members of the system?
  • What are the true coordinates of the objects? The RA/Decs given above are rounded to the nearest minute and arc-minute. One minute in RA is 15 arcminutes, or half the angular diameter of the moon. The number of objects in a professional astronomical catalog within a 15 arcminute radius is likely pretty large.
  • The Celestron recognizes SAO star identifiers, so what are those for the objects given above?
As I used to be a professional astronomer I know answers to all these questions either already exist, or can be determined to some level of accuracy for such bright (and hence nearby) stars and accessed via SIMBAD (wikipedia entry here). Its just a matter of collating the right information from different astronomers and applying some scientific criteria to choose between multiple, quite possibly contradictory, sources of information. I started trying to collate that information, but after spending quite some time getting only the basic beginnings of what I needed I discovered I'd somehow missed a bunch of the stars listed in Bob King's table and hence wasn't even close to being finished.  Argh!

There had to be a better, more automated, way of getting the information. So I set out to write one, of which the DoubleStars github project is the first installment. The table shown below is one of the outputs of star_query.py after processing the HTML table from Bob King's article (above), more information than shown is written to an additional gzipped fits-format table.

For each input target the table below shows the official SIMBAD identifier, along with additional identifiers recognized by Simbad. In particular the Washington Double Star ID (to investigate the true status of the visual double as a binary system), the SAO ID (for controlling the NexStar), and the Hipparcos Output Catalog (HIP, for parallax and hence true distance). The Henry Draper (HD) ID is useful when searching in Kstars (which can also be used to control the NexStar). In addition, more accurate RA and Dec, spectral types with luminosity class, and in some cases stellar effective temperature (in Kelvin) and metal abundance are given (presumably again for the Primary).

Star SimbadID WDS SAO HIP NAME HD RA_icrs DEC_icrs magV spec_type Teff_(Fe_H) [Fe/H]
eta Cas * eta Cas J00491+5749AB 21732 3821 Achird 4614 0:49:06.3 57:48:54.7 3.44 F9V+M0-V 5899 -0.31
1 Ari * 1 Ari J01501+2217AB 74966 8544 None None 1:50:08.6 22:16:31.2 5.86 G3III+A3IV 0 0.00
gamma And * gam And J02039+4220A,BC None 9640 Almach None 2:03:54.0 42:19:47.0 2.10 K3II+B9.5V+A0V 0 0.00
iota Tri = 6 Tri * iot Tri J02124+3018AB 55347 10280 None 13480 2:12:22.3 30:18:11.0 4.95 G0III+G5III 0 0.00
eta Per * eta Per J02507+5554A 23655 13268 Miram 17506 2:50:41.8 55:53:43.8 3.79 K3-Ib-IIa 3500 0.09
32 Eri * 32 Eri J03543-0257AB None 18255 None None 3:54:17.5 -2:57:17.0 4.45 G8III+A1V 0 0.00
rho Ori * rho Ori J05133+0252AB 112528 24331 None 33856 5:13:17.5 2:51:40.5 4.44 K1III 4599 0.22
14 Aur * 14 Aur J05154+3241A 57799 24504 None 33959 5:15:24.4 32:41:15.4 5.00 A9V 7670 0.00
iota Ori * iot Ori J05354-0555A 132323 26241 Hatysa 37043 5:35:26.0 -5:54:35.6 2.77 O9IIIvar 18000 0.10
gamma Lep * gam Lep J05445-2227A 170759 27072 None 38393 5:44:27.8 -22:26:54.2 3.60 F6V 6306 -0.12
h3945 CMa * 145 CMa J07166-2319A 173349 35210 None 56577 7:16:36.8 -23:18:56.1 4.79 K3Ib- 3970 0.03
iota Cnc * iot Cnc J08467+2846A 80416 43103 None 74739 8:46:41.8 28:45:35.6 4.02 G8IIIaBa0.2 4905 -0.06
24 Com * 24 Com A J12351+1823A 100160 61418 None 109511 12:35:07.8 18:22:37.4 5.02 K0II-III 0 -0.04
xi Boo * ksi Boo J14514+1906AB 101250 72659 None 131156 14:51:23.4 19:06:01.7 4.59 G7Ve+K5Ve 5410 -0.05
alpha Her * alf Her J17146+1423AB None 84345 Rasalgethi 156014J 17:14:38.9 14:23:25.2 3.06 M5Ib-II+G5III+F2 0 0.00
95 Her * 95 Her J18015+2136AB 85648 88267 None 164669 18:01:30.4 21:35:44.8 0.00 A5IIIn 0 0.00
zeta Lyr * zet01 Lyr J18448+3736A 67321 91971 None 173648 18:44:46.4 37:36:18.4 4.36 Am 7914 0.38
Albireo * bet Cyg A J19307+2758A 87301 95947 Albereo None 19:30:43.3 27:57:34.8 3.09 K3II+B9.5V 4270 -0.17
31 Cyg * omi01 Cyg J20136+4644Aa,Ab 49337 99675 None 192577 20:13:37.9 46:44:28.8 3.80 K3Ib+B2IV-V 4186 0.03
beta Cap * bet Cap J20210-1447AB None None Dabih None 20:21:00.7 -14:46:53.0 0.00 0 0.00
gamma Del * gam Del J20467+1607AB None None None None 20:46:39.2 16:07:27.0 3.91 F7 0 0.00
delta Cep * del Cep J22292+5825A 34508 110991 None 213306 22:29:10.3 58:24:54.7 3.75 F5Iab:+B7-8 5695 7.62

That is a decent start, but it does have some deficiencies. In some cases the identifier is clearly associated with a pair of objects, as can be seen from the multiple spectral types, e.g. gamma And, iota Tri, 31 Cyg. That is not quite what we want, as the positions and other data aren't for a single star. Solving that is a topic for another post...

Sunday, February 04, 2018

Fixing Windows Update problems

I've been experiencing some Windows Update problems, in particular Windows update endlessly "Checking for updates". After much trial and error I found a How-To Geek article by Walter Glenn helpful. In particular, installing and using the WSUS Offline Update was necessary before cleaning out the wuauserv cache.

Thursday, February 01, 2018

Reading large JP2 files on Fedora

I recently had to analyze some very large (>100 megapixel) JP2 files and ran into the following problem on my Fedora 27 machine:

 jiv sat16_abi_fd6_l1b_CTfullimage_BA03_2018-030-204905.jp2  
 maximum number of samples exceeded (117679104 > 67108864)  
 error: cannot decode code stream  
 error: cannot load image data  
 cannot load image  
 Segmentation fault (core dumped)  

I got the same error "maximum number of samples exceeded" message from octave's imread or using gimp, which lead me to this link pointing to a compiled in limit in libjasper.

The solution is to compile a custom version of libjasper with a larger limit. This is straightforward, but how to get it done cleanly in terms of RPMs?

1:  sudo dnf -y install rpm-build rpmdevtools  
2:  rpmdev-setuptree  
3:  rpm -ivh jasper-2.0.14-1.fc27.src.rpm  
4:  cd rpmbuild/BUILD  
5:  tar xzvf ../SOURCES/jasper-2.0.14.tar.gz  
6:  cp -R jasper-2.0.14 jasper-2.0.14p  
7:  geany ./jasper-2.0.14p/jasper-2.0.14/builder/src/libjasper/include/jasper/jas_config.h  
8:  diff -puNr jasper-2.0.14/ jasper-2.0.14p/ > ../SOURCES/jasper-2.0.14-largefile.patch  
9:  cd ../SPECS  
10:  geany jasper.spec  
11:  QA_RPATHS=$(( 0x0001|0x0010 )) rpmbuild -ba jasper.spec  
12:  ls ../RPMS/x86_64/  

For step #7 we're making a single line change to move from a 64 megapixel limit to something closer to what we want, in my case 512 megapixels. Here is the diff generated in step #8:

1:  diff -puNr jasper-2.0.14/src/libjasper/include/jasper/jas_config.h.in jasper-2.0.14p/src/libjasper/include/jasper/jas_config.h.in  
2:  --- jasper-2.0.14/src/libjasper/include/jasper/jas_config.h.in    2017-09-14 19:20:10.000000000 -0400  
3:  +++ jasper-2.0.14p/src/libjasper/include/jasper/jas_config.h.in    2018-02-01 11:27:13.784393051 -0500  
4:  @@ -61,7 +61,7 @@  
5:   #endif  
6:   #if !defined(JAS_DEC_DEFAULT_MAX_SAMPLES)  
7:  -#define JAS_DEC_DEFAULT_MAX_SAMPLES (64 * ((size_t) 1048576))  
8:  +#define JAS_DEC_DEFAULT_MAX_SAMPLES (512 * ((size_t) 1048576))  
9:   #endif  
10:   #if defined(__GNUC__) && !defined(__clang__)  

A number of changes need to be made to the spec file in step #10. I changed the release to something that lets me know I made this, switched off debug builds (as they seem to cause trouble), and added the patch.Only the added lines are shown below.

 Release: 2dks%{?dist}  
 ...  
 %global debug_package %{nil}  
 ...  
 Patch102: jasper-2.0.14-largefile.patch  
 ...  
 %if "%{_arch}" == "x86_64"  
 %patch102 -p1 -b .largefile  
 %endif  
 
Once the RPMs are built (step #11) as user you can install them as root.

1:  su - # enter password  
2:  cd ~<username>/rpmbuild/RPMS/x86_64/  
3:  dnf install `ls | grep -v debug | xargs`  
4:  # if you need to go back to the old system versions use  
5:  # dnf downgrade jasper jasper-devel jasper-libs jasper-utils  

Then check that you can load your large JP2 file without that error message. If not, its likely you made a mistake in modifying the .h file, creating the patch or the spec file. (I had to try this a few times before I got it right.)

You can lock down these rpms so that dnf upgrades wont replace your hard work using dnf versionlock, see e.g., here.

Some useful links on dealing with source rpms on Fedora/Redhat systems:

Wednesday, December 28, 2016

Cloning a VirtualBox VM to an external drive under Windows 7

If you want to create a clone of a VirtualBox VM where the clone will be on an external drive, this can be done without performing any additional copying.

  1. Ensure the external drive you wish to use is mounted, you have enough disk space for the clone, and that you have an easy to find directory to store your clones(s) in. For example, I have W:\VirtualBoxVMs\
  2. Shutdown the VM to be cloned.
  3. In the VM VirtualBox Manager application, click File -> Preferences, and select the General tab.
  4. Make a note of the current Default Machine Folder that your VMs are in, e.g. C:\Users\YourUserName\VirtualBox VMs\
  5. Change the Default Machine Folder from the current one to the external directory you want the clone to be placed in. (In this example, W:\VirtualBoxVMs\).
  6. Right click the VM you wish to clone and select "Clone"
  7. When prompted for Clone Type select "Full clone" and click the Clone button
  8.  Cloning will take a while, so do something else...
  9. When the cloning is finished, verify that the clone boots and runs correctly by starting it from the VirtaulBox VM Manager.
  10. Shut down the clone.
  11. Perform steps 3 and 5 again, setting the Default Machine Folder back to the original value you made a note of in step 4.
  12. You can now safely remove the external drive if you want. (The clone will be marked as inaccessible if you dismount the drive, but will be automatically re-detected when the drive is mounted again in the future.)