Showing posts with label computing. Show all posts
Showing posts with label computing. Show all posts

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.)

Thursday, October 16, 2014

Hooray, Octave supports numpy-style boolean array indexing operations

I've only just discovered that Gnu Octave (the Gnu version of Matlab) supports numpy-style boolean array indexing operations, in particular

  • logical operations on vectors to return boolean true/false vectors
  • array indexing using vectors on vectors
An example, using a simple vector a.
octave:2> a=[1 2 3 4 1 2 3 4]
a =

   1   2   3   4   1   2   3   4

Create a boolean mask called b with all elements of a greater than 2.
octave:3> b=a > 2
b =

   0   0   1   1   0   0   1   1
Now use b to access only those elements of a that are true in the mask array b.
octave:4> a(b)
ans =

   3   4   3   4
Why use Octave when we have python/numpy/scipy? Sometimes its just faster to fire up octave to get a look at data, and matlab/octave syntax is much less verbose than python.

Friday, July 11, 2014

How much does a square root cost?

An interesting diversion: how much (time) does calling the square root function sqrt() cost, and is it even worth trying alternative less-accurate implementations?

Some Assembly Required provides some answers: 

SQUARE ROOT
Method Total time Time per float Avg Error
Compiler sqrt(x) /
x87 FPU FSQRT
404.029ms 24ns 0.0000%
SSE intrinsic ssqrts 200.395ms 11.9ns 0.0000%
Carmack’s Magic Number rsqrt * x 72.682ms 4.33ns 0.0990%
SSE rsqrtss * x 20.495ms 1.22ns 0.0094%
SSE rsqrtss * x
with one NR step
53.401ms 3.18ns 0.0000%
SSE rsqrtss * x
with one NR step, unrolled by four
48.701ms 2.90ns 0.0000%
RECIPROCAL SQRT
Method Total time Time per float Avg Error
Carmack’s Magic Number rsqrt 59.378ms 3.54ns 0.0990%
SSE rsqrtss 14.202ms 0.85ns 0.0094%
SSE rsqrtss
with one NR step
45.952ms 2.74ns 0.0000%

Thursday, June 05, 2014

The (Forever) Language War

I generally find comparisons between programming languages to be a waste of time given they're largely based on personal preference over objective metrics, and even metric-based comparisons are often superficial or downright misleading (yeah, I'm talking about you Julia). Generally my view is use what best fits the application modulo your expertise, and the language doesn't really matter - it is an implementation choice.

That said, I've lately being feeling rather down about C++ which is the language I develop in most heavily. Sure, it has speed and expressive power but some of the most powerful features are semantically non-trivial and most galling of all, it really doesn't come with many standard "packages" in the way Java and Python do. OK, it comes with the STL, which I do like, but then you have to go to Boost, and then you look at how some of the Boost packages are coded and you wonder if it is even the same language. In a very large and complicated project I find the developer (or more technically, integration troubleshooter and debugger) role to have low productivity. It isn't as bad as perl but it is easy for "other" programmers to write code that is just overly complicated for the job. Oh great, someone has learnt about the Abstract Factory pattern, and has decided to use it everywhere: attempt to drill down through layers of unnecessary obfuscatory abstraction (that manages to be coupled to a million other things instead of decoupling the way abstraction should do) to find what some code is actually doing. Analyze, debug, code, compile ... ... ... and run again, all while you have a supposedly critical release deadline looming.

It is easy to forget the problem what C++ set out to fix, which I was reminded of when I starting reading "Learning OpenCV". Now OpenCV is a wonderfully powerful open source library in my opinion, based on mainly using it before now through its Python bindings. But reading how to use the C API was eye opening. What, I have to remember to delete those resources? Oh great, void* pointers and I have to remember what type to cast to/from. I could just imagine the fun bugs someone had to deal with. Suddenly C++ didn't seem so doddering.

While reading about Apple's new Swift language at Slate.com (Another new proprietary language to tie developers to Apple and in darkness bind them, how exciting for the Mac fan boys!) I came across a link to a discussion by David Green comparing his experience trying out both iOS and Android development tools. The comments are the article reveal the pattern that makes me dislike language comparisons: In a discussion of X and Y you must be biased toward X because you know more about it X so really X and Y are equally good. (There should be a name for this fallacy but I can't seem to find it). However the article itself is worth a look, because it compares the iOS+Xcode+Objective-C platform to Android+Eclipse+Java platform in terms of ease of development. I've always been somewhat curious about Xcode and Objective-C, but David Green's article is enough to stop me wasting my time. What the commentators on his article don't understand is that while you can do great stuff with Xcode and Objective-C it has placed extra hurdles in your way: the extra verbosity needed in the language, the extra time it'll take to hunt down solutions to non-trivial problems. That time might not matter to some developers, in particular to Apple-only developers, but it will to matter to someone and it certainly matters to me.

Tuesday, December 11, 2012

Unix tip: Show gcc's predefined macros

If you ever need to know what your Gnu compiler is setting as predefined macros, along with their values, then run the following command in a shell:

