Reading FITS 1-D spectrum using IDL
There are many IDL routines available for reading FITS file, a standard for astronomical data, but I have never been happy with their use for pretty simple thing of displaying the spectrum of the object. fits_read gives you the header and flux, but never the wavelength scale. readfits can also be useful, but it does so many other things, that I decided to write reading routine on my own.
Of course, I had to make use of fits_read to get the header and flux information from the FITS file. What is actually missing is the wavelength scale. So I create a wavelength array by taking header information from the FITS file. Header saves the value of the starting wavelength as CRVAL1 and the size of the increment as CDELT1. Now creating the wavelength array is not that difficult. My IDL routine is called myreadfits.pro and the source code is given below.
pro myreadfits, file, wavel, flux
fits_read, file, flux, headercrpos=where(strmid(header,0,6) eq "CRVAL1")
cr=strmid(header[crpos[0]],9,60)+0.
cdeltpos=where(strmid(header,0,6) eq "CDELT1")
cdelt=strmid(header[cdeltpos[0]],9,60)+0.
wavel=findgen(n_elements(flux))*cdelt+cr
end
Friday, March 13, 2009 | 0 Comments
Make iPhone WebApp for Desktop
There are many web services customized for iPhone experience. Sometimes they excel those for normal web browsers. They also come handy, when you are not interested in giving whole desktop just for one web service, like e.g. SocialThing! or Google Tasks. And the Safari iPhone experience is also quite sleek and very minimalistic. There is a workaround for it, where you can make these WebApps as Desktop Apps.
The solution is creating a WebApp using Fluid. Just create a normal web app as instructed. After creating it, launch it! Now what you have to do is to change the User Agent setting, so that it is recognized as Mobile Safari not as a desktop Safari. Under the application menu you can find User Agent. Now select Other... There you put the following string:
Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_2_1 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5H11 Safari/525.20
Now restart the just created application and you have iPhone optimized WebApp on Desktop. This workaround was made for Gmail Tasks, which seems to be working with other apps.
Friday, March 13, 2009 | 0 Comments
IDL resources unfurled
IDL, Interactive Data Language, is quite a popular scientific computing application provided by ITT Visual Information System. It's usefulness can be seen with data analysis, scientific visualization and, best of all, its cross-platform development support. There are many introductions to IDL available online. In this blog, I shall be concentrating more on its usefulness towards some applications in the Astronomy and Astrophysics.
Friday, March 13, 2009 | 0 Comments

![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=7b433361-e594-409c-b215-f2c0b69babb9)
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=e0dfd1e9-ada4-4e31-a00c-8527e6b5710f)

