Knowledge Base

How to Import IMS ASCII Data Into ArcGIS


This article describes the process for importing IMS ASCII data, in 1, 4, and 24km resolutions into ArcGIS. This article was produced using ArcMap v10.5. For the 24km resolution data, there is both packed and unpacked versions of the data. For packed data, please follow all steps below. For unpacked data, download the IMS_24km_Unpacked_to_Packed.txt file containing Python code at the bottom of this page. Change the extension to .py and use the script to convert to packed form ready for ArcGIS and then follow steps 5-8. The steps to follow require the use of the command line “Sed” utility included in Unix-like environments. If you are running a Windows machine, you can install “Sed for Windows” through SourceForge: http://gnuwin32.sourceforge.net/packages/sed.htm

  1. Unzip the *.asc.gz file you downloaded from our FTP
     
  2. In your choice of text editor, open the *.asc file and strip the header information such that only the numerical data array remains. Ensure there is no white space or a blank line at the start of the document. Save your new data array as *_stripped.asc.
     
  3. Open a command line/terminal window in the same directory as your header-stripped data array, and issue the follow sed command to insert white space between each integer in the array:

sed 's/.\{1\}/& /g' filename_stripped.asc > newfilename.asc

  1. Open your newfilename.asc and add header information to the first five lines of the file. The header information will be dependent on file resolution you are working with (See Table 4 of the IMS documentation):
    1. For 24km resolution data, in packed form

      NCOLS 1024
      NROWS 1024
      XLLCORNER -12126597.0
      YLLCORNER -12126480.0
      CELLSIZE 23684.977
       
    2. For 04km resolution data:

      NCOLS 6144
      NROWS 6144
      XLLCORNER -12288000.0
      YLLCORNER -12288000.0
      CELLSIZE 4000.0
       
    3. For 01km resolution data:

      NCOLS 24576
      NROWS 24576
      XLLCORNER -12288000.0
      YLLCORNER -12288000.0
      CELLSIZE 1000.0
       

      Here is an example how the (packed) 24km .asc file should look after completing steps 1-4.

      NCOLS 1024
      NROWS 1024
      XLLCORNER -12126597.0
      YLLCORNER -12126480.0
      CELLSIZE 23684.997
      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...[1024]
      0
      0
      0
      0
      .
      .
      .
      [1024]

      ​Now, save your file as you prefer.

  2. In the ArcToolbox, you can make use of the ArcToolbox ->  Conversion Tools -> ToRaster -> ASCII to Raster tool. We recommend setting the output raster as a .tif extension. If the tool fails, open the.asc file again to make sure there is no white space at the end of the file.
     
  3. The data should now be displayed in the Map pane. However, as the documentation states in a special note just above Table 4, the data are written to the file in reverse order such that the raster is inverted. Use the ArcToolbox->Data Management Tools -> Projections and Transformations -> Raster ->Flip.
     
  4. Lastly, assign the projection. ArcToolbox-> Data Management Tools ->  Projections and Transformations -> Raster -> Project Raster
    1. For 24km data:
      1. Output Coordinate System: Add Coordinate System -> New -> Projected Coordinate System
      2. General -> Name: 'IMS 24km Coordinate System'
      3. Projected > Name (dropdown): Polar_Stereographic_Variant_B
      4. Set Standard Parallel = 60 and Longitude of Origin = -80
      5. Geographic Coordinate System -> "Change..."
      6. "Add Coordinate System:" > New Geographic Coordinate System
      7. Name: 'IMS_24km_Geographic Coordinate System'
      8. Set Datum to <custom> and Spheroid to <custom>
      9. Set Smi major and Semi minor axes to: 6371200
      10. Inverse flattening = 0
      11. Apply all changes
         
    2. For 01km and 04km data:
      1. Output Coordinate System: Add Coordinate System -> New -> Projected Coordinate System
      2. General -> Name: 'IMS xxkm Coordinate System'
      3. Name: Polar_Stereographic_Variant_B
      4. Set Standard Parallel = 60 and Longitude of Origin = -80
         
  5. Done! Test your data against a known continent / coastaline shapefile for placement.

    Example Output from the packed 24km data

Example output from the unpacked to packed 24km conversion

Last edited: June 19, 2017

86,5 Bot