gcc -dM -E - < /dev/null | sort
I recently had to find out how to do this to fix a bug compiling old versions of boost on Fedora, and thought this sufficiently interesting to note down permanently. The following is the output on the virtual Fedora I'm running on my Macbook. Not only can you get access to the version of the compiler but there is a host of primitive type size and precision information.
#define __amd64 1
#define __amd64__ 1
#define __BIGGEST_ALIGNMENT__ 16
#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
#define __CHAR16_TYPE__ short unsigned int
#define __CHAR32_TYPE__ unsigned int
#define __CHAR_BIT__ 8
#define __DBL_DECIMAL_DIG__ 17
#define __DBL_DENORM_MIN__ ((double)4.94065645841246544177e-324L)
#define __DBL_DIG__ 15
#define __DBL_EPSILON__ ((double)2.22044604925031308085e-16L)
#define __DBL_HAS_DENORM__ 1
#define __DBL_HAS_INFINITY__ 1
#define __DBL_HAS_QUIET_NAN__ 1
#define __DBL_MANT_DIG__ 53
#define __DBL_MAX_10_EXP__ 308
#define __DBL_MAX__ ((double)1.79769313486231570815e+308L)
#define __DBL_MAX_EXP__ 1024
#define __DBL_MIN_10_EXP__ (-307)
#define __DBL_MIN__ ((double)2.22507385850720138309e-308L)
#define __DBL_MIN_EXP__ (-1021)
#define __DEC128_EPSILON__ 1E-33DL
#define __DEC128_MANT_DIG__ 34
#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
#define __DEC128_MAX_EXP__ 6145
#define __DEC128_MIN__ 1E-6143DL
#define __DEC128_MIN_EXP__ (-6142)
#define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL
#define __DEC32_EPSILON__ 1E-6DF
#define __DEC32_MANT_DIG__ 7
#define __DEC32_MAX__ 9.999999E96DF
#define __DEC32_MAX_EXP__ 97
#define __DEC32_MIN__ 1E-95DF
#define __DEC32_MIN_EXP__ (-94)
#define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF
#define __DEC64_EPSILON__ 1E-15DD
#define __DEC64_MANT_DIG__ 16
#define __DEC64_MAX__ 9.999999999999999E384DD
#define __DEC64_MAX_EXP__ 385
#define __DEC64_MIN__ 1E-383DD
#define __DEC64_MIN_EXP__ (-382)
#define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD
#define __DEC_EVAL_METHOD__ 2
#define __DECIMAL_BID_FORMAT__ 1
#define __DECIMAL_DIG__ 21
#define __ELF__ 1
#define __FINITE_MATH_ONLY__ 0
#define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__
#define __FLT_DECIMAL_DIG__ 9
#define __FLT_DENORM_MIN__ 1.40129846432481707092e-45F
#define __FLT_DIG__ 6
#define __FLT_EPSILON__ 1.19209289550781250000e-7F
#define __FLT_EVAL_METHOD__ 0
#define __FLT_HAS_DENORM__ 1
#define __FLT_HAS_INFINITY__ 1
#define __FLT_HAS_QUIET_NAN__ 1
#define __FLT_MANT_DIG__ 24
#define __FLT_MAX_10_EXP__ 38
#define __FLT_MAX__ 3.40282346638528859812e+38F
#define __FLT_MAX_EXP__ 128
#define __FLT_MIN_10_EXP__ (-37)
#define __FLT_MIN__ 1.17549435082228750797e-38F
#define __FLT_MIN_EXP__ (-125)
#define __FLT_RADIX__ 2
#define __GCC_HAVE_DWARF2_CFI_ASM 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
#define __GNUC__ 4
#define __GNUC_GNU_INLINE__ 1
#define __GNUC_MINOR__ 6
#define __GNUC_PATCHLEVEL__ 3
#define __GNUC_RH_RELEASE__ 2
#define __gnu_linux__ 1
#define __GXX_ABI_VERSION 1002
#define __INT16_C(c) c
#define __INT16_MAX__ 32767
#define __INT16_TYPE__ short int
#define __INT32_C(c) c
#define __INT32_MAX__ 2147483647
#define __INT32_TYPE__ int
#define __INT64_C(c) c ## L
#define __INT64_MAX__ 9223372036854775807L
#define __INT64_TYPE__ long int
#define __INT8_C(c) c
#define __INT8_MAX__ 127
#define __INT8_TYPE__ signed char
#define __INT_FAST16_MAX__ 9223372036854775807L
#define __INT_FAST16_TYPE__ long int
#define __INT_FAST32_MAX__ 9223372036854775807L
#define __INT_FAST32_TYPE__ long int
#define __INT_FAST64_MAX__ 9223372036854775807L
#define __INT_FAST64_TYPE__ long int
#define __INT_FAST8_MAX__ 127
#define __INT_FAST8_TYPE__ signed char
#define __INT_LEAST16_MAX__ 32767
#define __INT_LEAST16_TYPE__ short int
#define __INT_LEAST32_MAX__ 2147483647
#define __INT_LEAST32_TYPE__ int
#define __INT_LEAST64_MAX__ 9223372036854775807L
#define __INT_LEAST64_TYPE__ long int
#define __INT_LEAST8_MAX__ 127
#define __INT_LEAST8_TYPE__ signed char
#define __INT_MAX__ 2147483647
#define __INTMAX_C(c) c ## L
#define __INTMAX_MAX__ 9223372036854775807L
#define __INTMAX_TYPE__ long int
#define __INTPTR_MAX__ 9223372036854775807L
#define __INTPTR_TYPE__ long int
#define __k8 1
#define __k8__ 1
#define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L
#define __LDBL_DIG__ 18
#define __LDBL_EPSILON__ 1.08420217248550443401e-19L
#define __LDBL_HAS_DENORM__ 1
#define __LDBL_HAS_INFINITY__ 1
#define __LDBL_HAS_QUIET_NAN__ 1
#define __LDBL_MANT_DIG__ 64
#define __LDBL_MAX_10_EXP__ 4932
#define __LDBL_MAX__ 1.18973149535723176502e+4932L
#define __LDBL_MAX_EXP__ 16384
#define __LDBL_MIN_10_EXP__ (-4931)
#define __LDBL_MIN__ 3.36210314311209350626e-4932L
#define __LDBL_MIN_EXP__ (-16381)
#define __linux 1
#define __linux__ 1
#define linux 1
#define __LONG_LONG_MAX__ 9223372036854775807LL
#define __LONG_MAX__ 9223372036854775807L
#define __LP64__ 1
#define _LP64 1
#define __MMX__ 1
#define __NO_INLINE__ 1
#define __ORDER_BIG_ENDIAN__ 4321
#define __ORDER_LITTLE_ENDIAN__ 1234
#define __ORDER_PDP_ENDIAN__ 3412
#define __PRAGMA_REDEFINE_EXTNAME 1
#define __PTRDIFF_MAX__ 9223372036854775807L
#define __PTRDIFF_TYPE__ long int
#define __REGISTER_PREFIX__
#define __SCHAR_MAX__ 127
#define __SHRT_MAX__ 32767
#define __SIG_ATOMIC_MAX__ 2147483647
#define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1)
#define __SIG_ATOMIC_TYPE__ int
#define __SIZE_MAX__ 18446744073709551615UL
#define __SIZEOF_DOUBLE__ 8
#define __SIZEOF_FLOAT__ 4
#define __SIZEOF_INT128__ 16
#define __SIZEOF_INT__ 4
#define __SIZEOF_LONG__ 8
#define __SIZEOF_LONG_DOUBLE__ 16
#define __SIZEOF_LONG_LONG__ 8
#define __SIZEOF_POINTER__ 8
#define __SIZEOF_PTRDIFF_T__ 8
#define __SIZEOF_SHORT__ 2
#define __SIZEOF_SIZE_T__ 8
#define __SIZEOF_WCHAR_T__ 4
#define __SIZEOF_WINT_T__ 4
#define __SIZE_TYPE__ long unsigned int
#define __SSE__ 1
#define __SSE2__ 1
#define __SSE2_MATH__ 1
#define __SSE_MATH__ 1
#define __STDC__ 1
#define __STDC_HOSTED__ 1
#define __UINT16_C(c) c
#define __UINT16_MAX__ 65535
#define __UINT16_TYPE__ short unsigned int
#define __UINT32_C(c) c ## U
#define __UINT32_MAX__ 4294967295U
#define __UINT32_TYPE__ unsigned int
#define __UINT64_C(c) c ## UL
#define __UINT64_MAX__ 18446744073709551615UL
#define __UINT64_TYPE__ long unsigned int
#define __UINT8_C(c) c
#define __UINT8_MAX__ 255
#define __UINT8_TYPE__ unsigned char
#define __UINT_FAST16_MAX__ 18446744073709551615UL
#define __UINT_FAST16_TYPE__ long unsigned int
#define __UINT_FAST32_MAX__ 18446744073709551615UL
#define __UINT_FAST32_TYPE__ long unsigned int
#define __UINT_FAST64_MAX__ 18446744073709551615UL
#define __UINT_FAST64_TYPE__ long unsigned int
#define __UINT_FAST8_MAX__ 255
#define __UINT_FAST8_TYPE__ unsigned char
#define __UINT_LEAST16_MAX__ 65535
#define __UINT_LEAST16_TYPE__ short unsigned int
#define __UINT_LEAST32_MAX__ 4294967295U
#define __UINT_LEAST32_TYPE__ unsigned int
#define __UINT_LEAST64_MAX__ 18446744073709551615UL
#define __UINT_LEAST64_TYPE__ long unsigned int
#define __UINT_LEAST8_MAX__ 255
#define __UINT_LEAST8_TYPE__ unsigned char
#define __UINTMAX_C(c) c ## UL
#define __UINTMAX_MAX__ 18446744073709551615UL
#define __UINTMAX_TYPE__ long unsigned int
#define __UINTPTR_MAX__ 18446744073709551615UL
#define __UINTPTR_TYPE__ long unsigned int
#define __unix 1
#define __unix__ 1
#define unix 1
#define __USER_LABEL_PREFIX__
#define __VERSION__ "4.6.3 20120306 (Red Hat 4.6.3-2)"
#define __WCHAR_MAX__ 2147483647
#define __WCHAR_MIN__ (-__WCHAR_MAX__ - 1)
#define __WCHAR_TYPE__ int
#define __WINT_MAX__ 4294967295U
#define __WINT_MIN__ 0U
#define __WINT_TYPE__ unsigned int
#define __x86_64 1
#define __x86_64__ 1

