Commit bd908ae2 authored by Larkin Heintzman's avatar Larkin Heintzman

updating directory variables

parent a167f3f3
/matlab_data/
/matlab_data_10km/ /matlab_data_10km/
/matlab_data_hiker_10km/ /matlab_data_hiker_10km/
/matlab_data_locale/ /matlab_data_locale/
......
...@@ -253,16 +253,16 @@ if __name__ == "__main__": ...@@ -253,16 +253,16 @@ if __name__ == "__main__":
[-78.46993, 38.44706,'DevilsDitch'], [-78.46993, 38.44706,'DevilsDitch'],
[-79.33887, 37.67752, 'Punchbowl'], [-79.33887, 37.67752, 'Punchbowl'],
[-78.52798, 37.99092,'BiscuitRun']] [-78.52798, 37.99092,'BiscuitRun']]
base_dir = 'C:/Users/Larkin/ags_grabber'
eng = matlab.engine.start_matlab() # engine for running matlab eng = matlab.engine.start_matlab() # engine for running matlab
for i,ics_pt in enumerate(ics): for i,ics_pt in enumerate(ics):
anchor_point = [float(ics_pt[0]), float(ics_pt[1])] anchor_point = [float(ics_pt[0]), float(ics_pt[1])]
extent = 20e3 extent = 15e3
save_flag = True save_flag = True
plot_flag = False plot_flag = False
# file_id = str(anchor_point) + "_" + str(extent/1000) + "km"
file_extension = 'temp' file_extension = 'temp'
sample_dist = int(extent/100) sample_dist = int(extent/100)
...@@ -273,7 +273,7 @@ if __name__ == "__main__": ...@@ -273,7 +273,7 @@ if __name__ == "__main__":
time.sleep(1) # wait for... files to settle? time.sleep(1) # wait for... files to settle?
# run matlab # run matlab
res = eng.importmap_py(str(ics_pt[2])) res = eng.importmap_py(str(ics_pt[2]), base_dir)
print("------- total time = {} seconds, iteration {}/{} ------".format(time.time() - start_time,i,len(ics))) print("------- total time = {} seconds, iteration {}/{} ------".format(time.time() - start_time,i,len(ics)))
eng.quit() eng.quit()
\ No newline at end of file
function result = importmap_py(save_filename) function result = importmap_py(save_filename, basedir)
% import map layers from pycharm generated code % import map layers from pycharm generated code
...@@ -17,15 +17,25 @@ function result = importmap_py(save_filename) ...@@ -17,15 +17,25 @@ function result = importmap_py(save_filename)
% fnamelin = '/Users/ah/PycharmProjects/ags_grabber/map_layers/lakes_inac_data_[37.474015, -80.868333]_10.0km.csv'; % fnamelin = '/Users/ah/PycharmProjects/ags_grabber/map_layers/lakes_inac_data_[37.474015, -80.868333]_10.0km.csv';
% temp file names to read from % temp file names to read from
fnameelev = 'C:\\Users\\Larkin\\ags_grabber\\map_layers\\elv_data_temp.csv'; % fnameelev = 'C:\\Users\\Larkin\\ags_grabber\\map_layers\\elv_data_temp.csv';
fnameriv = 'C:\\Users\\Larkin\\ags_grabber\\map_layers\\rivers_data_temp.csv'; % fnameriv = 'C:\\Users\\Larkin\\ags_grabber\\map_layers\\rivers_data_temp.csv';
fnamerivbd = 'C:\\Users\\Larkin\\ags_grabber\\map_layers\\rivers_bdd_data_temp.csv'; % fnamerivbd = 'C:\\Users\\Larkin\\ags_grabber\\map_layers\\rivers_bdd_data_temp.csv';
fnamerivin = 'C:\\Users\\Larkin\\ags_grabber\\map_layers\\rivers_bdd_inac_data_temp.csv'; % fnamerivin = 'C:\\Users\\Larkin\\ags_grabber\\map_layers\\rivers_bdd_inac_data_temp.csv';
fnameroad = 'C:\\Users\\Larkin\\ags_grabber\\map_layers\\roads_data_temp.csv'; % fnameroad = 'C:\\Users\\Larkin\\ags_grabber\\map_layers\\roads_data_temp.csv';
fnamerr = 'C:\\Users\\Larkin\\ags_grabber\\map_layers\\railroads_data_temp.csv'; % fnamerr = 'C:\\Users\\Larkin\\ags_grabber\\map_layers\\railroads_data_temp.csv';
fnamep = 'C:\\Users\\Larkin\\ags_grabber\\map_layers\\powerlines_data_temp.csv'; % fnamep = 'C:\\Users\\Larkin\\ags_grabber\\map_layers\\powerlines_data_temp.csv';
fnamelbd = 'C:\\Users\\Larkin\\ags_grabber\\map_layers\\lakes_data_temp.csv'; % fnamelbd = 'C:\\Users\\Larkin\\ags_grabber\\map_layers\\lakes_data_temp.csv';
fnamelin = 'C:\\Users\\Larkin\\ags_grabber\\map_layers\\lakes_inac_data_temp.csv'; % fnamelin = 'C:\\Users\\Larkin\\ags_grabber\\map_layers\\lakes_inac_data_temp.csv';
fnameelev = strjoin({basedir, '/map_layers/elv_data_temp.csv'},'');
fnameriv = strjoin({basedir, '/map_layers/rivers_data_temp.csv'},'');
fnamerivbd = strjoin({basedir, '/map_layers/rivers_bdd_data_temp.csv'},'');
fnamerivin = strjoin({basedir, '/map_layers/rivers_bdd_inac_data_temp.csv'},'');
fnameroad = strjoin({basedir, '/map_layers/roads_data_temp.csv'},'');
fnamerr = strjoin({basedir, '/map_layers/railroads_data_temp.csv'},'');
fnamep = strjoin({basedir, '/map_layers/powerlines_data_temp.csv'},'');
fnamelbd = strjoin({basedir, '/map_layers/lakes_data_temp.csv'},'');
fnamelin = strjoin({basedir, '/map_layers/lakes_inac_data_temp.csv'},'');
Zelev = load(fnameelev); Zelev = load(fnameelev);
BWriver = load(fnameriv); BWriver = load(fnameriv);
...@@ -55,7 +65,7 @@ BWInac = BWriverInac + BWlakeInac; ...@@ -55,7 +65,7 @@ BWInac = BWriverInac + BWlakeInac;
BWLF(BWLF ~= 0) = 1; BWLF(BWLF ~= 0) = 1;
BWInac(BWInac ~= 0) = 1; BWInac(BWInac ~= 0) = 1;
file_path = 'C:\\Users\\Larkin\\ags_grabber\\matlab_data\\'; % define your own path here! file_path = strjoin({basedir, '/matlab_data/'},''); % define your own path here!
% save_filename is just the ics point in question % save_filename is just the ics point in question
save(strjoin({file_path, 'BW_LFandInac_Zelev_',save_filename,'.mat'},''),'BWLF','BWInac','sZelev') save(strjoin({file_path, 'BW_LFandInac_Zelev_',save_filename,'.mat'},''),'BWLF','BWInac','sZelev')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment