scripting OxCal via command line

254 views
Skip to first unread message

MILLARD A.R.

unread,
Mar 8, 2012, 4:47:33 AM3/8/12
to ox...@googlegroups.com
I find myself wanting to run a model multiple times with simulated dates. It looks as though the easiest way to do this would be via some form of scripting. The OxCal manual implies that the program can be run from the command line, which would be ideal for scripting. I located two sets of online instructions at
http://www.bear.bham.ac.uk/bluebear/applications/OxCal.shtml
http://www.stanford.edu/~cengel/cgi-bin/anthrospace/running-oxcal-on-an-xgrid
these suggest to me that the DOS command line
OxCalWin<input.oxcal>output.txt
should work, but I get nonsense in the output file. Using some of the command line options from OxCal 3 (http://c14.arch.ox.ac.uk/oxcal3/oper_an.htm#options_file) helps reduce the nonsense, but I'm still not getting any calibrations.

Christopher, do you have any advice?

Has anyone else got this working?


Best wishes

Andrew
--
 Dr. Andrew Millard                       A.R.M...@durham.ac.uk  
 Durham University
 Senior Lecturer in Archaeology              Tel: +44 191 334 1147
 Archaeology:      http://www.dur.ac.uk/archaeology/       
Personal webpage: http://www.dur.ac.uk/a.r.millard/


Christopher Ramsey

unread,
Mar 8, 2012, 5:10:48 AM3/8/12
to ox...@googlegroups.com
Andrew

I suggest that you run from another directory rather than in the binary directory (which you should leave as it is because files other than the exe are needed to run) as otherwise all the files get mixed up.

Essentially all you should have to do is to call the exe file with the input file as an argument. The program will output two files with the same name as the input (.oxcal) file: one file with the .js suffix has full information in javascript format and can be opened by the OxCal front end; the .txt file produces is a tab delimited list of ranges (depending on analysis options). These files will be in the same directory as the .oxcal file. The terminal output can be piped to another file - in the GUI version it is piped to the .log file - so you can see what that output should look like. I'm not sure what will happen if you pipe to the .txt file as then that is being used for two things - may just mix them up of may not work at all.

It is probably easiest to set up all options etc in the .oxcal file - which you can do first using the GUI version and then just modify it as you need.

All versions of OxCal (the server version and the downloadable one) all just use the command line version in the background so it should work just fine.

Christopher

> --
> You received this message because you are subscribed to the Google Groups "OxCal" group.
> To post to this group, send an email to ox...@googlegroups.com.
> To unsubscribe from this group, send email to oxcal+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/oxcal?hl=en-GB.
>

MILLARD A.R.

unread,
Mar 12, 2012, 6:46:37 AM3/12/12
to ox...@googlegroups.com
Thank you Christopher,

I now have the set up I wanted. I simulate a dating scenario using R, create an .oxcal file with the options and simulated dates in it, and then call OxCal to do the analysis.


Best wishes

Andrew
--
 Dr. Andrew Millard                       A.R.M...@durham.ac.uk  
 Durham University
 Senior Lecturer in Archaeology              Tel: +44 191 334 1147
 Archaeology:      http://www.dur.ac.uk/archaeology/       
Personal webpage: http://www.dur.ac.uk/a.r.millard/

Reply all
Reply to author
Forward
0 new messages