Friday, May 28, 2010

Interesting Astrophysics: 17 May to 28 May

The final batch of interesting preprints (and a few accepted papers) for May 2010.


Galaxies and Starbursts

Witnessing the Formation of a Brightest Cluster Galaxy in a Nearby X-ray Cluster
Jesper Rasmussen, John S. Mulchaey, Lei Bai, Trevor J. Ponman, Somak Raychaudhury, Ali Dariush, arXiv:1005.3538 [pdf, ps, other]
Comments: 16 pages, 12 figures. ApJ accepted

UV+IR Star Formation Rates: Hickson Compact Groups with Swift and Spitzer
P. Tzanavaris, A. E. Hornschemeier, S. C. Gallagher, K. E. Johnson, C. Gronwall, S. Immler, A. E. Reines, E. Hoversten, J. C. Charlton, arXiv:1005.4059 [pdf, ps, other]
Comments: Accepted by ApJ. [8 Tables, 16 Figures. Color figures have reduced size for ArXiv - emulateapj v. 2/16/10]
Journal-ref: Astrophysical Journal 716 (2010) 556-573

From their abstract: "We present Swift UVOT (1600-3000A) 3-band photometry for 41 galaxies in 11 nearby (<4500km/s) Hickson Compact Groups (HCGs) of galaxies. We use the uvw2-band (2000A) to estimate the dust-unobscured component, SFR_UV, of the total star-formation rate, SFR_T. We use Spitzer MIPS 24-micron photometry to estimate SFR_IR, the dust-obscured component of SFR_T. We obtain SFR_T=SFR_UV+SFR_IR. Using 2MASS K_s band based stellar mass, M*, estimates, we calculate specific SFRs, SSFR=SFR_T/M*. SSFR values show a clear and significant bimodality, with a gap between low (<~3.2x10^-11 / yr) and high SSFR (>~1.2x10^-10 / yr) systems. All galaxies with MIR activity index a_IRAC <= 0 (>0) are in the high- (low-) SSFR locus, as expected if high levels of star-formation power MIR emission from polycyclic aromatic hydrocarbon molecules and a hot dust continuum. All elliptical/S0 galaxies are in the low-SSFR locus, while 22 out of 24 spirals/irregulars are in the high-SSFR locus, with two borderline cases. ... Unlike HCG galaxies, galaxies in a comparison quiescent SINGS sub-sample are continuously distributed both in SSFR and a_IRAC. Any uncertainties can only further enhance the SSFR bimodality. These results suggest that an environment characterized by high galaxy number-densities and low galaxy velocity-dispersions, such as the one found in compact groups, plays a key role in accelerating galaxy evolution by enhancing star-formation processes in galaxies and favoring a fast transition to quiescence."

Radiation pressure from massive star clusters as a launching mechanism for super-galactic winds
Norman Murray, Brice Ménard, Todd A. Thompson, arXiv:1005.4419 [pdf, ps, other]
Comments: Submitted to ApJ, comments welcome
Subjects: Cosmology and Extragalactic Astrophysics (astro-ph.CO); Galaxy Astrophysics (astro-ph.GA)

