7.4 Computing Grid Cells that Contain Points

The program allocator.exe can be used to allocate point source data into the output grid, egrid, or polygon. For this calculation, MIMS_PROCESSING is set to OVERLAY mode.

When allocator.exe is run, it determines how to map the point source data into grid, egrid, or polygon modeling output. It will print output on screen or into a file based on the format users define with modeling output grid, egrid, or polygon IDs.

The following is a sample script named overlay_sites_on_egrid.csh used to map a point source data into the the WRF/NMM-CMAQ egrid:


# Set debug output
setenv DEBUG_OUTPUT Y

# Set executable
setenv SA_HOME ..
setenv EXE "$SA_HOME/bin/allocator.exe"

# Set Input Directory
setenv DATADIR $SA_HOME/data
setenv OUTPUT $SA_HOME/output

# Select method of spatial analysis

setenv MIMS_PROCESSING OVERLAY

setenv TIME time

setenv OVERLAY_SHAPE EGRID_359X573
setenv OVERLAY_TYPE EGrid
setenv OVERLAY_MAP_PRJN EGRID_359X573
setenv OVERLAY_ELLIPSOID "+a=6371200.00,+b=6371200.00"
setenv OUTPUT_POLY_FILE $DATADIR/egrid_arc.dat
setenv GRIDDESC $DATADIR/GRIDDESC.txt
setenv OVERLAY_OUT_TYPE DelimitedFile
setenv OVERLAY_OUT_NAME $OUTPUT/egrid_point.csv
setenv OVERLAY_OUT_DELIM COMMA

# set for row and col computation for EGRID since regular grids have row and col in created grid shapefile
setenv OVERLAY_OUT_CELLID YES

# will print row and col
# problem with this method is that ROW and COL are not avaiable to pass through
#setenv OVERLAY_ATTRS Site_ID
setenv OVERLAY_ATTRS ALL
setenv INPUT_FILE_NAME $DATADIR/CASTNET_locations.txt
setenv INPUT_FILE_TYPE PointFile
setenv INPUT_FILE_XCOL Longitude
setenv INPUT_FILE_YCOL Latitude
setenv INPUT_FILE_DELIM SEMICOLON
setenv INPUT_FILE_MAP_PRJN "+proj=latlong"
setenv INPUT_FILE_ELLIPSOID "+a=6370997.00,+b=6370997.00"
setenv WRITE_HEADER Y

echo "Overlaying egrid with PointFile"
$TIME $EXE

The output egrid_point.csv contains column and row of egrid cells for the input point data in addition to the original input data items.


To Section 8: Revision History