Skip to content

JSON Save Format

Brian Kloppenborg edited this page Jun 26, 2015 · 3 revisions

SIMTOI uses a lightweight text-based data exchange format called JSON for saving models. JSON files are read and written using the json-cpp library.

Here is a sample of the curren JSON save format

{
	"_file_info" : "Save file from the SImulation and Modeling Tool for Optical Interferometry (SIMTOI). See https://github.com/bkloppenborg/simtoi for information about this format.",
	"area_height" : 128,
	"area_scale" : 0.05,
	"area_width" : 128,
	"model_0" : 
	{
		"base_data" : 
		{
			"T_eff" : [ 5000, 2000, 1000000, false, 100, 0 ],
			"diameter" : [ 1, 0, 1, true, 0.05, 2 ],
			"inclination" : [ 0, -180, 180, false, 1, 2 ],
			"position_angle" : [ 0, 0, 360, false, 0.1, 2 ],
			"z_axis_rotation" : [ 0, 0, 360, false, 1, 2 ],
			"z_axis_rotational_period" : [ 0, 0, 100, false, 1, 4 ]
		},
		"base_id" : "sphere",
		"position_data" : 
		{
			"E" : [ 0, -1, 1, false, 0.1, 2 ],
			"N" : [ 0, -1, 1, false, 0.1, 2 ]
		},
		"position_id" : "xy",
		"shader_data" : null,
		"shader_id" : "default"
	}
}

Each parameter line has the following format:

"parameter": [value, lower_bound, upper_bound, is_free, step_size, decimal_places]