/*N dodslnlp.aml /*P Purpose: to take input from the Dods program /* and create lines with attached data as calculated by matlab --------------- /*A---------------------------- Arguments ------------------------------------ /*G------------------------ Global Variables --------------------------------- /*L------------------------ Local Variables ---------------------------------- /*I Input/Output Files, Coverages: inputs include one input file that contains, /*the names of infile1,infile2,outcov in each line (in that format - comma separated) /* /* infile1 is in arc generate (lines) format, /* infile2 is in *.dat format for importing to INFO, /* outcov is the first line coverage generated /* addtl output includes a built line file with generated lines, and a grid with /*D: this should be run from coverages directory /*R----------- Other AMLs, Menus, or Programs Run from this AML -------------- /*B----------- Other AMLs, Menus, or Programs which Run this AML ------------- /*O-------------------- Operating System Dependencies ------------------------ /*H----------------------------- History ------------------------------------- /* /* Original Coding: Rob Schick 6/25/01 /* /*E=========================================================================== /* &severity &error &routine bailout &s file = [response 'Specify the name of the input file with full path'] /*&r aml_loop input_file /*&args file input_file /* open input file for reading &s op [open %file% opstat -read] &s rd [read %op% rdstat] /*start loop &do &while %rdstat% = 0 /* get an input txt file in Arcline format &s infile1 = [extract 1 %rd%] /* get the input data file to go along with the above generate file &s infile2 = [extract 2 %rd%] &s outcov [extract 3 %rd%] &s upoutcov = [upcase %outcov%] &s grd = gd &s euc = d &s lc = lc /* generate the coverage generate %outcov% input %infile1% /* input ..\..\dods\raw_data\frnt1995197.txt lines quit /*build the coverage to assign topology build %outcov% line /* go into info and define the import database &Data arc info ARC DEFINE %upoutcov%.DAT %upoutcov%-ID,4,5,B MEAN_SST,14,14,N,4 STD_SST,14,14,N,4 MEAN_SSTGRAD,14,14,N,4 MEAN_GRADDIR,14,14,N,4 MEAN_DEPTH,14,14,N,4 ~ IMPORT [pathname %infile2%] SDF NORMAL Q STOP &End JOINITEM %outcov%.aat %upoutcov%.DAT %outcov%.aat %outcov%-ID %outcov%-ID BUILD %outcov% LINE PROJECTDEFINE COVER %outcov% PROJECTION GEOGRAPHIC UNITS DD DATUM NAD83 PARAMETERS &s outcovprj = %outcov%%lc% /* spit out an projected file with the lambert conic conformal projection project cover %outcov% %outcovprj% output projection lambert units meters datum nad83 parameters 36 09 36 /* 1st standard parallel 43 49 48 /* 2nd standard parallel -70.0 /* Central meridian 40.0 /* Latitude of projections's origin 0 /* False Easting 0 /* False northing end /* turn the line into a grid &s outgrid = %grd%%outcov% linegrid %outcov% ..\grids\%outgrid% %outcov%-ID 0.01668 Y NODATA &s outgrdprj = %outgrid%%lc% /* spit out a projected grid with the lambert conic conformal projection project grid ..\grids\%outgrid% ..\grids\%outgrdprj% output projection lambert units meters datum nad83 parameters 36 09 36 /* 1st standard parallel 43 49 48 /* 2nd standard parallel -70.0 /* Central meridian 40.0 /* Latitude of projections's origin 0 /* False Easting 0 /* False northing end /* create a eucdistance grid from the lines. /*specify name of output eucdistance grid &s eucgrid = %euc%%outcov% &s eucgrdprj = %euc%%outcovprj% /* to get the projected line turned into a distance grid GRID ..\grids\%eucgrid% = eucdistance(..\grids\%outgrid%) ..\grids\%eucgrdprj% = eucdistance(..\grids\%outgrdprj%) quit /* restart loop &s rd [read %op% rdstat] /* end loop when last record is read &end &call exit &return /* /* ---------------------------- Routine Usage -------------------------------- /* &routine usage &type Usage: &run dodslnlp &return /* /* ---------------------------- Routine Exit --------------------------------- /* &routine exit &return /* /* --------------------------- Routine Bailout ------------------------------- /* &routine bailout &severity &error &ignore &call exit &return &error Bailing out of dodslnlp.aml... /* End of AML.