Their abstact: "Galactic outflows of low ionization, cool gas are ubiquitous in local starburst galaxies, and in the majority of galaxies at high redshift. How these cool outflows arise is still in question. Hot gas from supernovae has long been suspected as the primary driver, but this mechanism suffers from its tendency to destroy the cool gas as the latter is accelerated. We propose a modification of the supernova scenario that overcomes this difficulty.
Star formation is observed to take place in clusters; in a given galaxy, the bulk of the star formation is found in the ~20 most massive clusters. We show that, for L* galaxies, the radiation pressure from clusters with M>10^6 M_sun is able to expel the surrounding gas at velocities in excess of the circular velocity of the disk galaxy. This cool gas can travel above the galactic disk in less than 2 Myr, well before any supernovae erupt in the driving cluster. Once above the disk, the cool outflowing gas is exposed to radiation, and supernovae induced hot gas outflows, from other clusters in the disk, which drive it to distances of several tens to hundreds of kpc. Because the radiatively driven clouds grow in size as they travel, and because the hot gas is more dilute at large distance, the clouds are less subject to destruction if they do eventually encounter hot gas. Therefore, unlike wind driven clouds, radiatively driven clouds can survive to distances ~50 kpc. We identify these cluster-driven winds with large-scale galactic outflows. Another implication of our model is that only starburst galaxies, where massive clusters reside, are able to drive winds cold outflows on galactic scales via this mechanism. We find that the critical star formation rates above which large scale cool outflows will be launched to be ~0.1 M_sun/yr/kpc^2, which is in good agreement with observations."


I can see a quite a few problems with this line of argumentation. Hopefully I'll get around to addressing them in the monster paper I'm still adding to. Why write three papers when you can just write one absurdly large one?


Black Holes and AGN

"Comets" orbiting a black hole
R. Maiolino, G. Risaliti, M. Salvati, P. Pietrini, G. Torricelli-Ciamponi, M. Elvis, G. Fabbiano, V. Braito, J. Reeves, arXiv:1005.3365 [pdf, ps, other]
Comments: Accepted for publication in A&A. 11 pages, 9 figures

Their abstract: "We use a long (300 ksec), continuous Suzaku X-ray observation of the active nucleus in NGC1365 to investigate the structure of the circumnuclear BLR clouds through their occultation of the X-ray source. The variations of the absorbing column density and of the covering factor indicate that the clouds surrounding the black hole are far from having a spherical geometry (as sometimes assumed), instead they have a strongly elongated and cometary shape, with a dense head (n=10^11 cm^-3) and an expanding, dissolving tail. We infer that the cometary tails must be longer than a few times 10^13 cm and their opening angle must be smaller than a few degrees. We suggest that the cometary shape may be a common feature of BLR clouds in general, but which has been difficult to recognize observationally so far. The cometary shape may originate from shocks and hydrodynamical instabilities generated by the supersonic motion of the BLR clouds into the intracloud medium. As a consequence of the mass loss into their tail, we infer that the BLR clouds probably have a lifetime of only a few months, implying that they must be continuously replenished. We also find a large, puzzling discrepancy (two orders of magnitude) between the mass of the BLR inferred from the properties of the absorbing clouds and the mass of the BLR inferred from photoionization models; we discuss the possible solutions to this discrepancy."

Adaptive optics near infrared integral field spectroscopy of NGC 2992
S. Friedrich, R. I. Davies, E. K. S. Hicks, H. Engel, F. Müller-Sánchez, R. Genzel, L. J. Tacconi, arXiv:1005.4791 [pdf, ps, other]
Comments: 10 pages, 8 figures, accepted for publication in A&amp;A

From their abstract: "NGC 2992 is an intermediate Seyfert 1 galaxy showing outflows on kilo parsec scales which might be due either to AGN or starburst activity. We therefore aim at investigating its central region for a putative starburst in the past and its connection to the AGN and the outflows. Observations were performed with the adaptive optics near infrared integral field spectrograph SINFONI on the VLT, complemented by longslit observations with ISAAC on the VLT, as well as N- and Q-band data from the Spitzer archive. The spatial and spectral resolutions of the SINFONI data are 50 pc and 83 km/s, respectively. ... A simple geometric model of two mutually inclined disks and an additional cone to describe an outflow was developed to explain the observed complex velocity field in H_2 1-0S(1). ... We find a starburst age of 40 Myr - 50 Myr from Br_gamma line diagnostics and the radio continuum; ongoing star formation can be excluded. Both the energetics and the timescales indicate that the outflows are driven by the AGN rather than the starburst. The complex velocity field observed in H_2 1-0S(1) in the central 450 pc can be explained by the superposition of the galaxy rotation and an outflow."


So, the questions remains - is there really an outflow on larger scales too?. The lack of clear cases of purely AGN-driven large scale winds really makes me doubt radiation-driven wind models.


Fading hard X-ray emission from the Galactic Centre molecular cloud Sgr B2
R. Terrier, G. Ponti, G. Belanger, A. Decourchelle, V. Tatischeff, A. Goldwurm, G. Trap, M. R. Morris, R. Warwick, arXiv:1005.4807 [pdf, ps, other]
Comments: Accepted for publication in ApJ. 10 pages, 5 figures

From their abstract: "The centre of our Galaxy harbours a 4 million solar mass black hole that is unusually quiet: its present X-ray luminosity is more than 10 orders of magnitude less than its Eddington luminosity. The observation of iron fluorescence and hard X-ray emission from some of the massive molecular clouds surrounding the Galactic Centre has been interpreted as an echo of a past flare. ... Here we report the observation of a clear decay of the hard X-ray emission from the molecular cloud Sgr B2 during the past 7 years thanks to more than 20 Ms of INTEGRAL exposure. The measured decay time is compatible with the light crossing time of the molecular cloud core . Such a short timescale rules out inverse bremsstrahlung by cosmic-ray ions as the origin of the X ray emission. We also obtained 2-100 keV broadband X-ray spectra by combining INTEGRAL and XMM-Newton data and compared them with detailed models of X-ray emission due to irradiation of molecular gas by (i) low-energy cosmic-ray electrons and (ii) hard X-rays. Both models can reproduce the data equally well, but the time variability constraints and the huge cosmic ray electron luminosity required to explain the observed hard X-ray emission strongly favor the scenario in which the diffuse emission of Sgr B2 is scattered and reprocessed radiation emitted in the past by Sgr A*. Using recent parallax measurements that place Sgr B2 in front of Sgr A*, we find that the period of intense activity of Sgr A* ended between 75 and 155 years ago."


