ReSe User Support Forum
Batch loop - Printable Version

+- ReSe User Support Forum (https://forum.rese-apps.com)
+-- Forum: Frequently Asked Questions (https://forum.rese-apps.com/forumdisplay.php?fid=1)
+--- Forum: ATCOR-4 (FAQ) (https://forum.rese-apps.com/forumdisplay.php?fid=5)
+--- Thread: Batch loop (/showthread.php?tid=122)



Batch loop - rese_support - 11-Jan-2018

Quote:I am wondering if it is possible to 'for' loop the PARGE or ATCOR commands? 


Say if I have the following commands: 

..\idlrt.exe -rt="..\atcor4.sav" -args "filename_1" F 
..\idlrt.exe -rt="..\atcor4.sav" -args "filename_2" F 

... 
..\idlrt.exe -rt="..\atcor4.sav" -args "filename_n" F 

I can write this within a for loop in the command window. 

However, the problem is running PARGE/ATCOR takes a while. 
Each command should be started after the previous command is finished. 
Say, filename_2 has to wait until filename_1 finishes. 

So, how do I tell it to 'wait'? 

For a batch loop, you got various options:
- use IDL (if you got an IDL license) and write a script for the various calls
- use a third party programming language and issue the calls in for-loop
- write a windows .bat script

For the latter, you got to make sure that tasks are completed (there are some tricks for that, but I didn't test this).
Alternatively, there shouldn't be a problem starting things in parallel as long as the processes are started in separated directories.