Monday, October 10, 2011

IDL

Up until recently, pretty much all of my programming experience has been in IDL. I decided to finally buckle down and learn how to do things that I always use other people's routines for. In doing so, I realized how stupid IDL can be. I wound up fighting more against the language than against my own stupid programming skills.

Take, for instance, the TV and TVSCL commands. They take an image and plot them on the display. If you want to put them within a plot window, however, you cannot just use the same position vector that you used to make the plot axes because the bottom and left axes are drawn within the plot window. You have to reduce the size of the image by 1 pixel in each dimension and offset it up and to the right by one pixel.

Ok, so fine. I can do that... But then I want to save the image to PostScript. You would think that, everything having turned out well on the display, that it would look good saved to a file, right? Wrong. The image still covers the axes and I have yet to figure out how to fix it myself. So now I am using Coyote Graphics, which is pretty much the awesomest thing to happen to IDL, and the best resource anyone can ever get. The guy who runs the company, David Fanning, also has a Google group where he and others answer IDL questions.

But then I asked myself, What the h-e-double-hockey-sticks is a PostScript file anyway? Turns out it is an archaic printing language that helped computers output to printers. PDF is its modern replacement. I never really used PS to begin with. I just saved as .ps as an intermediate step before saving it as a .pdf, .jpg, .tiff. .png, etc. Now I know about the X buffer and TVRD. Things are going to change. Big time.

But that gets me back to my original rant. IDL should just work. I should not have to worry about scalable pixel sizes, make separate contingencies for the device I am using, which operating system I have, which decomposed state I am in, etc. IDL should know these things and just do what I want it to do.

After the aforementioned instance of recently, I started using Python. Nuff said.

No comments:

Post a Comment