Black Hole Mass, Host galaxy classification and AGN activity
Barry McKernan, K.E.Saavik Ford, Chris Reynolds, arXiv:1005.4907 [pdf, ps, other]
Comments: MNRAS accepted. 14 pages, 11 figures, complete Table 1 in online journal


Theoretical Cosmology

The intergalactic medium over the last 10 billion years I: Lyman alpha absorption and physical conditions
Romeel Davé, Benjamin D. Oppenheimer, Neal Katz, Juna A. Kollmeier, David H. Weinberg, arXiv:1005.2421 [pdf, ps, other]
Comments: 21 pages, submitted to MNRAS

Intergalactic Dust Extinction in Hydrodynamic Cosmological Simulations
Ying Zu, David H. Weinberg, Romeel Davé, Mark Fardal, Neal Katz, Dusan Keres, Benjamin D. Oppenheimer, arXiv:1005.4406 [pdf, ps, other]
Comments: 12 pages, 7 figures, to be submitted to MNRAS


Astrophysical Processes

Secondary ionization and heating by fast electrons
Steven R. Furlanetto and Samuel Johnson Stoever, 2010, MNRAS, 404, 1869
Full Text: HTML, PDF (Size: 720K)


Numerical Astrophysics and Computational Techniques

Searchable Sky Coverage of Astronomical Observations: Footprints and Exposures
Tamas Budavari, Alex Szalay, Gyorgy Fekete, arXiv:1005.2606 [pdf, other]
Comments: 11 pages, 7 figures, submitted to PASP

Their abstract: "Sky coverage is one of the most important pieces of information about astronomical observations. We discuss possible representations, and present algorithms to create and manipulate shapes consisting of generalized spherical polygons with arbitrary complexity and size on the celestial sphere. This shape specification integrates well with our Hierarchical Triangular Mesh indexing toolbox, whose performance and capabilities are enhanced by the advanced features presented here. Our portable implementation of the relevant spherical geometry routines comes with wrapper functions for database queries, which are currently being used within several scientific catalog archives including the Sloan Digital Sky Survey, the Galaxy Evolution Explorer and the Hubble Legacy Archive projects as well as the Footprint Service of the Virtual Observatory."

The Role of Provenance Management in Accelerating the Rate of Astronomical Research

G. Bruce Berriman, Ewa Deelman, arXiv:1005.3358 [pdf, other]
Comments: 8 pages, 1 figure; Proceedings of Science, 2010

Their abstract: "The availability of vast quantities of data through electronic archives has transformed astronomical research. It has also enabled the creation of new products, models and simulations, often from distributed input data and models, that are themselves made electronically available. These products will only provide maximal long-term value to astronomers when accompanied by records of their provenance; that is, records of the data and processes used in the creation of such products. We use the creation of image mosaics with the Montage grid-enabled mosaic engine to emphasize the necessity of provenance management and to understand the science requirements that higher-level products impose on provenance management technologies. We describe experiments with one technology, the "Provenance Aware Service Oriented Architecture" (PASOA), that stores provenance information at each step in the computation of a mosaic. The results inform the technical specifications of provenance management systems, including the need for extensible systems built on common standards. Finally, we describe examples of provenance management technology emerging from the fields of geophysics and oceanography that have applicability to astronomy applications."


Montage: a grid portal and software toolkit for science-grade astronomical image mosaicking
Joseph C. Jacob, et al, arXiv:1005.4454 [pdf, other]
Comments: 16 pages, 11 figures
Journal-ref: Int. J. Computational Science and Engineering. 2009

Their abstract: "Montage is a portable software toolkit for constructing custom, science-grade mosaics by composing multiple astronomical images. The mosaics constructed by Montage preserve the astrometry (position) and photometry (intensity) of the sources in the input images. The mosaic to be constructed is specified by the user in terms of a set of parameters, including dataset and wavelength to be used, location and size on the sky, coordinate system and projection, and spatial sampling rate. Many astronomical datasets are massive, and are stored in distributed archives that are, in most cases, remote with respect to the available computational resources. Montage can be run on both single- and multi-processor computers, including clusters and grids. Standard grid tools are used to run Montage in the case where the data or computers used to construct a mosaic are located remotely on the Internet. This paper describes the architecture, algorithms, and usage of Montage as both a software toolkit and as a grid portal. Timing results are provided to show how Montage performance scales with number of processors on a cluster computer. In addition, we compare the performance of two methods of running Montage in parallel on a grid."


Stars, Supernovae and Planets

Who Pulled the Trigger: a Supernova or an AGB Star?
Alan P. Boss, Sandra A. Keiser, arXiv:1005.3981 [pdf, ps, other]
Comments: 14 pages, 4 figures, 1 table, Astrophysical Journal Letters, in press

Their abstract: "The short-lived radioisotope $^{60}$Fe requires production in a core collapse supernova or AGB star immediately before its incorporation into the earliest solar system solids. Shock waves from a somewhat distant supernova, or a relatively nearby AGB star, have the right speeds to simultaneously trigger the collapse of a dense molecular cloud core and to inject shock wave material into the resulting protostar. A new set of FLASH2.5 adaptive mesh refinement hydrodynamical models shows that the injection efficiency depends sensitively on the assumed shock thickness and density. Supernova shock waves appear to be thin enough to inject the amount of shock wave material necessary to match the short-lived radioisotope abundances measured for primitive meteorites. Planetary nebula shock waves from AGB stars, however, appear to be too thick to achieve the required injection efficiencies. These models imply that a supernova pulled the trigger that led to the formation of our solar system. "


Herschel Observations of the W43 "mini-starburst"
J. Bally, et al, arXiv:1005.4092 [pdf, ps, other]
Comments: 5 pages, 3 figures, accepted for A&amp;A Special Issue

