NASA Logo, National Aeronautics and Space Administration
SPDF

CDF Patch for IDL 6.2 and later, including IDL 7.*, 8.* and 9.*

This page contains the IDL-CDF patch (Version 3.9.1) based on (CDF library Version 3.9.1 CDF logo) for IDL 6.2 and later. If you have problems reading a CDF file or something is not working properly in IDL, we strongly recommend downloading the IDL CDF patch on this page and see if it solves your problem. If the patch still doesn't work or we don't have a patch for your operating system, please contact cdfsupport.

To read about the available CDF modules from IDL, you can find them here: CDF_Routines.

Several patches have been made available to date. If you downloaded a patch before and are not sure whether you have the latest patch, please download the patch on this page as it supersedes the previous patches.

What's Included in the Patch

  • A new set of modules, CDF_READCDF and CDF_READVARIABLE, are added. Their help information in text can be found here: CDF_READCDF and CDF_READVARIABLE Retrieved data are presented in IDL Hashes, available from IDL 8.0.
  • A new module, CDF_EPOCH_FROMJULDAYS, is added.
  • A new field, CDF file version, is added to cdf_inquire module.
  • Modified CDF_VARGET module to allow reading all data records by setting rec_count to 0.
  • IDL 6.2 or earlier: 1) large CDF file support (> 2 Gigabyte) 2) allows to open files created with IDL 6.3 or later, or CDF 3.1 or later.
  • IDL 6.2 or earlier - support for CDF_EPOCH16 data type. CDF_EPOCH16 is supported in IDL 6.3 or later.
  • Fix for IDL 6.2 (64-bit Linux on AMD64 machine) - CDF functions do not work properly.
  • Fix for IDL 6.3 (all OSs) - allows to create a CDF_EPOCH variable
  • Fix for IDL 6.3 (Intel Mac) - opening/reading a CDF file
  • Fix for IDL 6.4 (Intel Mac) - CDF variable values are read correctly
  • IDL 6.x and 7.* (all OSs) - significant CDF read performance improvement and elimination of a potential buffer overflow problem
  • Add a new feature to allow setting the checksum option for CDF V3.2 files
  • Modified to convert signed CDF_INT1 and CDF_BYTE data type to int so the data can be interpreted correctly in IDL
  • Add a new feature to allow setting the file validation option when opening CDF files
  • Add a few new functions to handle the new data types, CDF_INT8 and CDF_TIME_TT2000
  • Add a few new or modify the existing functions to allow vectorized epoch data values to be processed for computing, breaking down, comparison and differencing for better performance. Documents for the new/modified modules can be found here
  • Allow cdf_epoch_compare to compare times of different CDF epoch types
  • Add a new function, CDF_EPOCH_UNIXTIME, to convert CDF epoch data, in CDF_EPOCH, CDF_EPOCH16 or CDF_TIME_TT2000, to/from Unix times.
  • Allowed multi-dimensional (> 2) CDF epoch data to be operated.
  • Bugs fixed

IDL CDF Patch Download and Installation Instruction

IDL CDF patch consists of two major files: shared CDF library and platform-independent Dynamically Loadable Module (DLM) definition file.

The latest patch is based on the CDF Version 3.9.1. For non-Windows systems, make sure the downloaded dynamic library (the .so file) to have executable permission on your machine. Please contact nasa-cdf-support@nasa.onmicrosoft.com if you need a different CDF version.

