Reference: Deleting wireless network connections in Fedora 16

It took me a few tries to figure out how to delete a wireless connection from NetworkManager on GNOME 3.2 systems (such as Fedora 16).

As far as I can tell, there’s no GUI way to do it.

It appears as if you should be able to remove connections with the command-line interface program nmcli with something like nmcli con delete id "Auto NetworkName" but that doesn’t seem to work for me. (Nor does it result in an error message.)

However, if I go to /etc/sysconfig/network-scripts and blow away the files corresponding the connection that I want to remove (sudo rm -f *NetworkName), the connection appears to get deleted. It’s at least no longer reported in nmcli con list.

Posted in Uncategorized | Tagged , | Comments Off

Reference: The Ultimate Resolved Source Cheatsheet

OK, this isn’t actually the ultimate resolved source cheatsheet … yet. I’m just trying to centralize my notes on dealing with extended sources. I’ve been doing this lately, and I had to rederive a bunch of things that I know I’ve figured out before. Hopefully, next time I’ll remember that I wrote all this stuff down here.

Units

Radio astronomical images typically come in two unit systems: Jy/pixel and Jy/beam. For various questions one usually wants to convert to Jy/arcsec² or Jy/sr. Jy/pixel is not trivially equivalent to Jy/arcsec², because the pixel size can change as a function of position in many map projections.

There must be something profound about why maps come in Jy/bm and models come in Jy/pixel, but I don’t see it right now.

Source fluxes are best measured as total fluxes which come in units of plain Jy. This should be obvious! Flux is conserved! In the general case peak fluxes are always dependent on the image properties.

The important exception, however, is unresolved sources which by their nature have a peak flux equal to their total flux no matter what unit system you’re using. Total flux of 1 Jy, peak flux of 1 Jy/px spread over 1 pixel, or peak flux of 1 Jy/bm spread out over 1 beam.

Resolved sources will have a peak flux that depends on the particular image units and projection, because the total flux will be spread out over a number of pixels that depends on the image particulars. In a Jy/px image, you need to figure out how many pixels the source subtends, and mutatis mutandis for Jy/bm. Generically, pkflux = totflux * arcsec2perpix / arcsec2insource. If you have a 2D Gaussian source where the axes are FWHMs in arcsec, arcsec2insource = 2 pi major minor / (8 ln 2).

I think the best way to work with Jy/bm is to go through Jy/px: the beam volume in pixels can be derived from the beam parameters and the pixel volume: pixperbm = arcsec2perbm / arcsec2perpix. For various operation I feel like this quantity will cancel out, though. Once again, due to the position-dependent pixel volume in most maps, this parameter is not constant across the map.

2D Gaussian Parametrizations

There are a few ways to parametrize a 2D Gaussian. I’ll omit centering and overall scaling in the following equations for simplicity.

Tersest. The simplest expression in terms of symbols is: y = \exp\left(Ax^2 + Bxy + Cy^2\right)

This parametrization is computationally efficient but not intuitive. One particular danger to note is that the parameters behave a bit oddly, and there are domain limitations that make it awkward for numerical optimizers (which are likely to tweak the parameters outside of their domains): A and C must be negative, and, if I’m doing my algebra right, you must have B² < 4AC.

Mathematical Major/Minor/PA. We often want to express the shape of the 2D Gaussian as a major axis σ1, minor axis σ2, and position angle θ. Here σ1 ≥ σ2 > 0 and θ is the rotation between the major axis and +x (with +θ being towards +y). Because of the symmetry of the shape, there’s a 180° degeneracy in θ.

We find A = -\frac{1}{2}\left[\frac{\cos^2 \theta}{\sigma_1^2} + \frac{\sin^2 \theta}{\sigma_2^2}\right], B = \sin \theta \cos\theta \left(\sigma_2^{-2} - \sigma_1^{-2}\right), and C = -\frac{1}{2}\left[\frac{\sin^2 \theta}{\sigma_1^2} + \frac{\cos^2 \theta}{\sigma_2^2}\right].

Inverting, we find \theta = \frac{1}{2}\arctan \frac{B}{A-C}, \sigma_1^{-2} = -\sqrt{(A-C)^2 + B^2} - A - C, and \sigma_2^{-2} = +\sqrt{(A-C)^2 + B^2} - A - C. During a roundtrip, θ may flip by 180° depending on the numerics, but as mentioned above this doesn’t change anything.