From their abstract: "Aims: To explore the infrared and radio properties of one of the closest Galactic starburst regions. Methods: Images obtained with the Herschel Space Observatory at wavelengths of 70, 160, 250, 350, and 500 microns using the PACS and SPIRE arrays are analyzed and compared with radio continuum VLA data and 8 micron images from the Spitzer Space Telescope. ... Results: The W43 star-forming complex is resolved into a dense cluster of protostars, infrared dark clouds, and ridges of warm dust heated by massive stars. The 4 brightest compact sources with L > 1.5 x 10^4 Lsun embedded within the Z-shaped ridge of bright dust emission in W43 remain single at 4" (0.1 pc) resolution. These objects, likely to be massive protostars or compact clusters in early stages of evolution are embedded in clumps with masses of 10^3 to 10^4 Msun, but contribute only 2% to the 3.6 x 10^6 Lsun far-IR luminosity of W43 measured in a 16 by 16 pc box. The total mass of gas derived from the far-IR dust emission inside this region is ~10^6 Msun. Cometary dust clouds, compact 6 cm radio sources, and warm dust mark the locations of older populations of massive stars. Energy release has created a cavity blowing-out below the Galactic plane."

I wish people would stop calling individual star forming regions, even the biggest ones, starbursts. The term starburst has historically been used to denote significantly enhanced star formation at a galactic scale, and makes most sense when used thusly. See, e.g. Heckman, T., 2005, A&SS, 329, 3.

Evolution of massive stars with pulsation-driven superwinds during the RSG phase
Sung-Chul Yoon, Matteo Cantiello, arXiv:1005.4925 [pdf, ps, other]
Comments: Accepted for publications in ApJ Letters

Interesting to note the significance of pulsation in driving these winds. They're not just steady dust-driven winds. Are there any cases of steady dust-driven winds?

Wednesday, February 17, 2010

Tuesday, February 17, 2009

How to force arXiv.org to run pdflatex

Here is a useful trick worth remembering. If you want to force arXiv.org to run pdflatex and not old latex on your tex file you need to stick \pdfoutput=1 in the first 5 lines of your tex file (see here). Latex, being nothing but a front for pdflatex anyway, will then effectively run pdflatex and directly create a pdf.

Note that this means that can't create a dvi or ps file by running latex anymore with that tex file even if you are using the ifpdf package and running latex from the command line.

Wednesday, June 25, 2008

Mathematical computing using graphics cards: CUDA

Fedy Abi-Chahla has an interesting (if lengthy) article at Tom's Hardware on using Nvidia's CUDA library to do high performance mathematical on a GPU instead of the CPU. I've mentioned this concept before, but Abi-Chahla's article goes a lot deeper into the nitty gritty of the mechanics of it all and demonstrates an actual example.

Friday, July 27, 2007

More on using GPUs to calculate physics

Just to follow up on Monday's post on using PC graphics cards to perform scientific calculations, Ryan Smith at Anandtech has an article on the status of GPU physics and dedicated physics processors for games. Note that "physics" in terms of games is rather limited in scope, largely particle effects and finite element calculations (e.g. the rag-doll motion of dead enemies) to make a game look good.