Windows:

    • Script installation (need to run as the administrator) to place the patch into an existing IDL package in the c:\program files directory.
      • Download Gnu's wget tool if you don't have it: wget.exe.
      • Download the script: install_idl_win.bat from a terminal window.
      • Run the script from an administrator terminal window. Make sure wget.exe is accessible from PATH variable. Verify the test run shows the correct CDF library version and the last updated leap second date.

        install_idl_win.bat

      • The original IDL installed files: idl_cdf.dlm and idl_cdf.dll are renamed to idl_cdf.dlm-orig and idl_cdf.dll-orig, respectively.
      • If you have set up the environment variable CDF_LEAPSECONDSTABLE to access the external leap second table, unset it so the static one in the library is to be used. Do it from a terminal window, outside of the IDL,
        set CDF_LEAPSECONDSTABLE (to check for if it is set)
        set CDF_LEAPSECONDSTABLE= (to unset it)

    • Manual installation to place the patch into a user's directory
      • Download the following files:
        • Select the one of the following files. The library has the latest leap second table embedded. Contact us if you want to over-ride the table rather than install the latest patch.
        • Download DLM
        • Optionally, download the leap second table. Do this ONLY if you intend to use the previous IDL patch software.
        • Download script showcdfversion.pro.

      • Set the IDL_DLM_PATH and IDL_PATH environment variable to point to the directory where you placed the patch. For example, if you placed the patch in c:\idl_cdf391_patch, then the command should be

        set IDL_DLM_PATH="c:\idl_cdf391_patch;<IDL_DEFAULT>"
        set IDL_PATH="c:\idl_cdf391_patch;<IDL_DEFAULT>"

        Note: The above command must be entered exactly as shown, including angle brackets and double quotes, prior to invoking IDL. If the patch is checked out fine, you can use the downloaded files: idl_cdf.dlm and idl_cdf.dll to replace the ones in the operational directory at
        <your IDL directory>\bin\bin.x86_64 for 64-bit mode, or

        <your IDL directory>\bin\bin.x86 for 32-bit mode
        Backup up the original files.

      • If you have downloaded the leap second table, then set the environment variable CDF_LEAPSECONDSTABLE to the table.
        set CDF_LEAPSECONDSTABLE='<your IDL directory>\CDFLeapSeconds.txt'
        This table will be used, instead of the hard-coded one embedded in the released library. Not setting the environment variable will result in the use of the table from the library. The step is necessary when the leap second table is different from the one in the library. Need to set the environment variable before running CDF modules under IDL.
      • Invoke IDL and use it as usual. Run showcdfversion to show the IDL-CDF and CDF versions.
Mac OS X (Intel Mac or Apple Silicon):
  • Note: Mac Gatekeeper might block the access to idl_cdf.so (or any other files) from CDF as it is downloaded from the Internet for security purpose. If this is the case, you need to manually set it to be accessible. Open the Apple menu, click System Settings, and from Privacy & Security to choose Open Anyway to allow this file to open. Refer Safely open apps on your Mac.
  • Script installation (may need to have the root account access) to place the patch into an existing IDL package in the /Applications or other.
    • Download the script: install_idl_mac.sh from a terminal window.
    • Make the script's permission to executable:

      chmod +x install_idl_mac.sh

    • Run the script. It must be run from an id that has the root permission if the installation goes into /Applications folder. Verify the test run shows the correct CDF library version and the last updated leap second date.

      ./install_idl_mac.sh

    • The original IDL installed files: idl_cdf.dlm and idl_cdf.so are renamed to idl_cdf.dlm-orig and idl_cdf.so-orig, respectively.
    • If you have set up the environment variable CDF_LEAPSECONDSTABLE to access the external leap second table, unset it so the static one in the library is to be used. Do it from a terminal window, outside of the IDL,
      printenv CDF_LEAPSECONDSTABLE (to check for if it is set)
      unsetenv CDF_LEAPSECONDSTABLE (to unset it)

  • Manual installation to place the patch into a user's directory
    • Download the following files
      • CDF shared library - Only the 64-bit (Darwin x86_64 or arm64) version (see the message that IDL presents when first starting) is available. The libraries are built from a Mac OS 13 Ventura. Please let us know if you encounter problems running the patch on any earlier OS. The library has the latest leap second table embedded. Contact us if you want to over-ride the table rather than install the latest patch.
      • Download DLM
      • Optionally, download the leap second table. Do this ONLY if you intend to use the previous IDL patch.
      • Download script showcdfversion.pro.
    • Make sure idl_cdf.so and idl_cdf.dlm did not get ".txt" added to the end. Rename it if so.
    • In Terminal.app, remove Apple's quarantine bit with: sudo xattr -d com.apple.quarantine ~/Downloads/idl_cdf.* if the downloaded files go into ~/Downloads folder.
    • Back up the original idl_cdf.so and idl_cdf.dlm and replace them with the newly downloaded files in the IDL installation at
      <your IDL directory>/bin/bin.darwin.x86_64 with IDL running in x86 code, or
      <your IDL directory>/bin/bin.darwin.arm64 with IDL running in arm64 code
      with the new idl_cdf.so and idl_cdf.dlm downloaded in step 1.
    • If you have downloaded the leap second table, then set the environment variable CDF_LEAPSECONDSTABLE to the table:
      setenv CDF_LEAPSECONDSTABLE "<your downloaded directory>/CDFLeapSeconds.txt" (for csh/tcsh shell)
      export CDF_LEAPSECONDSTABLE="<your downloaded directory>/CDFLeapSeconds.txt" (for sh/bash/korn shell)

      This table will be used, instead of the hard-coded one embedded in the released library. Not setting the environment variable will result in the use of the table from the library. The step is necessary when the leap second table is different from the one in the library. Need to set the environment variable before running CDF modules under IDL.
    • Invoke IDL and use it as usual. Run showcdfversion to show the i IDL-CDF and CDF library versions. For instance,
      cd /Applications/harris/idl/bin/bin.darwin.x86_64
      or cd /Applications/nv5/idl/bin/bin.darwin.arm64
      # Or wherever the latest IDL is.
      # Move old files 2 levels up for safekeeping; give your administrative password.
      sudo mv idl_cdf.* ../..
      # Copy new files from Downloads directory.
      sudo cp ~/Downloads/idl_cdf.* .
      # Make sure there's idl_cdf.so and idl_cdf.dlm, and not a ".txt" on end; if so, rename them.
      ls -l idl_cdf.*
      # Remove Apple's quarantine bit.
      sudo xattr -d com.apple.quarantine idl_cdf.*
      # run IDL to check:
      IDL> .run showcdfversion.pro