Astronomical Major/Minor/PA. This is the same as the above, except that by the definition of PA, the x axis is declination and the y axis is right ascension. Be careful to write y = \exp \left (A\delta^2 + B\alpha \delta + C\alpha^2\right).

Numerically-friendly. If you’re fitting for Gaussian parameters, it’s very helpful to numerical stability to have nice continuous behavior over all of your parameters. The B parameters above seem to be problematic, so here’s a parametrization that is pretty cheap to compute and behaves nicely: A=-\frac{1}{2}\left(p\cos^2\theta + q\sin^2\theta\right), B=\cos\theta \sin\theta(q-p), and C=-\frac{1}{2}\left(p\sin^2\theta + q\cos^2\theta\right). It shouldn’t be hard to see that \sigma_1 = p^{-1/2} and \sigma_2 = q^{-1/2}.

Here, the optimizer may end up with either of the σ values being the larger. If σ2 > σ1, you can exchange them and add (or subtract) π/2 to θ.

Wikipedia. The Wikipedia page on Gaussian Functions uses: y = \exp\left(-\left[ax^2 + 2bxy + cy^2\right]\right)

Here the condition on the parameters is that the matrix [a b \ b c] be positive definite, or that az_1^2 + bz_1z_2 + cz_2^2 > 0\, \forall z_1, z_2 (or, equivalently I think, that a and c be positive and b² < ac).

Wikipedia gives a conversion formula to this system from major/minor/PA, but there are two caveats: the Wikipedia system names σ{1,2} as σ{x,y} somewhat misleadingly, and inverts θ to be a clockwise rotation from +x to -y. Avoid those equations since the ones I give above are clearer.

Gaussian Convolutions

Resolved sources are often modeled as 2D Gaussians. These are convolved with the 2D Gaussian of your synthesized beam, so one often wants to compute this convolution or deconvolution analytically. The file src/subs/gaupar.for in MIRIAD has routines for going both directions, and they are not trivial. The deconvolution case needs special handling for sources that are close to (or smaller than!) point sources. The existing heuristics seem only so-so. See mmm/pwilliams/ms/mssfextract for a Python deconvolution implementation.

To manage flux through such a deconvolution, work in total flux units. Nothing changes! The peak flux is scaled in two ways: once, to convert from Jy/bm to Jy/px (assuming this is what you’re doing), which involves the beam volume and the pixel volume; and once to convert the source area, which involves the original volume and the deconvolved volume.

Gaussian Coordinate Transformations

When you have a Gaussian model for a source, this usally needs to be rendered into actual pixels or something.

Doing this purely geometrically is difficult. For instance, in a given map projection, the RA/Dec axes may not be precisely aligned with the X/Y pixel axes. If you want to draw a Gaussian source as an ellipse, you need to rotate it a little bit. If the source is very large, these effects change over the source extent and things get scary. It’s better to calculate the RA/Dec of each pixel and brute-force your way through many of these issues.

To do this brute forcing, you need to find the  value of the parameter that goes in the exponential. You can think of this as computing a distance in from the origin in the transformed space where the Gaussian is a circle. You un-translate, then un-rotate, then un-scale:

def gaussdist (x0, y0, maj, min, pa, x, y):
  # x0, y0: Gaussian center
  # maj, min: major/minor axes
  # pa: position angle, from +x toward +y

  dx, dy = x - x0, y - y0
  c, s = N.cos (pa), N.sin (pa)
  a = c * dx + s * dy
  b = -s * dx + c * dy
  d2 = (a / maj)**2 + (b / min)**2

  # d2: "distance" from Gaussian
  return d2

The astronomical “East from North” PA convention means that you can replace X with declination and Y with right ascension. This formulation can be turned into the one in the Wikipedia article on Gaussian Fuction but is a lot simpler to think about.

A: Converting Jy/pixel to Jy/arcsec²

To do this you need to calculate the size of a pixel at the position of the source you’re considering. Code to do this is in mmm/pwilliams/ms/msimgen. It looks something like this:

def pixelvolume (pixel2world, pixelcoords):
   delta = 1e-5
   w1 = pixel2world (pixelcoords)
   pixelcoords[X] += delta
   pixelcoords[Y] += delta
   w2 = pixel2world (pixelcoords)
   dra = w2[RA] - w1[RA]
   ddec = w2[DEC] - w2[DEC]
   return (dra**2 + ddec**2) / (2 * delta**2)

B: Error Ellipses From Covariant Variables

This is almost entirely unrelated to everything else here, except that it involves 2D Gaussians. Given two correlated variables, what are the parameters of the ellipse that describes a confidence region?