What comes out of this article is that (unlike the case of the astrophysical N-body calculations discussed previously) it appears that in terms of gaming the initial attempts for PC games to use physics processors (e.g. the AGEIA PCI card) or GPUs as physics processors (e.g. Havok's separate software package called Havok FX) have difficultly accessing the results of any calculations other than changing the display:


The second reason, and that which has the greater effect, is a slew of technical details that stem from using Havok FX. Paramount to this is what the GPU camp is calling physics is not what the rest of us would call physics with a straight face. As Havok FX was designed, the physics simulations run on the GPU are not retrievable in a practical manner, as such Havok FX is designed to be used to generate "second-order" physics. Such physics are not related to gameplay and are inserted as eye-candy. A good example of this is Ghost Recon: Advanced Warfighter, which we'll ignore was a PhysX powered title for the moment and focus on the fact that it used the PhysX hardware primarily for extra debris.

The problem with this of course is obvious, and Havok goes through a great deal of trouble in their Havok FX literature to make this clear. The extra eye-candy is nice and it's certainly an interesting solution to bypassing the problem of lots-of-little-things loading down the CPU (although Direct3D 10 has reduced the performance hit of this), but it also means that the GPU can't have any meaningful impact on gameplay. It doesn't make Havok FX entirely useless since eye-candy does serve its purpose, but it's not what most people (ourselves included) envision when we think hardware accelerated physics; we're looking for the next step in interactive physics, not more eye-candy.
Emphasis added.

Note that the CUDA software used to do the N-body simulations described by Schiveet al (astro-ph/0707.2991) package described in the is very different from the gaming-related Havok FXAnandtech article.

If you've ever worked with parallel processing yourself you'll appreciate that efficiently accessing the results of a calculation on a separate processor is the trickiest part of parallel programming, rather than actually having a calculation run on a separate processor. Even if GPU physics processing does take off (and doesn't get forgotten as the access to multi-core CPUs increases), I doubt Havok FX will see much real use before approaches closer to CUDA in nature take over.

Just for interest's sake, let us return to the issue of what kind of "physics" is dealt with in games. Here I quote from Havok's own discussion of Havok FX:

What Kinds Of Effects Does Havok FX Enable?

Havok FX enables dynamic in-game effects that are based upon rigid-body collisions and constraints – including debris, smoke, fog, and ultimately simulated liquids - but on a scale that goes well beyond the magnitude and volume of objects normally simulated in CPU-based game-play physics. By performing simulation, collision detection and rendering directly on the GPU, Havok FX avoids the transfer of large amounts of data between the CPU and GPU, enabling a level of performance of object collisions in the 1000’s occurring in real-time, without putting any additional burden on the CPU or otherwise slowing down the game.

How DoesHavok FX Work?

Havok FX supports a new type of rigid-body object called a Debris Primitive. A Debris Primitive is a compact representation of a 3D collidable object that can be processed via Shader Model 3.0 (SM3.0) in a very efficient manner. Debris Primitives can be pre-modeled as part of a game's static art content (e.g. custom/textured boulders, space junk, or collateral objects waiting for an explosive charge). They may also be generated on the fly during game play by the CPU, based on the direction and intensity of a force (e.g. brick and stone structure blown apart by a cannon blast). Once generated by the CPU, Debris Primitives can be dispatched fully to the GPU for physical simulation and final rendering - comprising a powerful blending of physics and state-of-the-art shading effects for particulate and large scale phenomenon.

Monday, July 23, 2007

Using graphics cards to do science

I'm stuck working from home for a second day thanks to a sudden-onset summer cold, but while I back-up all my data here is an interesting article from today's astro-ph: astro-ph/0707.2991.

Schive et al, at the National Taiwan University in Taipei, describe using the highly-parallel processors on modern GPUs (specifically a cluster of machines with dual nVidia GeForce 8800 GTX graphics cards) to perform astrophysical N-body simulations. A special library and software development kit called CUDA, developed by nVidia, allows the programmers to perform computation on the GPU and access the results instead of creating graphical output to a monitor.

Compared to the dedicated GRAPE processors that are designed to specifically address this kind of problem in hardware their PC+GPU cluster performs extremely well (both in performance per unit price, and in net teraflops).

This is very exciting, as the increasing capabilities of commodity PC hardware bode well for the future of scientific computing. Back in the mid-1990's when I started my PhD the department hard a few, very expensive, Sun Sparc and DEC Alpha workstation that were used by everyone through thin client terminals. By the time I finished my PhD commodity Pentium and Athlon PCs running linux offered equivalent or better performance per unit price, and people started having individual machines to themselves* (although the fastest CPUs in absolute terms were still the ultra-expensive Compaq [formerly DEC] Alpha's). Beowulf clusters appeared at the same time, and now clusters based on essentially PC hardware dominated the chart of the top 100 supercomputers.

Much of the growth in PC CPU power over the last decade has been driven by multiple factors: PC gaming, the growth of the Internet, the AMD vs. Intel competition, and also ironically the need for fast CPUs to counteract the growing bloat and slothfulness of Microsoft's Windows 98/XP/Vista series.

Now the increasing graphical demands of PC gaming, and the nVidia vs ATI (now part of AMD) market share competition may drive the rate of improvement in scientific computing for the next decade.

* Although the move to semi-individual machines rather than multi-user use was also driven at the by the poor network performance of NFS cross-mounted IDE disks compared to NFS mounted SCSI drives on the traditional workstations.

Tuesday, May 22, 2007

The HORROR, part II (or how to upgrade your windows hard-drive)

Last month I complained about the difficulty of upgrading a PC's primary hard-drive (i.e the one holding your primary Windows XP and/or Linux system partitions) without having to reinstall Windows and all its software by hand (and without buying commercial Windows-centric software) to the new drive.

Well, I eventually worked out how to do it with rdiff-backup after several weekends (and many weekday evenings) of experimentation and much frustration.

As I haven't seen all the necessary steps laid out together anywhere on the web, I've put together a page on my website entitled "Using rdiff-backup to restore Windows XP and Linux to a new disk." So that is the place to go if you need to know how.

Sunday, April 29, 2007

The HORROR, part I (or how not to upgrade your windows hard drive)

Every year or so I forget just how awful Microsoft's Windows XP operating system can be if it starts going wrong. Its fine when it works, but diagnosing any problem turns into hours of web searching and installing round after round of obscure utilities, with almost none of them actually created by the damn company that actually created the operating system. By comparison Linux administration and system repair is trivially easy. But sooner or later something happens and I end up spending multiple nights and/or weekends slaving away with only a growing sick feeling of frustration to keep me company.

You might think that replacing your primary drive with a new one containing the original data would be easy - in fact it is trivial with Linux alone, but if you're dealing with windows as well, its not. I'll discuss how to do this (The Horror, part II) when I've solved the basic problem I have which is that the new drive doesn't have what Windows thinks is a valid Master Boot Record despite it working fine for Linux (I suspect the real problem is that the FAT32 partitions were created by Linux, and although they're technically true FAT32, Windows is deliberately refusing to acknowledge them as it can see an XP installer didn't make them).

But in the mean time a piece of MS crapware totally mangled the partition table for my third disk drive that contained non-backed-up a FAT32 partition (with a variety of important documents and my music collections), my Linux /home partition and my local /data1 drive. So now I had an even bigger problem than my original upgrade problem.

How could this happen? Well, for reasons that will become apparent in The Horror part II, I ended up trying to use a Windows 98 boot floppy to repartition the new drive and create the FAT32 partitions I planned to reinstall Windows to (the XP Recovery disk I'm using would only allow me to create NTFS partitions for some annoying reason). Both the XP CD and the W98 floppy were listing my drives in an odd, non-BIOS, order and with odd letters (e.g. the first drive they claimed to be D:), but as the drives are all different sizes I tried to select the correct drive to repartition using MS's FDISK based on its size. However, all of them were reported with incorrect sizes, presumably because Windows 98 simply can't conceive of a drive larger than ~130 GB or so.

I thought I had selected the new drive to repartition and proceeded with FDISK, but eventually gave up without writing the partition table because FDISK kept reducing its estimation of the drive size any time I did anything with it. Today I discovered that in fact it had written some garbage FAT16 partition onto a totally different drive, erasing two Linux partitions and my largest FAT32 partition. None of them backed-up, by some monumental oversight of mine.

Windows now saw the drive as needing formatting, and I had to use a rescue CD just to get into FC6.

Frantic searching on the web found DiskInternals free Windows program called DiskInternals Linux Recovery. This found some of the directories on one of the Linux partitions (the /home partition, which happened to be /dev/hdc1 before the partition wipe), but not my /data partition. Nor did it find the important files on the missing FAT32 partition. The software claimed to be able to repair damaged or corrupted partition tables, but in fact did not seem to have this facility. Instead, DiskInternals has another utility (free demo, $140 for full version) called DiskInternals Partition Recovery. The free demo found the FAT32 partition, and could even very slowly get a few files off it, but this still was not a solution.

Eventually I found another Windows program called Partition Table Doctor 3.5 (free demo, $40 full version). This time the free demo found the ext3 and fat32 partitions quickly as well as determining whether they were primary or extended (the fat32 partition was a logical partition in an extended partition, for example), and I could even verify the names of the base directories in the fat partition. The trial demo won't write the partition though. I tried using the cylinder/head etc data given by the trial version with fdisk under Linux to rewrite the partition table, but this resulted in un-mountable (i.e bad) partitions.

Feeling tired and defeated I bought the bullet and purchased the full version of Partition Doctor online, which I then downloaded and ran. Despite my messing with the partition table in Linux it still found the original partitioning scheme and after hitting save I rebooted into FC6 to find it had actually worked. The FAT32 drive turned up fine in Windows too.

So I'm back to were I was a few days ago, still unable to boot Windows off the new drive, still running Windows from the aged and soon-to-fail drive, and $40 poorer, all thanks to Microsoft.

If there were a decent selection of games for OS X (and if Apple's desktop hardware wasn't so horribly over-priced), I'd switch to OS X for my home system in an instant.

Wednesday, March 21, 2007

Backus, the man behind Fortran, passes away at 82.

John Backus (informative biography here), winner of a Turing Award for his many contributions to computer science, passed away yesterday (20 March 2007) at the age of 82.

Backus's career included many notable firsts, including leading the group that developed the computer language Fortran in 1957. Fortran is considered to be the first high-level language. Fortran, or more specifically, its later (much improved) revisions Fortran 77, Fortran 90, and Fortran 95, for example, is still very commonly used in professional physics and astronomy. Although C or C++ is being more and more these days it seems unlikely that Fortran will disappear in the next decade or two.

Like all computer languages it has its strengths and weaknesses. Standard f77 lacks objects, derived types, dynamic memory allocation, pointers and so on, which makes certain tasks more difficult to perform, but also this also simplifies the code (very useful if you're reading some else's code, as using, maintaining or extending legacy code is very common in physics) and immunizes Fortran from a large variety of the nasty, pernicious and hard-to-find bugs that can invest C (for example).

Using the most common extensions to the language (such as not using upper case, using "end do" instead of to horrible labeled "continue" statements, "!" for same-line comments), and some experience, you can certainly write clean, elegant, and efficient (i.e. fast) code. Badly-written Fortran is of course, a nightmare to behold, but no worse than badly written C.

As an undergraduate we were taught Fortran 77, and although I now prefer to code in C++ or even python now, I still retain and use large amounts of Fortran code. For certain tasks it is still easier to write, test and use Fortran than C or C++.

Saturday, January 13, 2007

Replacing IDL

I try to avoid using and proprietary and/or commercial software for scientific research, for a variety of reasons, but given the number of different self-administered computers I use the financial issue is not insignificant. If there is a free alternative then it seems bad to needlessly waste grant (and ultimately tax-payer) money on commercial software.


Unfortunately I've just been forced to start using IDL in preparing for one of the Cycle 16 HST proposals I'm in the middle of working on - there isn't time for me to rewrite the IDL procedures I'm using in some other language before the proposal deadline (in the course of this I discovered i2py, an IDL to Python converter, but I haven't tried it yet).

And IDL is one of the commercial packages I dislike the most that is also most often used by other astronomers... in my humble opinion its too expensive, too slow compared to compiled languages like C++, too much of a memory hog and worse still, too inelegant an language compared to modern interpreted languages like Python and Ruby. Yeah, they've tried to update it by adding OO features to old-fashioned procedural IDL, but still this is only cool to people who have a large existing investment in using (and access to) IDL. Do you really want to pay (lots of) money to get it?

Some people (most of them die-hard long-time IDL users) would argue with this characterization of IDL, but for me its remaining Fortran-based heritage is too 1970's to bear (I like Fortran... for some things it is great, but why would I want to use an interpreted language with Fortran-like syntax and structuring?).

Still, I've spent the last few days messing about with IDL on a departmental Sun workstation that is so old and out of date it still uses Netscape as a browser, processing files on a modern Linux PC at least ten times faster than the ancient Sun Ultra 20 workstation and then scp'iong files over and waiting the hours it takes for the slow Sun machine to run IDL before it runs into some memory limitation or whatever it decides to inflict on me... painful. Very painful. And the sodding bog-standard-and-absolutely-vital readfits routine doesn't work on v6.1 of IDL so I have to use 5.6 instead. Great.

However this evening I remembered that there was a GNU project to re-implement IDL from scratch, which is unsurprisingly called GDL. But does it work? Well, the good news is all I needed to do was run "yum -y install gdl" on FC6 to install GDL, install a few IDL libraries the GDL page provided links to, and the IDL code I have to use rather magically works.

Its not enough to get me to like IDL, nor will it stop rewriting this stuff later in a modern language if the proposal is accepted, but at least I can now edit the IDL code, modify the input fits data files, and run the damn procedures all on the same modern machine, maybe in time to get this proposal written. Thanks GDL programmers!

Tuesday, December 26, 2006

Windows Vista "Content" protection and the cost for all computing

Modern astrophysics, if not most sciences, ultimately rely on modern advances in computing power and in the continued growth of cheap computing power (e.g. the Large Synoptic Survey Telescope will obtain [and have to process] 30 terabytes of data each and every night [30 TB = 30 000 Gigabytes]). Anything that interferes with current trends in computer speed, cost, reliability or accuracy thus threatens to interfere with the global pace of scientific research.

Unfortunately it appears that the requirements that Microsoft is now asking of software and hardware makers in order to "protect" "premium content" in their new Vista operating system will negatively impact the entire computer industry and all those using computers (and whether or nor you use any of Microsoft's products).

Peter Gutmann, a computer security analyst in New Zealand, provides a particularly clear description of the requirements Microsoft is placing on computer hardware manufacturers for Vista-compatibility and their implications.

The important thing to note is that this will affect you even if you use a different operating system on your PC or server. Yes, even if you only buy Apple Macs! Your hardware will be more expensive, and the software to run on you new hardware more prone to bugs. Worse still, there will be the genuine dangers to human health (e.g. this cartoon) and general safety. Ironically, these changes, while made in the name of "security" ignore genuine issues the public would think important (such as protecting your bank records) and focus ultimately on controlling the way you view the "entertainment" provided by the US movie and TV industry.

It is a long article, but worth reading in its entirety.