Linux:
    • Script installation (need to have the root account access) to place the patch into an existing IDL package in the /usr/local system directory.
      • Download the script: install_idl_unix.sh from a terminal window.
      • Make the script's permission to executable:

        chmod +x install_idl_unix.sh

      • Run the script from an id that has the root permission. Verify the test run shows the correct CDF library version and the last updated leap second date.

        ./install_idl_unix.sh

      • The original IDL installed files: idl_cdf.dlm and idl_cdf.so are renamed to idl_cdf.dlm-orig and idl_cdf.so-orig, respectively.
      • If you have set up the environment variable CDF_LEAPSECONDSTABLE to access the external leap second table, unset it so the static one in the library is to be used. Do it from a terminal window, outside of the IDL,
        printenv CDF_LEAPSECONDSTABLE (to check for if it is set)
        unsetenv CDF_LEAPSECONDSTABLE (to unset it)

    • Manual installation to place the patch into a user's directory
      • Download the following files
        • One of the following shared libraries. The banner information from idl when it is run will tell it is in either 32-bit (Linux x86 m32) or 64-bit (Linux x86_64 m64) mode.
        • The library has the latest leap second table embedded.
        • Download DLM
        • Optionally, download the leap second table. Do this ONLY if you intend to use the previous IDL patch software.
        • Download script showcdfversion.pro.
      • Set the IDL_DLM_PATH environment variable to point to the directory where you placed the patch. For example, if you placed the patch in /home/harold, then the command should be:

        setenv IDL_DLM_PATH "/home/harold:<IDL_DEFAULT>" (for csh/tcsh shell)
        export IDL_DLM_PATH="/home/harold:<IDL_DEFAULT>" (for sh/bash/korn shell)

        Note: The above command must be entered exactly as shown, including angle brackets and double quotes, prior to invoking IDL.

        If the patch is checked out fine, you can use the downloaded files to replace the ones in the operational directory (may need the root access) at
        <your IDL directory>/bin/bin.linux.x86_64 for 64-bit mode, or

        <your IDL directory>/bin/bin.linux.x86 32-bit mode

      • If you have downloaded the leap second table, then set the environment variable CDF_LEAPSECONDSTABLE to the table.
        setenv CDF_LEAPSECONDSTABLE "<your IDL directory>/CDFLeapSeconds.txt" (for csh/tcsh shell)
        export CDF_LEAPSECONDSTABLE="<your IDL directory>/CDFLeapSeconds.txt" (for sh/bash/korn shell)

        This table will be used, instead of the hard-coded one embedded in the released library. Not setting the environment variable will result in the use of the table from the library. The step is necessary when the leap second table is different from the one in the library. Need to set the environment variable before running CDF modules under IDL.
      • Invoke IDL and use it as usual. Run showcdfversion to show the IDL-CDF and CDF library versions.
Other OS:
Please contact cdfsupport to obtain a patch for your operating system, which we likely no longer have.

If you have questions, need assistance or encounter problems, please contact us at cdfsupport.