def ellpar (x, y, sx, sy, cxy, cl):
  # x: expectation value of x variable
  # y: expectation value of y variable
  # sx: std dev (not variance) of x var
  # sy: std dev (not variance) of y var
  # cxy: covariance (not corr. coeff.) of x and y
  # cl: desired confidence limit (0 < cl < 1)

  from numpy import arctan2, log, sqrt
  th = arctan2 (2 * cxy, sx**2 - sy**2)
  rcl2 = -2 * log (1 - cl)
  tmp1 = sqrt ((sx**2 - sy**2)**2 + 4*cxy**2))
  tmp2 = sx2**2 + sy**2
  maj = sqrt (0.5 * rcl2 * (tmp2 + tmp1)
  min = sqrt (0.5 * rcl2 * (tmp2 - tmp1)

  # x: same as input
  # y: same as input
  # maj, min: ellipse major minor axes as
  #   sigma values, not FWHMs
  # th: position angle, rotating from +x to +y
  return x, y, maj, min, th

This is derived by transforming X and Y to have a mean of 0 and stddev of 1, then considering the probability distribution of r = x²+y², which follows P(r) = r exp (-r²/2), and has CDF(r) = 1 – exp (-r²/2), allowing the r for a given confidence limit to be calculated.

Posted in Uncategorized | Tagged | Comments Off

Reference: SMA MIRIAD merge

Another note to self.

I looked into merging the SMA version of MIRIAD into mainline CVS. It’s a little scary, but I at least got things to compile. My fixes here. The merge itself is also involved because SMA MIRIAD was branched off of an old version. I don’t know if this will ever get merged since there is a lot of sketchy code in there.

Posted in Uncategorized | Tagged | Comments Off

Reference: MIRIAD and Fortran 90

A note-to-self for reference.

I tried to convert MIRIAD to use FC instead of F77 but it turns out to basically be a massive undertaking. As far as I can tell there’s no way to convince Automake to treat .f or .for files as Fortran 90, not Fortran 77.  (Search for .f90 in /usr/bin/automake, e.g.)

There’s a potential win here because the .for files can be compiled directly by gfortran without needing preprocessing by ratty, at least in the cases I’ve tried. It’d be very nice to skip the ratty circumlocutions.

Also note that wcslib and linpack come with ‘.f’ files. If there’s a trick to get automake to think of ‘.for’ files as Fortran 90, if it can’t also be applied to ‘.f’ files, we’ll still need to use F77 to build those libraries. (The same consideration applies to pgplot too, but it has its own configure script.)

Posted in Uncategorized | Tagged | Comments Off

Introducing: yahapj

Ready for some esoteric software?

Lots of astronomers write articles for submission to The Astrophysical Journal (“ApJ”) using LaTeX for manuscript preparation and the companion BibTeX for automated bibliography processing. One uses a “style file” to tell BibTeX how to format the bibliography according to ApJ specifications. The American Astronomical Society and NASA Astrophysics Data Systems provide such a style file, currently found here, but it has a few shortcomings:

  • References to ArXiV preprints don’t have their identifiers displayed.
  • Entries with DOI information don’t use this to link to the referenced articles.
  • Some BibTeX entries end their page numbers with a plus sign, and these get propagated into the bibliography and look bad.

(OK, the second two problems are pretty much cosmetic. The first one is significant, though.) Various people have fixed some of these problems, but there’s no canonical source of the ApJ style file, so things get out of sync. (For instance, AAS and NASA ADS currently post differing versions of the style file.)

Well, you can see where this is going. I’ve created a hacked version of the style file called yahapj.bst — “Yet Another (h)ApJ BibTeX Style”. It fixes the above problems, and I’ve attempted to solve the splintering issue by managing revisions on GitHub, here: github.com/pkgw/yahapj. The key benefit is that if people share their changes by cloning the Git repository and making commits, it will always be possible to compare the lineages of different versions of the file and merge them safely. Overkill? Perhaps. But it’s the correct solution.

To summarize, why should you use yahapj?

  • Attractive, ApJ-compliant bibliographies with embedded links to digital articles and preprints whenever possible.
  • It’s easy to check that you’re using the latest, greatest version, and as easy to hack the file as you can get. (Which isn’t super-easy given BibTeX’s bizarre style language, but that’s another issue.)

I’ve even got a screenshot!

The blue parts are links in the PDF file. If you’re about to say something about journal abbreviations, I know, and it’s beyond the control of yahapj.

Posted in Uncategorized | Tagged , | Comments Off

The Galactic Center, as seen by the ATA

It’s been a little while since I’ve made any cool pictures. But lately, I’ve been focusing on getting a rough-draft version of a large-scale map of the Galactic Center from my ATA transient survey data. Here’s what I’ve got so far — click on the image for the full-scale version:

There are some holes because it turns out that some of our fields were only observed during the first season of observing, when we took data at a longer wavelength that turned out to be very difficult to work with.

Posted in Uncategorized | Tagged , | 1 Comment

Reference: Converting PDF Directly to EPS

Simple: pdftops -eps figure.pdf figure.eps, using a program from the poppler-tools package. This deals with white space on the edge of the bounding box much better than pdf2ps, and seems to deal with text better too.

Posted in Uncategorized | Tagged | Comments Off

Reference: Replacing Mozilla Prism for Site-Specific Browsing on Linux

Mozilla briefly offered a little program called Prism that let you build a site-specific browser (SSB): a browser with a stripped-down interface that is intended for interacting with one particular site. The idea is that if you plan to stay entirely on one site during a browsing session, nowadays you often don’t really need the location bar, back and forward buttons, history, etc. This may sound silly, but I’ve found stripped-down SSB interfaces much nicer than those of regular browsers, when they’re appropriate.

Mozilla says it’s dropped Prism in favor of a project called Chromeless. Unfortunately Chromeless seems to have very different goals, and it appears to have no support at all for saying, “Please make an SSB for this webpage now.” The development of Chromeless has also been very slow recently. Meanwhile, Prism isn’t entirely compatible with Firefox 3 and above, which has been bad news for my SSB-loving self.

I’ve looked into this a bit, and it turns out that with recent versions of Firefox, the capabilities of the old Prism can be emulated. I’ve done this on Linux, but similar approaches ought to be workable on other OSes. The limitations that I know of are:

  • It’s a hassle to set up a new SSB.
  • External links open in the SSB UI, not your default Firefox UI.
  • If you open an SSB UI without a default Firefox UI existing, attempts to create new Firefox windows will create windows in your SSB UI.
  • If you try to launch an SSB twice, you’ll get a complaint about Firefox being running but unresponsive.
  • The icons for running applications aren’t differentiated.

That being said, here are the instructions for replacing Mozilla Prism on a Linux system.

  • In a terminal, run firefox -ProfileManager -no-remote.
  • Create a new profile.
  • Give it a name related to the website you want to make an SSB for. Mozilla recommends that profile names be all-lowercase and not contain spaces. My example will be “gdocs”; for multiple SSBs, just replace “gdocs” with a different name in everything that follows.
  • Start up the browser using this profile.
  • Navigate to the main page for your site.
  • In the Preferences screen, set the Home Page to the current page. If the URL contains bits that look superfluous, edit them out. (You can test the homepage setting by hitting Alt-Home to see if the bits really were superfluous.)
  • In the Tabs section of the Preferences screen, turn off “Always show the tab bar” and “Open new windows in a new tab instead”.
  • (Extra credit — these bits will give your SSB launcher the icon of your chosen website.) Hit Control-I to get the Site Information window. Choose the Media section, find the image that corresponds to the website’s bookmark icon — this is usually the first image and is usually called favico.ico. Use the “Save As…” button to save it somewhere.
  • In the View → Toolbars submenu, disable as many of the toolbars as you want. If you disable the menu bar, it can be recovered by hitting Alt-f. (This feature is only available in newer Firefoxes; it’s definitely present in update 7.)
  • (Extra credit part II.) Convert the downloaded site icon to a PNG named ~/.local/share/icons/ssb-gdocs.png. The aptly-named command-line tool convert is fine for this.
  • Create a file called ~/.local/share/applications/ssb-gdocs.desktop. Fill it with the contents shown below.
  • Repeat the above steps for as many SSBs as you’d like to create. When done, exit all Firefox instances, SSBs and default profile alike. Run firefox -ProfileManager. Select your default profile, and start up Firefox. This step is necessary to tell Firefox that you want it to start up using your default profile by default.
  • On Fedora systems, a launcher for your SSB will appear in the Other section of your Applications menu. You can drag this launcher onto your desktop or the panel if you want.

Here are the template contents of the desktop file:

[Desktop Entry]
Name=GDocs
Type=Application
Comment=Google Documents
Exec=firefox -P gdocs -no-remote
Icon=ssb-gdocs.png

If you haven’t been doing the extra credit, use Icon=redhat-web-browser.png on Fedora machines.

Posted in Uncategorized | Tagged | Comments Off

Gridded Visibility Weights

No actual science content here — I just thought this looked cool:

This maps out how much information one of the ATA antennas contributed to the sampling of the sky during one of my observations. Each track comes from its pairing with another antenna and moves elliptically as the Earth rotates. The space that’s being mapped is the “visibility” plane, the 2D Fourier transform of the sky.

Posted in Uncategorized | Tagged | Comments Off

One Piece of the Puzzle: w-Projection

In my previous post I mentioned that w-projection might help the issues I was seeing with the sources on the very edges of my Cyg X-3 image. I’ve gotten to the point where I can use CASA’s imager on some sample Cyg X-3 data, and indeed it makes a difference.

Below are some zoomed-in images, with the cross representing the catalog position of DR 21. Here’s it without w-projection:

DR 21 without w-projection

And here it is with w-projection:

DR 21 with w-projection

I believe that there are still issues to resolve regarding the hour angle dependence, but it’s nice to see the algorithm work so well for these particular sources.

Posted in Uncategorized | Tagged , | Comments Off

Hour-Angle Dependence in ATA Imaging

I’ve been working on a search for radio transients in repeated ATA observations of Cygnus X-3 and its environs. While looking at various difference images, I realized that there seems to be an hour angle (HA) dependence in ATA imaging. One working theory is that this is due to a phase gradient in the average ATA primary beam (PB), though I haven’t yet investigated this idea deeply.

Figure 1 below demonstrates the effect. Using a dataset of many observations of Cyg X-3, I made four images, each from different HA subsets of the data: one at HA ≅ -5.5, one at HA ≅ -2, one at HA ≅ +2, and one at HA ≅ +5.5. The animation cycles back and forth through the four images. If you follow the source at the very top left of the map, you can see it dance back and forth along a parabolic arc. (It drops below the lower cutoff in the third image.) When it is at its leftmost, the image comes from observations of HA ≅ -5.5; when it is at its rightmost, it comes from HA ≅ +5.5. Obviously, the position of the source should not vary with HA.

Figure 1. Point sources wander as a function of HA, with the effect becoming more significant as distance from phase center increases.

The circle denotes the half-power point of the ATA PB at the observing frequency, 3.1 GHz. The other boxes give reference points for other sources; note that the source at phase center, Cyg X-3, does not move appreciably. The plus signs denote approximate fiducial positions of the two distant sources, which are DR 21 and DR 22. There are clearly other aspects of the imaging that are varying; these are likely due to the differing UV coverage of the different observations, and the fact that I have only a few observations at very low HAs, while I have many at moderate-to-high HAs.

Figure 2 shows how the HA variations manifest themselves with regards to the extended structure in the field. The extended structure is brought out by integrating over wider ranges of HA; Figure 2 blinks between data at HA < -3 and HA > +3. The overall effect looks like a translation, though again, the size of the effect increases with distance from phase center. An important point of this figure is that the effect is discernible even well within the first PB null, so it’s not something that only affects a few sources far away from phase center. Additionally, while it’s the case that I’m not using w-projection or faceting, and this might affect the very far-out sources, it shouldn’t be significant for the emission within the half-power point.

Figure 2. Effect of HA variations on extended structure, made visible by integrating over larger HA intervals.

The parallactic angle swings from -50° to +50°, through -180°, as the HA advances from -6 to +6. Figure 3 visualizes this.

Figure 3. Parallactic angle as a function of HA. Colors are irrelevant.

When it comes to point sources at more than twice the half-power point, I don’t worry too much about unusual imaging artifacts. But this effect seems to be significant much closer to the phase center as well. You could definitely imagine workarounds: for instance, if I group my data by HA, image the groups, and average the deconvolved images together, I get better results than imaging all of the data at once.

But it would be nice to actually understand and fix the underlying issue. One explanation is that there’s a phase gradient across the mean ATA PB; as the PB rotates on the sky, the position errors on sources away from the phase center vary. You could imagine such a phase gradient arising from some sag in the arm supporting the secondary, since ATA antennas use an offset-Gregorian architecture. This explanation has the advantage of potentially being a nice testcase for using MeqTrees with ATA data. Another possibility that has been suggested to me is that our antenna positions are not quite right and so our UV coordinates get inaccurate at extreme HAs.

Posted in Uncategorized | Tagged , | 3 Comments

Reference: LaTeX, hyperref, and “Command \url already defined.”

Another random computer fix. I was trying to compile a document with pdflatex, and was getting:

LaTeX Error: Command \url already defined.

My document used the hyperref package, and disabling this did make the problem go away. But I could compile the document on another machine without problems.

It turned out that the culprit was the latex2html package. The hyperref package requires a package called url.sty, which normally has some special hooks that are invoked when hyperref (and perhaps pdflatex) are active. However, latex2html comes with an old version of url.sty that doesn’t have these hooks, and on my machine LaTeX prefers the version that comes with latexhtml (in the tex/latex/html/ subdirectory of the texmf tree) to the usual version (in tex/latex/ltxmisc/).

Uninstalling latex2html solved the problem. Of course, now I don’t have latex2html, but I don’t need it at the moment.

Posted in Uncategorized | Tagged , , | Comments Off

Reference: Configuring a NetworkManager Wireless Connection without Graphics

Say, hypothetically, that you install a new Linux distribution and your machine locks up whenever you try to log in graphically. You might want to set up a wireless connection to see if there are system updates available that might fix the problem. If your system uses NetworkManager, it might not be clear how to accomplish this.

The NM SystemSettings page and settings specification document are useful references, but don’t pull the full answer together. You want to create a file in /etc/NetworkManager/system-connections/, named whatever you like. It should be owner root:root and mode 600. The contents should look like:

[connection]
id=Argh
uuid=11111111-1111-1111-1111-111111111111
type=802-11-wireless
timestamp=0

[802-11-wireless]
ssid=SEE BELOW
mode=infrastructure
security=802-11-wireless-security

[802-11-wireless-security]
key-mgmt=wpa-psk
psk=YOUR-NETWORKS-PASSWORD-IN-PLAINTEXT

[ipv4]
method=auto

Obviously this only works for WPA/PSK mode, but I think that’s by far the most common for encrypted WiFi networks these days.

The SSID is specified as a byte string. If your SSID is expressible in ASCII you can generate this with a Python snippet like: ';'.join(str(ord(c)) for c in 'SSID')+';'. For instance, the network ‘Sample’ is expressed as “83;97;109;112;108;101;“. No quotation marks are used in the config file.

NetworkManager appears to monitor the system-connections directory, and may initially reject your file if it doesn’t have the restrictive permissions it wants. Editing the file after the permissions have been changed causes that to be reloaded. The command “nmcli con up id Argh” should activate the connection.

Posted in Uncategorized | Tagged , , | 1 Comment

Reference: What to Do If Fedora 15 Locks Up on Login

I just tried installing the just-released Fedora 15, which comes with the new GNOME 3 user interface. As expected, the new software has some rough edges … well, it freezes my computer as soon as I try to log in. (I’m not angry about this since F15+GNOME3 is bleeding-edge software, with lots of churn in the graphics code, which tends to be both hard-to-test and disaster-prone. I did this install on a noncritical machine of mine with the two-sigma expectation that it wouldn’t work.)

If GNOME 3 thinks your desktop doesn’t support 3D acceleration, it will use a “fallback mode” that avoids it. This sounded like what I needed, since Linux lockups on desktops are almost always associated with 3D graphics drivers. Unfortunately, the only documented way to turn on fallback mode is through the graphical interface, which I couldn’t get to.

The best method that I could discover to fix this is as follows:

  1. Boot up the machine in single-user mode, by pressing keys during bootup, then editing the GRUB kernel arguments to add a “1″ at the end of the kernel commend line. (The “1″ can be thought of as implying “single-user mode”.)
  2. Run: rpm --nodeps -e gnome-shell
  3. Exit the root maintenance-mode shell.
  4. Log in as your regular graphical user. You should be brought into fallback mode.
  5. Forcing fallback mode permanently via the GUI: user menu → System Settings → System Info → Graphics → Force Fallback Mode: on.

Why the “–nodeps”? Because the gnome-panel package, which is needed to use the fallback mode, requires gnome-shell, the new GNOME 3 UI, “to band aid upgrades”, according to the RPM changelog.

You might think that there would be a text-mode way to change the setting. And it seems that there should be. The org.gnome.desktop.session.session-name GSetting needs to changed from “gnome” to “gnome-fallback”. From my read of the docs, it should be possible to do this by running the command:

gsettings set org.gnome.desktop.session session-name \'gnome-fallback\'

(The escaped single quotes are necessary.) When I tried this from a text login, it didn’t give any indication of failure, but didn’t do anything. This page suggests that the command should be run with the environment variable GSETTINGS_BACKEND=dconf, but that didn’t change anything for me. My extrapolation was that the following command should also have done the trick:

dconf write /org/gnome/desktop/session/session-name \'gnome-fallback\'

but this gave a DBus error involving the inability to connect to an X11 server. It would surprise me if DConf required an X11 connection, but perhaps it does.

Posted in Uncategorized | Tagged , , | Comments Off

HTML Articles that Are Actually Decent

Most scientific journals offer articles in HTML format, but the conversion is usually pretty poor — see, to pick a typical example, Wilms et al. 2007. The HTML version is definitely readable, but has some rough edges, and doesn’t really give you much of a reason to prefer it to the PDF version (if your PDF reader is any good).

Sometime recently the publishers of Annual Reviews revamped their website and clearly put some effort into doing a better job — for example, Morales & Wyithe 2010. The design is more attractive. The figures and references float, so you can go between them and the text more easily. Internal and external links are more pervasive, and content is offered in multiple formats, including figures as PowerPoint slides for the truly lazy talk-preparer. There are definitely quibbles one could offer, but the overall experience is much nicer than anything else that I’ve seen. A similar amount of effort has been put into the overall website, linking together all of the journals. It’s really nice to see.

Posted in Uncategorized | Tagged | Comments Off

Reference: Non-Linux Cheat Sheet

On Solaris:

  • ps xa becomes ps -ef
  • ps xauwww becomes pargs
  • strace becomes truss
  • find [args] becomes find . [args] -print

On MacOS X:

  • strace becomes dtrace or ktrace
  • ldd becomes otool -L

To be updated, no doubt, as time passes …

Posted in Uncategorized | Tagged | Comments Off

Peer Production and Science

I wanted to write a quick note about an article I just finished reading: “Coase’s Penguin, or, Linux and The Nature of the Firm”, by Yochai Benkler. I’m a bit behind the curve here — it was published in 2002 — but my initial reaction is that it’s deeply profound. The paper analyzes peer-production systems, like Wikipedia or open-source software projects, from an economic perspective, with the “economic” construed broadly (as economists are wont to do). That is, it treats peer production as an efficiency phenomenon, rather than a social one. I hadn’t thought about things that way at all before. There’s a really interesting assessment of the conditions in which peer-production systems end up making sense, but rather than attempting to abstract the article myself, you should just click on the link.

I’m excited not only by the analysis but also by the obvious commonalities between peer-production systems, science, and academia in general. Benkler mentions these repeatedly but doesn’t investigate them deeply. (With the piece weighing in at 79 pages already, I don’t blame him.) It seems to me that it’d be extremely illuminating to do this, especially because, if you ask me, there’s a widespread sense in the community that changes are brewing in the fundamental way that science is conducted and the academic profession works. In the nine years since this paper was published, someone has surely pursued this.

My intuition from Benkler’s paper is actually strong pessimism about peer-produced science as most people discuss it now, but a sense that maybe you’ll see much more bifurcation of “science” into things that are amenable to peer-production (Galaxy Zoo being the incredibly obvious example) and things that aren’t (perhaps this?). But this is a very vague feeling, and this seems like a topic where superficial thoughts are not likely to be correct.

The next thing on my list to read might be Hal Varmus’ “E-Biomed Proposal”, referenced by Benkler’s article, which seems to give Hal’s thoughts on what science might, or should, look like in the future. But it is late, and the proposal is long.

(Benkler’s paper springboards from a famous work by Ronald Coase, “The Nature of the Firm”, which considers the questions of why firms need to exist in a market economy [“couldn’t everyone just be their own independent little entrepreneur?”], which is one of those good questions that I hadn’t even thought to ask before. I found it via “Dean’s Penguin”, by Mark Schmitt, applying that thinking to Howard Dean’s campaign, via Matt Yglesias.)

Posted in Uncategorized | Tagged | Comments Off

On Working From Home

I’ll often leave the office planning to finish up a small bit of business at home: read a paper, work on a manuscript, write a bit of code, or something else along those lines. It almost never happens in practice. I don’t think I’m the only one who has this experience — I know that my adviser has the best of intentions, but whenever he tells me that he’ll take care of something “this evening,” I can assume that it won’t get done. (He’s at least got a family to go home to, while all I have is this tear-stained magazine clipping of Justin Bieber.)

In my case, the Internet is the problem: when I’m physically at work, I do a good job of not distracting myself every ten seconds with Twitter, blogs, and the rest; but at home, I don’t. (Perhaps relatedly, the one kind of homework that I do well is that ur-distraction, email.) I’ll sit down and be totally ready to do something useful but then some funny link will come up and suddenly it’s midnight. I’ve found that I have enough discipline to keep working once I get going, but unless super-hard deadlines are involved I don’t have enough discipline to start working in the first place.

I think that I’ll be more likely to start my homework if I believe that I’ll finish it quickly — “OK, I’ll just get this over with, then I can go back to YouTube.” So I’m going to try imposing a half-hour homework rule: if I plan to do non-urgent homework, I’ll be satisfied with half an hour of effort. During that time, I won’t let myself get distracted, but once it’s passed, I’ve done my duty and can go back to cat videos if I want. If I get engrossed and want to keep going, so be it, but I will refuse to feel bad for calling it quits after thirty minutes.

I’m optimistic about this strategy. I think the name is catchy, too, and isn’t that half the battle right there?

Posted in Uncategorized | Tagged | 3 Comments

How to Run a Research Group

First point: I don’t know how to run a research group, and I have no experience in doing so.

Second point: That being said, something that I read recently has been making me think about this particular topic. I found it on the blog of Matt Might, a CS professor at Utah who had 15 seconds of webfame for “The Illustrated Guide to a Ph.D.” In an list of academic productivity tips, he mentions

Running a research group is a lot like running as small business. Make it real by branding your research group: give it a name. (Like U Combinator! [His group. — PKGW]) If you’re working a project, give the project a product name or a code name.

What got my attention wasn’t the particular “give it a name” idea or “small business” analogy, but the broader point. A research group is an organization. Not a big one, but one nonetheless. I generally hate it when people do the following, but it seems helpful here: let’s look up a definition of “organization”! Wikipedia:

An organization … is a social arrangement which pursues collective goals, controls its own performance, and has a boundary separating it from its environment.

The academic research groups with which I’m familiar tend not to be so good at the “boundary” part — they generally don’t work very hard at establishing an organizational identity. (Obviously, I’m most familiar with my adviser’s group, but it’s not the only one I have in mind. I don’t know much about groups outside of astronomy.) I think this is too bad: from what I’ve seen, people are a lot more enthusiastic about their work when they feel like they’re part of a team and that everyone’s pulling in the same direction. It also makes a big difference when everyone knows what their “collective goals” are. (Even if, I would say, they don’t necessarily agree with all of them.)

The other thing that I notice is that research groups tend not to have a lot of the infrastructure that one associates with organizations. No, you don’t need to write up an org chart for a group of seven people, but some things genuinely are helpful — particularly, I’d say, communications tools. I get the impression that many groups don’t even set up a shared email list, which amazes me given that in the year 2011 doing so is utterly trivial. Besides being practical, shared spaces like these help build up that sense of organizational identity.

Lately I’ve been thinking about how I’d try to do things if I was in charge. A standalone domain name and a website with a prominent list of members are, I think, mandatory. So’s an email list. A table of group publications seems natural. This may be a sickeningly corporate way to put it, but end-of-semester parties would be a good way to celebrate everyone’s accomplishments over the past six months. And speaking of sickeningly corporate, I even think it’d be great for groups to come up with mission statements and have lists of core values.

We do great science by:

  • Choosing the right problem
  • Using (or building) the right tool for the job
  • Keeping things specific, and
  • Knowing when to say “good enough”.

Doesn’t that make you want to go out and do some kickass research right now?

As I mentioned at the top of this post, I don’t actually have any practical experience in this area, so maybe I should pay more attention to the fact that I don’t see many of these ideas being implemented in practice. But astronomy does tend to do things differently — I’d be curious about what happens in other disciplines.

Posted in Uncategorized | Tagged , , | Comments Off

Reference: CSS image too tall for its text

A technical note-to-self on a problem that I’ve run into a few times. Sometimes when setting up webpages, one wants to have a box with some kind of graphic floated to the side of some text. Because the graphic is floated, it apparently doesn’t affect the height of the whole box, so if the text is too short, the box is shorter than the graphic and looks terrible.

The solution — or, a solution that at least works in Firefox — is to add an empty element with its CSS “clear” property set to “both” at the bottom of the box. The “clear” property forces the element to be laid out below any floats, which extends the height of the non-floating material to be sufficiently tall. This is easy to do with:

<div style="clear: both;"></div>

after the text and image elements.

Posted in Uncategorized | Tagged , , | 3 Comments