/* demhist2.aml /* aml to make a histogram of a DEM /* to be run from GRID /* Ralph Haugerud, USGS Seattle /* April 1998 /* rhaugerud@usgs.gov &arg ingrid CI CU &if [null %CU%] &then &do &type USAGE: &r DEMHIST2 &type where CI = contour interval of source map, in source-map Z units &type and CU = contour units of source map, in InGrid Z units &type (typically InGrid is in meters and contour units are feet, &type so CU = 1/3.2808 = .3048) &return &end &s offset = [round [calc 0.5 * %CI%]] /* offset = 1/2 contour interval NG1 = %InGrid% / (%CU%) + %offset% %ingrid%h2 = INT(NG1 MOD %CI%) - %offset% /* statements above calculate grid of vertical distances /* from nearest contour kill NG1 all histogram %ingrid%h2 &return