USING THE SVF FILES TO FIND DATA FOR A DESIRED LOCATION

------

SVF is a standard file format consisting of two header lines followed by an integer array. The SVF files used for VEMAP data have three additional header lines but are otherwise in standard SVF format.

Each file contains an array of values for the variable described by the filename. For the VEMAP project the conterminous US was divided into 0.5 degree by 0.5 degree grid cells. There are 115 grid cells across the US from west to east and 48 from north to south, for a total of 5520 cells. All grid cells are referenced by the latitude and longitude of the cell center, beginning with the northwest corner of the grid. The SVF files are presented in an array consisting of 48 rows of data (latitude), with 115 columns per line (longitude).

SVF files and site files contain the same information, however, the data are stored differently. The information from several SVF files is combined within each site file.

Note: The grid cells are large enough (0.5 degree X 0.5 degree) to contain significant terrain variation within the cell. Grid cells with more than half their area covered by water are assigned a background value (-9999).

o FIND THE FILE POSITION (ROW AND COLUMN) FROM LATITUDE AND LONGITUDE

  1. You will need to know the latitude and longitude, in degrees and hundredths of a degree, of the site you are interested in. For example, Milwaukee, Wisconsin, lies at latitude is 43 degrees 2 minutes N and longitude 87 degrees 55 minutes W. Converting to degrees and hundredths of a degree results in a latitude of 43.03N and a longitude of 87.92W.


  2. The northern boundary of the VEMAP grid is 49.0N and the western boundary is 124.5W. Note: the cells are referenced by the latitude and longitude of the grid cell center. Therefore, cells on the northern boundary are referenced by a latitude of 48.75N not 49.0N.

    To calculate a grid location:

    row_number = 1 + [( 49.0 - site_latitude )/0.5]
    column_number = 1 + [(124.5 - site_longitude)/0.5]

    Truncate the decimal portion without rounding (i.e., 5.6 = 5).

    For Milwaukee:
         row_number     = 1 + [(49.0 - 43.03)/0.5]
                        = 1 + (11.94)
                        = 12.94 
                        = 12
    
    Similarly for the east-west position:
          column_number = 1 + [(124.5 - 87.92)/0.5]
                        = 1 + (73.16)
                        = 74.16 
                        = 74
    
    The data for this site are stored in the 12th row as the 74th value (column) of that row.


  3. When you extract the value for this file position from the SVF file you will find that it equals -9999, the background flag. In this case the background flag indicates that more than half the area of this particular cell lies in Lake Michigan.


  4. Choose a slightly different grid cell. For example, you might choose the adjacent cell to the west, which is the column to the left of the one found above (i.e., column 73 in the 12th row).


  5. To confirm the file position of the adjacent cell, note that the cells are 0.5 degrees wide. The original Milwaukee coordinates were 43.03N and 87.92W. If we move 0.5 degrees west, the new coordinates will be 43.03N and 88.42W, which fall within the adjacent grid cell.
          column_number = 1 + [(124.5 - 88.42)/0.5]
                        = 1 + 72.16
                        = 73.16 
                        = 73
    

!!! WARNING !!!i

The southern border of the VEMAP grid is 25N and the eastern border is 67W. Selecting a latitude of 25.0N will cause the algorithm given above to produce a spurious row number of 49. Similarly, a longitude of 67.0W will result in an incorrect column number of 116. These values should be 48 and 115, respectively.

o FIND THE GRIDPOINT FROM THE FILE POSITION

The grid cells are numbered consecutively from 1 to 5520, beginning in the NW corner of the grid and increasing first to the east and then to the south. The grid point value for a specific cell can be derived from the row and column numbers calculated above:

grid point = [(row_number - 1) * 115] + column_number

For Milwaukee:

      	grid point = [(12 - 1) * 115] + 73
                  = 1338

o FIND FILE POSITION FROM THE GRIDPOINT

The file position for a specific grid point can be easily calculated.

row_number = 1 + [(grid point - 1)/115]

Truncate the decimal portion of row_number without rounding (i.e., 5.6 = 5). Then use row_number to calculate the column number.

column_number = grid point - [115 * (row_number - 1)]

Example for grid point 1338:

        row_number = 1 + [(1338 - 1)/115]
                   = 1 + 11.63
                   = 12.63
                   = 12

     column_number = 1338 - [115 * (12 - 1)]
                   = 1338 - 1265
                   = 73

o FIND LATITUDE AND LONGITUDE FROM THE FILE POSITION

  1. Latitude (in degrees and hundredths of a degree):

    latitude = 49 + [0.5 * (1 - row_number)]

    This value is the northern border of the grid cell; subtract 0.25 for the latitude of the center of the cell.


  2. Longitude (in degrees and hundredths of a degree):

    longitude = 124.5 + [0.5 * (1 - column_number)]

    This value defines the western border of the grid cell; subtract 0.25 for the longitude of the cell center.

Back to the first page

-----