![idl strmid idl strmid](https://patentimages.storage.googleapis.com/88/1d/a9/b13ee90b72ce62/US20020123947A1-20020905-P00020.png)
Jim Pendleton used this fact to write a program to parse the output of IDL> help, /dlm Most of the external libraries included in IDL are dynamically linked we call them DLMs (and everything I know about them I learned from Ronn Kling’s book). Ray Sterner (JHU/APL) suggested it would be nice if there was a way to quickly get library information without searching through the docs. What’s the version number of the GRIB library in the current IDL release? I should probably know this off the top of my head, but I don’t. I’ll return shortly to the sunspot number data from last week’s post.)
IDL STRMID CODE
My IDL routine is called myreadfits.pro and the source code is given below.Ĭrpos=where(strmid(header,0,6) eq "CRVAL1")Ĭdeltpos=where(strmid(header,0,6) eq "CDELT1")Ĭdelt=strmid(header],9,60)+0.(I’ve been out for a week, so today’s post is short. Now creating the wavelength array is not that difficult. Header saves the value of the starting wavelength as CRVAL1 and the size of the increment as CDELT1. So I create a wavelength array by taking header information from the FITS file. What is actually missing is the wavelength scale. Of course, I had to make use of fits_read to get the header and flux information from the FITS file. readfitscan also be useful, but it does so many other things, that I decided to write reading routine on my own. fits_read gives you the header and flux, but never the wavelength scale. 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.
![idl strmid idl strmid](https://i.ytimg.com/vi/a5iIed-zFb4/hqdefault.jpg)
But I was interested in explaining how I went about it. I guess it was way to long explanation for simple problem. So finally the following IDL code gives the required output: It is not meant for minus sign in the output. Because, as default, all outputs are right aligned, the – in format allows it to align to left. Instead of +, if you give – sign, then it has different meaning.
IDL STRMID PLUS
Beware, + sign in format doesn’t mean only for plus sign, but also minus.
![idl strmid idl strmid](https://images.slidesplayer.org/40/11083751/slides/slide_34.jpg)
It can be done by adding + to format like I+3.2. It looks like now: 19 50 46.99 08 52 05.95Īlmost perfect! We are just missing the plus (or minus) sign. I add 1x before defining format for floating number and replace I6.2 by I05.2 to include zero in the output. I didn’t find any easy solution to that, nonetheless, there’s a workaround. Unfortunately, the same trick doesn’t work for floating number, where decimal number in format are used to define decimal places. It says that out of three required space for integer, only two should be occupied, and if there is only one digit integer, then second space prepending to it shall be replaced by 0. You can replace I3 by I3.2, and voila, you have quasi-required output: 19 50 46.99 08 52 5.95
IDL STRMID HOW TO
And I want the plus sign for DEC1 part, too. So let’s look at how to add 0s first!įor integer formatting it is easy. I replace I3 with I03. So I need 0 rather than backspace before 8 and 5.95.
![idl strmid idl strmid](https://idldatapoint.files.wordpress.com/2012/03/earth3.png)
Quite bad, right? So having prepending backspace is good thing. But for printing purpose, in publication or in thesis, it is better if they were shown like this: 19 50 46.99 +08 52 05.95 Without this hassle for backspace, the output would have looked like: 195046.99 8525.95 And if the integer is of less than 3 digits, then non-existing integer part is replaced by backspace. I used this fact to make some space between two entries, like DEC1 and DEC2. It prints 3 digit integer, aligned to right. Which is perfectly fine for quick look-up. As you see, the format defines how the output should look like. When I want to print it with following command: Of course, I save last part of RA and DEC in floating number, whereas other variable are of integer. So I save these information in IDL in variable such as, RA1, RA2, RA3, DEC1, DEC2, DEC3. Only declination needs plus or minus sign, like latitude on Earth’s surface. For example, for Altair, one of the brightest star in the sky, it has RA of and DEC of. The coordinates of any objects in astronomy is given in right ascension and declination, sort of latitude and longitude for the sky.