<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
      <title>Coyote's Guide to IDL Programming</title>
       <language>en</language>
       <copyright>Copyright 1997-2009, David W. Fanning</copyright> 
       <managingEditor>david@dfanning.com (David Fanning)</managingEditor> 
       <lastBuildDate>Fri, 12 Mar 2010 17:11:34 GMT</lastBuildDate>
       <webMaster>david@dfanning.com (David Fanning)</webMaster> 
        <link>http://www.dfanning.com/index.html</link>
        <description>IDL Programming Tips and Examples</description>
        <image>
           <title>Coyote's Guide to IDL Programming</title>
           <url>http://www.dfanning.com/images/coyote_tips.jpg</url>
           <link>http://www.dfanning.com/index.html</link>
        </image>
        <atom:link href="http://www.dfanning.com/coyote.xml" rel="self" type="application/rss+xml" />

        <item>
           <title>New Catalyst Program: Modified_Map_Grid</title>
           <link>http://www.dfanning.com/programs/catalyst/source/utilities/modified_map_grid.pro</link>
           <description>
	   Map grid labels are not correctly clipped to the map plot boundaries when using either
           hardware or true-type fonts with Map_Grid. This program is a slightly modified version
           of Map_Grid that incorporates an algorithm that checks the label point to be sure it
           is inside the map plot boundary before it is drawn. Using this program it is now possible
           to produce IDL maps in PostScript hardware fonts.
          </description>
           <guid isPermaLink="false">article 466 at dfanning.com</guid>
          <pubDate>Fri, 12 Mar 2010 17:11:34 GMT</pubDate> 
        </item>


        <item>
           <title>Catalyst Program Update: Fixed_Map_Grid</title>
           <link>http://www.dfanning.com/programs/catalyst/source/utilities/fixed_map_grid.pro</link>
           <description>
	   This program is designed to fix another problem with Map_Grid, in which occasionally grid
           lines are not drawn properly. I've further modified the program to use the same new clipping
           algorith used in the Modified_Map_Grid program described above.
          </description>
           <guid isPermaLink="false">article 465 at dfanning.com</guid>
          <pubDate>Fri, 12 Mar 2010 17:11:34 GMT</pubDate> 
        </item>

        <item>
           <title>Catalyst Program Update: Map_Grid Object</title>
           <link>http://www.dfanning.com/programs/catalyst/source/graphics/map_grid__define.pro</link>
           <description>
	   I have modified this program to use the new Modified_Map_Grid program described above,
           so it properly clips map grid labels with hardware and true-type fonts. I have
           also tweaked the AUTODRAWGRID method to better draw grids automatically.
          </description>
           <guid isPermaLink="false">article 464 at dfanning.com</guid>
          <pubDate>Fri, 12 Mar 2010 17:11:34 GMT</pubDate> 
        </item>


        <item>
           <title>Catalyst Program Update: ImgWin</title>
           <link>http://www.dfanning.com/programs/catalyst/source/applications/imgwin.pro</link>
           <description>
	   I have updated this program so that if a GeoTiff file is opened, and the user has
           chosen to add a map grid to the image, that the AUTODRAWGRID keyword is set on the
           Map_Grid object. This allows me to open a variety of GeoTiff files and still have
           nice looking map grids put on top of the image.
          </description>
           <guid isPermaLink="false">article 463 at dfanning.com</guid>
          <pubDate>Thu, 11 Mar 2010 16:59:40 GMT</pubDate> 
        </item>

        <item>
           <title>Catalyst Program Update: Map_Grid Object</title>
           <link>http://www.dfanning.com/programs/catalyst/source/graphics/map_grid__define.pro</link>
           <description>
	   I have added an AUTODRAWGRID keyword to this program. If set, this allows the grid
           object to automatically calculate appropriate latitude and longitude values to draw,
           based on the ranges in the supporting map object. In general, this provides nice grids
           in a variety of situations. I use it, for example, when working with GeoTiff files.
          </description>
           <guid isPermaLink="false">article 462 at dfanning.com</guid>
          <pubDate>Thu, 11 Mar 2010 16:59:40 GMT</pubDate> 
        </item>

        <item>
           <title>Catalyst Program Update: MapCoord Object</title>
           <link>http://www.dfanning.com/programs/catalyst/source/coordinates/mapcoord__define.pro</link>
           <description>
	   A small typo in the spelling of the SEMIMINOR_AXIS keyword in the GetProperty
           has been corrected. Also, program documentation has been updated and improved.
          </description>
           <guid isPermaLink="false">article 461 at dfanning.com</guid>
          <pubDate>Thu, 11 Mar 2010 14:40:56 GMT</pubDate> 
        </item>

        <item>
           <title>Catalyst Program Update: GPD_Viewer</title>
           <link>http://www.dfanning.com/programs/catalyst/source/applications/gpd_viewer.pro</link>
           <description>
	   Small changes have been made in the way well-known NSIDC GPD file formats are
           loaded, and I had accidentally reversed the semi-major and semi-minor axes when
           I saved the GPD file to disk.
          </description>
           <guid isPermaLink="false">article 460 at dfanning.com</guid>
          <pubDate>Thu, 11 Mar 2010 14:40:56 GMT</pubDate> 
        </item>

        <item>
           <title>Coyote Program Update: DataViewer</title>
           <link>http://www.dfanning.com/programs/dataviewer.zip</link>
           <description>
	   Changes have been made to the Catalyst DataViewer application
           that allow it to read near real time DMSP SSM/I daily polar gridded
           brightness temperature images. These include images processed with
           the NASA Team (NT) algorithm. The National Snow and Ice designations
           for these new data sets are nsidc-0080 and nsidc-0081.
          </description>
           <guid isPermaLink="false">article 459 at dfanning.com</guid>
          <pubDate>Tue, 09 Mar 2010 14:23:12 GMT</pubDate>
        </item>

        <item>
           <title>Coyote Article: Adding a New Field to an Array of Structures</title>
           <link>http://www.dfanning.com/code_tips/addfield.html</link>
           <description>
	   This article describes how Struct_Assign can be used to copy the contents of
           one array of structures to another array of structures containing a new
           structure field. This makes adding a new field to an array of structures
           less onerous than it would be otherwise.
          </description>
           <guid isPermaLink="false">article 458 at dfanning.com</guid>
          <pubDate>Sun, 07 Mar 2010 16:25:30 GMT</pubDate>
        </item>


        <item>
           <title>Coyote Article: Warping an Image from One Map Projection to Another</title>
           <link>http://www.dfanning.com/map_tips/warpimage.html</link>
           <description>
	   Here is an example of how you can use Map_Proj_Image to warp an image
           in one map projection into another map projection. This is useful,
           for example, if you wish to compare two images that are gridded to
           different map projection grids.
          </description>
           <guid isPermaLink="false">article 457 at dfanning.com</guid>
          <pubDate>Mon, 01 Mar 2010 01:48:59 GMT</pubDate>
        </item>



        <item>
           <title>Coyote Article: When Does One Plus One Equal One in IDL?</title>
           <link>http://www.dfanning.com/math_tips/oneplus.html</link>
           <description>
	   Wayne Landsman points out that one plus one sometimes equals one in IDL.
           Here is what you need to know to avoid this mistake yourself. 
          </description>
           <guid isPermaLink="false">article 456 at dfanning.com</guid>
          <pubDate>Sun, 28 Feb 2010 18:36:39 GMT</pubDate>
        </item>


        <item>
           <title>Coyote Program Update: GPD_Viewer</title>
           <link>http://www.dfanning.com/programs/catalyst/source/applications/gpd_viewer.html</link>
           <description>
	   A fix to a problem that caused the grid location to change if the map scale keywords
           were changed. And a fix that caused the map projection to return to its non-zoomed state
           if the grid location was changed by clicking in the window. 
          </description>
           <guid isPermaLink="false">article 455 at dfanning.com</guid>
          <pubDate>Sun, 28 Feb 2010 17:01:52 GMT</pubDate>
        </item>

        <item>
           <title>Coyote Program Update: FSC_Window</title>
           <link>http://www.dfanning.com/programs/fsc_window.pro</link>
           <description>
	   I've added a REPLACE keyword to the program, which allows the user
           to replace the IDL command that is displayed in the current graphics
           window with another. This gives you the opportunity to use the
           same graphics window over and over again, without creating a 
           separate graphics window for each IDL graphics command you wish
           to display.
          </description>
           <guid isPermaLink="false">article 454 at dfanning.com</guid>
          <pubDate>Fri, 26 Feb 2010 15:30:52 GMT</pubDate>
        </item>


        <item>
           <title>Coyote Presentation: Map Projections in IDL</title>
           <link>http://www.dfanning.com/powerpoint/map_projections_idl.pdf</link>
           <description>
	   These are the slides of my "Map Projections in IDL: Navigating Images" presentation to the
           24 February 2010 IDL User's Group meeting in Boulder, CO.
          </description>
           <guid isPermaLink="false">article 453 at dfanning.com</guid>
          <pubDate>Fri, 26 Feb 2010 14:05:29 GMT</pubDate>
        </item>

        <item>
           <title>Coyote Program Update: RandomNumberGenerator</title>
           <link>http://www.dfanning.com/programs/randomnumbergenerator__define.pro</link>
           <description>
	   I fixed a problem in the Cleanup method where I was not cleaning up
           the seed pointer properly.
          </description>
           <guid isPermaLink="false">article 452 at dfanning.com</guid>
          <pubDate>Fri, 26 Feb 2010 14:05:29 GMT</pubDate>
        </item>


        <item>
           <title>Coyote Program Update: FindMapBoundary</title>
           <link>http://www.dfanning.com/programs/findmapboundary.pro</link>
           <description>
	   I added XRANGE and YRANGE keywords. The same information is returned
           as before, but in a more convenient package for me to use further
           downstream.
          </description>
           <guid isPermaLink="false">article 451 at dfanning.com</guid>
          <pubDate>Fri, 26 Feb 2010 14:05:29 GMT</pubDate>
        </item>

        <item>
           <title>New Coyote Program: FindMapBoundary</title>
           <link>http://www.dfanning.com/programs/findmapboundary.pro</link>
           <description>
	   One of the essential requirements for navigating images is to know the
           boundary of the image in XY (sometimes called UV) coordinates. These are
           essential for setting up the map coordinate space for drawing on or 
           interacting with the image. This program will find the XY boundary for
           those files that encode the information. Currently the program works
           with GeoTiff files, CF 1.4 complaint netCDF files, and GPD files that
           were created with the GPD_Viewer in the Catalyst Library.
          </description>
           <guid isPermaLink="false">article 450 at dfanning.com</guid>
          <pubDate>Mon, 22 Feb 2010 13:26:48 GMT</pubDate>
        </item>


        <item>
           <title>New Coyote Program: NCDF_IsValidFile</title>
           <link>http://www.dfanning.com/programs/ncdf_isvalidfile.pro</link>
           <description>
	   This program is just a simple addition the netCDF files I released
           last week. I just needed as fast, reliable way to tell if a file
           is a netCDF file or not, and nothing like that is available in the
           normal IDL distribution. This program tries to open the given
           file as a netCDF file. If that fails, then I assume the file is not
           a valid netCDF file and return a 0. If it succeeds, I return a 1.
          </description>
           <guid isPermaLink="false">article 449 at dfanning.com</guid>
          <pubDate>Mon, 22 Feb 2010 13:26:48 GMT</pubDate>
        </item>


        <item>
           <title>New Coyote Program: NCDF_Coord</title>
           <link>http://www.dfanning.com/programs/catalyst/source/coordinates/ncdf_coord.pro</link>
           <description>
	   Last week I introduced some new programs to work with netCDF files. This is a new program
           that follows on those. It allows map projection and grid information to be read out
           of a CF 1.4 compliant netCDF file in such a way that a MapCoord object for navigating
           the netCDF variables can be created automatically. NetCDF files are famous for NOT following
           conventions, so I am sure there will be files that cannot be parsed correctly, but this
           program is working for the files I work with on a daily basis. I expect frequent updates
           over time to make it more robust. The program, unlike the other netCDF programs used last
           week, utilizes Catalyst Library functionality, and so lives in the Catalyst Library distribution.
           (The Catalyst Library is becoming so central to my own programming needs, that I expect
            it will shortly be rolled into the Coyote Library itself.)
          </description>
           <guid isPermaLink="false">article 448 at dfanning.com</guid>
          <pubDate>Sun, 21 Feb 2010 15:22:58 GMT</pubDate>
        </item>


          <item>
           <title>New Catalyst Program: Fixed_Map_Grid</title>
           <link>http://www.dfanning.com/programs/catalyst/source/utilities/fixed_map_grid.pro</link>
           <description>
	   A couple of weeks ago I described a "fix" to the built-in IDL routine MAP_GRID
           which allowed me to correct a problem in my GPD_Viewer application in which grid
           lines were not always rendered correctly. I incorporated that fix into my MAP_GRID
           object in the Catalyst Library and thought my problems were solved. Not so. Yesterday
           I noticed that the "fixed" program was, in some circumstances, causing double grid
           lines to be drawn in my IMGWIN program when I was automatically navigating GeoTIFF
           files! Sigh. The sad reality is that to get my programs to work correctly, 
           sometimes I need the "fixed" program and sometimes I don't. So, to give myself this
           flexibility I have put the "fixed" program in its own file (and added it to the
           Utilities directory in the Catalyst Library) and added keywords to the 
           programs that use it (GPD_VIEWER, IMGWIN, and
           the MAP_GRID object) to allow me to select the file depending upon what I am doing
           with the map grid. It's a lousy solution, but until I know more about exactly what
           the problem is, I don't know a better way to solve it.
          </description>
           <guid isPermaLink="false">article 447 at dfanning.com</guid>
          <pubDate>Sun, 21 Feb 2010 15:22:58 GMT</pubDate>
        </item>

      <item>
           <title>Coyote Program Update: Updated Catalyst Programs</title>
           <link>http://www.dfanning.com/programs/catalyst.zip</link>
           <description>
	   I'm preparing a presentation on map projections for this week's IDL Users Group
           conference. As usual, that has brought on a a flurry of programming changes as
           I tend to use programs in new ways, which reveal either bugs or new ideas for
           how I would like things to work. A number of these changes were in Catalyst
           Library routines. In the Applications directory, IMGWIN and GPD_VIEWER changed.
           In the Coordinates directory, the GEOCOORD and MAPCOORD objects changed, and a new file,
           NCDF_COORD was added (described separately). In the Graphics directory, the MAP_GRID,
           MAP_OUTLINE, and MAP_PLOTS objects all changed. I have added a new program, FIXED_MAP_GRID,
           to the Utilities directory. This program is also described separately.
          </description>
           <guid isPermaLink="false">article 446 at dfanning.com</guid>
          <pubDate>Sun, 21 Feb 2010 15:22:58 GMT</pubDate>
        </item>

        <item>
           <title>Coyote Program Update: New Programs for Creating, Browsing, Reading and Modifying netCDF Files</title>
           <link>http://www.dfanning.com/programs/ncdf_tools.zip</link>
           <description>
	   I have a general need to be able to create, browse, and write netCDF files in an extremely 
           flexible way. In particular, I want to be able to copy variables and attributes from one
           file to another without thinking too much about it. To this end, I borrowed heavily (well, 
           I stole most of the good ideas, really) from Mark Hadfield's Motley Library and its
           wonderful netCDF routines. When I started this project, I thought Mark's routines could
           use more documentation and error handling. When I finished, I realized I hadn't added much
           value to what Mark had already provided. But, of course, hindsight is 20-20. I have learned
           a lot about netCDF files, and certainly enough to know I am probably going to be surprised
           in the future about how little I know. In any case, these programs have provided me with
           some new tools for working with netCDF files and I thought they may be of interest to a 
           wider audience. Because most of these tools are written as objects, and because that scares
           the bejesus out of many IDL users, I have provided an example file, NCDF_File_Examples, that
           shows you exactly how to create a netCDF file, copy some of the contents to another netCDF
           file, and then read the netCDF file to do something useful in IDL. I have been particularly
           careful to document these routines so they can be used by a wider audience. In addition to
           Mark, I have been greatly enlightened in my netCDF studies by IDL newsgroup regulars 
           Paul van Delst and Ken Bowman.
          </description>
           <guid isPermaLink="false">article 445 at dfanning.com</guid>
          <pubDate>Wed, 17 Feb 2010 15:02:53 GMT</pubDate>
        </item>


        <item>
           <title>Coyote Program Update: ErrorLogger</title>
           <link>http://www.dfanning.com/programs/errorlogger__define.pro</link>
           <description>
	   The purpose of an error logger, of course, is to create a file with errors in
           it. This is a Good Thing, except during program development, when all the starting
           and stopping of programs can cause error logs to accumulate. To deal with the clutter,
           it is now possible to set a NOCLUTTER keyword on the error logger. This sets both the
           ALERT and DESTROY_ON_DELETE keywords, and makes it impossible to set the status of the
           error logger to the error condition. Thus, the error log file is created, the user
           hears about errors, but the file is always deleted when the error logger object is
           destroyed, preventing file build-up. Also, a PRINT keyword has been added to the AddText
           method. This allows the user to add informational text to a file, while simultaniously
           sending the text to the IDL console. In other words, it provides a method for logging
           what in the past were PRINT statements.
          </description>
           <guid isPermaLink="false">article 444 at dfanning.com</guid>
          <pubDate>Wed, 17 Feb 2010 13:56:58 GMT</pubDate>
        </item>


        <item>
           <title>Coyote Article: What Happened to Maine?</title>
           <link>http://www.dfanning.com/map_tips/nostatedraw.html</link>
           <description>
	   Under certain conditions Map_Continents fails to draw map boundaries.
           Here is an example where it fails to draw all the states in the Northeast
           United States. One alternative is to draw the states using shapefiles, and this
           article describes how to do this to fix the missing state problem 
           shown here.
          </description>
           <guid isPermaLink="false">article 443 at dfanning.com</guid>
          <pubDate>Tue, 16 Feb 2010 03:45:34 GMT</pubDate>
        </item>


        <item>
           <title>Coyote Lament: Who Is In Charge Here?</title>
           <link>http://www.dfanning.com/catalyst/howtoinstall.html</link>
           <description>
	   Coyote has been on the warpath lately. I don't know if it's the
           new vegan diet my wife has us on or what, but he is making life
           totally miserable for me. He is into everything. Today I learned
           that my catalyst.zip file didn't have the same files in it as my
           catalyst directory. Sigh... I don't know what to make of it. I'll
            probably have to go elk hunting this year. Until it settles down,
            you might want to grab new versions of both the Coyote and Catalyst
            libaries. I have no idea what he will be up to tomorrow!
          </description>
           <guid isPermaLink="false">article 442 at dfanning.com</guid>
          <pubDate>Wed, 10 Feb 2010 23:26:13 GMT</pubDate>
        </item>



        <item>
           <title>Coyote Article: How Can I Tell If I Have an X Window Display?</title>
           <link>http://www.dfanning.com/code_tips/hasdisplay.html</link>
           <description>
	   Running IDL from a CRON job or from a remote login often fails because IDL
           can't connect to the X Window system. Either the DISPLAY environmental variable
           is not set or can't be set. There is no way to programmatically check for this
           condition. You have to try to make a connection and fail. This article describes
           a simple IDL function that can do that job for you and alert you before you do
           something you are going to regret.
          </description>
           <guid isPermaLink="false">article 441 at dfanning.com</guid>
          <pubDate>Wed, 10 Feb 2010 23:26:13 GMT</pubDate>
        </item>




        <item>
           <title>Coyote Program Update: ImgWin</title>
           <link>http://www.dfanning.com/programs/catalyst/source/applications/imgwin.pro</link>
           <description>
	   An inconsistency in variable naming ("thisImage" instead of "theImage") showed up today
           when I was trying to navigate a GeoTIFF image. Fixed now.
          </description>
           <guid isPermaLink="false">article 440 at dfanning.com</guid>
          <pubDate>Wed, 10 Feb 2010 16:08:44 GMT</pubDate>
        </item>


        <item>
           <title>Coyote Program Update: GeoCoord</title>
           <link>http://www.dfanning.com/programs/catalyst/source/coordinates/geocoord.pro</link>
           <description>
	   My map projection woes continue. An upcoming talk on map projections for the IDL User's Group
           meeting will either be interesting or totally embarrassing. Today I ran into a GeoTIFF file
           that had it's GTRasterTypeGeoKey set to 2, which indicates the pixels are point data, rather
           than area data. I think this may be a mistake in the file, but in any case I have removed
           my check for this in the GeoCoord program. It doesn't appear to make any difference in this
           case. I'll keep an eye on this in case something changes.
          </description>
           <guid isPermaLink="false">article 439 at dfanning.com</guid>
          <pubDate>Wed, 10 Feb 2010 16:08:44 GMT</pubDate>
        </item>


        <item>
           <title>Coyote Program Update: MapCoord Object</title>
           <link>http://www.dfanning.com/programs/catalyst/source/coordinates/mapcoord__define.pro</link>
           <description>
	   Not my day today. I found another error in the MapCoord object. This one involves
           using the SPHERE_RADIUS keyword. Doing this will access a non-existent "datum" field
           in the object. This has to be changed to "thisDatum". Fixed in all places where this
           occurs. Thanks to a user for spotting this.
          </description>
           <guid isPermaLink="false">article 438 at dfanning.com</guid>
          <pubDate>Tue, 09 Feb 2010 21:40:21 GMT</pubDate>
        </item>


        <item>
           <title>Coyote Program Update: MapCoord Object</title>
           <link>http://www.dfanning.com/programs/catalyst/source/coordinates/mapcoord__define.pro</link>
           <description>
	   I found an extremely embarrassing error in my MapCoord object this morning.
           If the map projection you were trying to create was passed in as a string (e.g., 'UTM')
           then the map projection information was stored incorrectly in the object. If you
           passed the map projection in as an index (e.g., 101) then it was stored correctly.
           Sorry I didn't discover this error sooner, but I almost always use indices when I use
           this object. Fixed in this release.
          </description>
           <guid isPermaLink="false">article 437 at dfanning.com</guid>
          <pubDate>Tue, 09 Feb 2010 19:46:16 GMT</pubDate>
        </item>

     <item>
           <title>IDL Consulting Services</title>
           <link>http://www.dfanning.com/documents/fanning_consulting.html</link>
           <description>
               Need help writing an IDL application? Like to consult an IDL expert? 
               Quality IDL programming guaranteed. Currently accepting new IDL
               programming and consulting opportunities. Pressure of college tuition bills
               guarantees proprietor will not be offended by small projects, tight deadlines, 
               or chinzy budgets! 
               Call today for quality IDL programming: 970-221-0438.
           </description>
            <guid isPermaLink="false">article 046 at dfanning.com</guid>
        <pubDate>Wed, 02 Apr 2008 03:42:50 GMT</pubDate>
       </item>


        <item>
           <title>Coyote Adventures</title>
           <link>http://www.dfanning.com/adventures/index.html</link>
           <description>
              Want to know more about Coyote? Here are stories 
              and essays of recent adventures.
           </description>
            <guid isPermaLink="false">article 008 at dfanning.com</guid>
        <pubDate>Wed, 02 Apr 2008 03:42:50 GMT</pubDate>
       </item>

     </channel>
   </rss>
