/* ------------------------------------------------------------------------- /* GIS Laboratory /* Division of Geological and Planetary Sciences /* California Institute of Technology /* ------------------------------------------------------------------------- /* Program : EPI_PLOT.AML /* Purpose : Plot earthquake epicenters using a symbol that varies linearly /* in size based on magnitude, and in color based on depth /* ------------------------------------------------------------------------- /* Calls : init /* Called by: Arcplot prompt /* ------------------------------------------------------------------------- /* Arguments: cov - coverage name /* : dep_att - depth attribute name inside coverage /* : mag_att - magnitude attribute name inside coverage /* : dep_min - minimum depth to use /* : dep_max - maximum depth to use /* : mag_min - minimum magnitude to use /* : mag_max - maximum magnitude to use /* : size_min - size of symbol for smallest magnitude /* : size_max - size of symbol for largest magnitude /* : symb - symbol number to use with current markerset /* Globals : none /* ------------------------------------------------------------------------- /* Notes : The markerset must be defined before running this aml. The /* : color range is defined below as blue (shallow) to red (deep). /* : It seemed like a lot more bother to add these colors as /* : calling arguments so if those colors are not to your liking /* : you can change them below on the 'markercolorramp' line. /* ------------------------------------------------------------------------- /* History : 11/04/99 - Tony Soeller; program created /* ========================================================================= &args cov dep_att mag_att dep_min dep_max mag_min mag_max ~ size_min size_max symb /* Call routine to do initial syntax checking &call init /* Construct the symbols and color them based on depth &s num_symbols = [calc %dep_max% - %dep_min% + 1] &do new_symb = %dep_min% &to %dep_max% markercopy %symb% %new_symb% &end markercolorramp %dep_min% %num_symbols% cmy 100 100 0 cmy 0 100 100 /* Step through each record in the point coverage and extract /* its associated depth and magnitude values; redefine the size /* component of the associated marker symbol using the extracted /* parameters &s mag_range = [calc %mag_max% - %mag_min%] &s size_range = [calc %size_max% - %size_min%] &describe %cov% &do i = 1 &to %dsc$points% clearsel resel %cov% point %cov_name%# = %i% &s depth = [show select %cov% point 1 item %dep_att%] &s mag = [show select %cov% point 1 item %mag_att%] &s symb = [round [calc %depth% - 0.5]] &if %symb% lt %dep_min% or %symb% gt %dep_max% &then &goto bypass &s mag_frac = [calc ( %mag% - %mag_min% ) / %mag_range%] &s size = [calc %size_min% + ( %size_range% * %mag_frac% )] markersym %symb% markersize %size% points %cov% &label bypass &end &return /************************************************************************** /* Perform program initialization &routine init /* Display a message about usage &if [null %symb%] &then &return &inform ~ Usage: &r epi_plot2 /* Check for coverage existence &if ^ [exists %cov% -cover] &then &return &inform Error: coverage: %cov% does not exist /* Extract coverage name from path &s cov_name = [entryname %cov%] &return