Command line running (Linux)

From PlanarRad
Revision as of 19:54, 7 January 2015 by John (talk | contribs)
Jump to navigation Jump to search

PlanarRad can be run from the command line without opening the GUI window, the run parameters are specified in a simple text file. The executable for command line running is called 'slabtool_free', and if the parameters are saved in the file 'params.txt' then under Linux it is run like this:

slabtool_free params=params.txt

Assuming 'slabtool_free' is in your path. Note there are no spaces around the '='.

The GUI version of PlanarRad automatically builds files for: 1) sky radiance distribution; 2) the air-water interface; and 3) the phase function, as determined from the settings. However, the command line version requires these files to be pre-built and the paths to them are specified in the input text file. The easiest way to build these files is to run the GUI version of PlanarRad with required settings and the files can be found in the output directory.

For example, following the example here: BRDF of a material with isotropic phase function, gives rise to these files:

iface_rdd_HL18x24_1 
input_rd_HL18x24_1
pf_rdd_HL18x24_1

Which are binary files that tabulate the air-water interface, sky radiance and phase function as used in that run.

To perform the same model run as described on the page BRDF of a material with isotropic phase function from the command line copy these three files to a new directory together with the band specification 'bands1.bsf' described on that page. Then create a file 'params.txt' to look like this:

name = test1

band_spec_fp = bands1.bsf

partition = sphere
vn = 18
hn = 24
theta_points = 0,5,15,25,35,45,55,65,75,85,90,95,105,115,125,135,145,155,165,175,180

depth = 20
sample_point_distance = 1
sample_point_delta_distance = 0.01

sky_fp = input_rd_HL18x24_1

water_surface_fp = iface_rdd_HL18x24_1 

pf_fp = pf_rdd_HL18x24_1

atten_data = 0.3
absorp_data = 0.2

bottom_reflec_diffuse_data = 0

report_save_fp = report.txt

verbose = 6

And then to run, 'cd' to that directory and type:

slabtool_free params=params.txt

After the model has finished running the file 'report.txt' will have been created in the directory, and should be the same as the report file produced by the GUI run described on the page BRDF of a material with isotropic phase function.

The most efficient way to use this system is to pre-build a set of sky radiances, interface functions and phase functions. A script can then invoke multiple runs combining these in any combination, together with attenuation, absorption, depth and bottom boundary reflectance, by producing a 'params.txt' file with the correct filenames and values in it.