X

NV5 Geospatial Blog

Each month, NV5 Geospatial posts new blog content across a variety of categories. Browse our latest posts below to learn about important geospatial information or use the search bar to find a specific topic or author. Stay informed of the latest blog posts, events, and technologies by joining our email list!



Not All Supernovae Are Created Equal: Rethinking the Universe’s Measuring Tools

Not All Supernovae Are Created Equal: Rethinking the Universe’s Measuring Tools

6/3/2025

Rethinking the Reliability of Type 1a Supernovae   How do astronomers measure the universe? It all starts with distance. From gauging the size of a galaxy to calculating how fast the universe is expanding, measuring cosmic distances is essential to understanding everything in the sky. For nearby stars, astronomers use... Read More >

Using LLMs To Research Remote Sensing Software: Helpful, but Incomplete

Using LLMs To Research Remote Sensing Software: Helpful, but Incomplete

5/26/2025

Whether you’re new to remote sensing or a seasoned expert, there is no doubt that large language models (LLMs) like OpenAI’s ChatGPT or Google’s Gemini can be incredibly useful in many aspects of research. From exploring the electromagnetic spectrum to creating object detection models using the latest deep learning... Read More >

From Image to Insight: How GEOINT Automation Is Changing the Speed of Decision-Making

From Image to Insight: How GEOINT Automation Is Changing the Speed of Decision-Making

4/28/2025

When every second counts, the ability to process geospatial data rapidly and accurately isn’t just helpful, it’s critical. Geospatial Intelligence (GEOINT) has always played a pivotal role in defense, security, and disaster response. But in high-tempo operations, traditional workflows are no longer fast enough. Analysts are... Read More >

Thermal Infrared Echoes: Illuminating the Last Gasp of a Dying Star

Thermal Infrared Echoes: Illuminating the Last Gasp of a Dying Star

4/24/2025

This blog was written by Eli Dwek, Emeritus, NASA Goddard Space Flight Center, Greenbelt, MD and Research Fellow, Center for Astrophysics, Harvard & Smithsonian, Cambridge, MA. It is the fifth blog in a series showcasing our IDL® Fellows program which supports passionate retired IDL users who may need support to continue their work... Read More >

A New Era of Hyperspectral Imaging with ENVI® and Wyvern’s Open Data Program

A New Era of Hyperspectral Imaging with ENVI® and Wyvern’s Open Data Program

2/25/2025

This blog was written in collaboration with Adam O’Connor from Wyvern.   As hyperspectral imaging (HSI) continues to grow in importance, access to high-quality satellite data is key to unlocking new insights in environmental monitoring, agriculture, forestry, mining, security, energy infrastructure management, and more.... Read More >

1345678910Last
8152 Rate this article:
No rating

Making movies with IDL, part II

Anonym

Last week, I gave an example of making a movie with IDLffVideoWrite and DG. This week, I’ll use NG to make a similar movie. The example is again written as a procedure. Start the program by declaring some test data and making a simple visualization:

pro ng_movie_ex
   compile_opt idl2

   data = dist(30)

   s = surface(data, color='blue', /buffer)
   c = contour(data, n_levels=10, zvalue=0.0, /overplot)
   t = text(0.5, 0.9, 'IDL Movie Example - NG', alignment=0.5, font_size=16)

Note that the BUFFER property is set on the call to SURFACE. It forces the visualization to be rendered to an offscreen buffer; it’s the analog to the DG Z buffer device. Next, set up the IDLffVideoWrite object:

   video_file = 'ng_movie_ex.mp4'
   video = idlffvideowrite(video_file)
   framerate = 10
   wdims = s.window.dimensions
   stream = video.addvideostream(wdims[0], wdims[1], framerate)

As in last week’s example, I’ve chosen to output to an MPEG-4 video file. The dimensions of the movie are taken from the dimensions of the buffer (the default, 640 x 512) created in the call to the SURFACE function. The next step is to make and load frames into the movie file:

   nframes = 50
   for i=0, nframes-1 do begin
      s.rotate, 1.0, /yaxis               ; degrees
      c.zvalue = i*max(s.zrange)/nframes  ; data coordinates
      timestamp = video.put(stream, s.copywindow())
   endfor

On each iteration of the loop:

  1. The Rotate method rotates the surface by one degree about the global y-axis of the visualization (this is from Object Graphics; +x is right, +y is up, +z is pointed toward you)
  2. By modifying its ZVALUE property, the contour plot moves up by a fraction of the total height of the surface.
  3. The CopyWindow method (the analog to the TVRD function in DG) takes a picture of the visualization in the buffer. The picture is a pixel-interleaved RGB image, with dimensions 3 x 640 x 512.
  4. The Put method of IDLffVideoWrite loads this picture as a frame into the video stream.

End the program by destroying the video object and the buffered graphic:

   video.cleanup
   print, 'File "' + video_file + '" written to current directory.'
   s.close
end

Click below to see the resulting video on the VIS YouTube channel. [youtube http://www.youtube.com/watch?v=ixGJIViukDA]   Notes:

  1. I have a more complex NG movie example that uses the SetData method introduced in 8.1. You can download it from this [exelisvis.com] page; look for the “What's New in IDL 8.1” webinar files, grab them and look for the program called VIDEO_WRITE1. I may give this example the blog treatment at a later point.
  2. I also have two other fun examples that should get the blog treatment: a) creating an AVI movie that can be embedded in a PowerPoint presentation, and b) creating a SWF movie that, with an HTML+Javascript framework, can be viewed in a web browser. Both are included in the IDL 8.1 examples above; look for the program VIDEO_WRITE2 and its output.
Please login or register to post comments.