User Tools

Site Tools


private:thesimeoarchimed1scripttutorial

The Simeo / MMR-Archimed1 (may 2012) script tutorial

It is possible to send directly an ops file to the MMR-Archimed1 library for radiative balance through a dedicated script. See the Archimed1 documentation for further details.

This documentation is related to the Simeo / MMR-Archimed1 (may 2012) tutorial: it does the same processing without any user interaction (no graphical user interface).

How does it work ?

This script is a Simeo java script. Here is how it works :

  • starts an Edito project (Simeo Scene Editor) in overwrite mode
  • loads the given opf file in Edito
  • configures the Archimed1Export plugin with a given configuration file (see below)
  • launches the Export

The export works mainly like in interactive mode, with the configuration file replacing the dialog box. All parameters are set in the export tool, then MMR-Archimed1 is started.

Note: this script makes it possible to use one single radiative model (in the configuration file). This radiative model is assigned to all nodes having a 3D mesh connected.

The export plugin overwrites the opf files of the edito scene. Edito being in overwrite mode, the written opf files are the original ones listed in the ops file.

MMR-Archimed1 (may 2012) configuration file

This configuration file replaces the interactive mode dialog box. An example file is available in data/archimed1/.

Notes regarding the parameters:

  • the format must be respected carefully (blanks, upper / lower case…)
  • a line starting with a '#' is ignored (comment)
  • edgeMin and edgeMax are optional (if not set, the scene bounding box will be used)
  • if provided, edgeMin and edgeMax z coordinate is ignored (they set a rectangle on the ground, the height of the scene bounding box is always kept)
  • blank lines are ignored

Missing parameters are detected (does not concern the optional ones, see upper).

How can I create an ops file ?

An ops file can be created with Simeo. See the basic tutorial to create a scene in Simeo-Edito.

Once the scene created, use the Project > Export > Opf file command. Choose a directory and a name for the ops file and validate.

An example of ops file, a scene with two trees:

# Simeo OpsFormatExport: Tue Oct 09 14:21:42 CEST 2012

# Part 1: one line per plant in the scene
#sceneId	plantId	plantFileName	x	y	z	scale	inclinationAzimuth	inclinationAngle	stemTwist
1	1	opf/scene0/p1-mod_Rauh_14.opf	18.122968665257712	29.974561697513973	0.0	1.0	0.0	0.0	0.0
1	2	opf/scene0/p2-mod_Rauh_14.opf	26.258857818126845	23.41135796050169	0.0	1.0	0.0	0.0	0.0

# Part 2 (optional), chaining: only if scenario or project, one line per sceneId in part1
#motherId	sceneId	date
-1	1	0

How do I launch the script ?

In a terminal, from the amapstudio install directory, type the following command (Linux example). The ops and MMR-Archimed1 configuration file names should be adapted.

sh simeo.sh -p script jeeb.simeo.module.simeoeditor.scripts.ScriptTristan2012 tmp/francois/francois.ops tmp/francois/archimed1.config

Note: It is possible to tune the memory that Simeo will be able to require from the operating system during the script execution, see the FAQ, section 3.2 I need more memory for my simulations, how can I do ?

Results

An example of output:

64 bits architecture - max memory: 7000 mega bytes
Simeo root directory: /home/coligny/workspace/amapstudio
Simeo 0.9, (c) 2006-2011 F. de Coligny et al.
This program comes with ABSOLUTELY NO WARRANTY;
This is free software, and you are welcome to redistribute it
under certain conditions; See COPYING and COPYING.LESSER for details.

Simeo 0.9-3769 with pilot capsis.script.Pilot: correct boot at 9 Oct 2012 17:11:36 CEST

Launching script jeeb.simeo.module.simeoeditor.scripts.ScriptTristan2012...
ScriptTristan2012...
opsFileName            : tmp/francois/francois.ops
archimed1ConfigFileName: tmp/francois/archimed1.config
Loading scene... 
-> Edito will work in *overwrite mode* (overwrite original files, no copies to automatic directories)
Edito directories:
  a_simeoProjects: /home/coligny/workspace/amapstudio/tmp/francois
  r_projectDir   : .
  r_userSceneDir : opf/scene0
Initialisation termin�e
Memorizer capsis.extension.memorizer.DefaultMemorizer was correctly set for project Project_..p
Checking first mockup...
  Mockup id: 2
  Mockup a_filePath_0: /home/coligny/workspace/amapstudio/tmp/francois/opf/scene0/p2-mod_Rauh_14.opf
  Mockup   fileName_0: p2-mod_Rauh_14.opf
  Mockup a_filePath_1: /home/coligny/workspace/amapstudio/tmp/francois/opf/scene0/p2-mod_Rauh_14.opf
  Mockup r_filePath_1: opf/scene0/p2-mod_Rauh_14.opf
  Mockup   fileName_1: p2-mod_Rauh_14.opf
  Mockup r_sceneDir  : opf/scene0
  Mockup opf: /home/coligny/workspace/amapstudio/tmp/francois/opf/scene0/p2-mod_Rauh_14.opf
  Mockup file: /home/coligny/workspace/amapstudio/tmp/francois/opf/scene0/p2-mod_Rauh_14.opf
Archimed1ExportScript starting...
configFileName: tmp/francois/archimed1.config
#mockups      : 2
Archimed1ExportConfigReader found 8 parameters in tmp/francois/archimed1.config
record: radiativeModel = TranslucentModel:0
record: yToNorthAngle_CW_deg = 45
record: latitude_deg = 45
record: clearness = 0.5
record: time1 = 2012/1/1
record: time2 = 2012/31/24
record: numberOfPixels = 25000
record: toriticyEnabled = true
Loading /home/coligny/workspace/amapstudio/tmp/francois/opf/scene0/p2-mod_Rauh_14.opf...
Loading /home/coligny/workspace/amapstudio/tmp/francois/opf/scene0/p2-mod_Rauh_14.opf...
Loading /home/coligny/workspace/amapstudio/tmp/francois/opf/scene0/p2-mod_Rauh_14.opf done
Loading /home/coligny/workspace/amapstudio/tmp/francois/opf/scene0/p1-mod_Rauh_14.opf...
Loading /home/coligny/workspace/amapstudio/tmp/francois/opf/scene0/p1-mod_Rauh_14.opf...
Loading /home/coligny/workspace/amapstudio/tmp/francois/opf/scene0/p1-mod_Rauh_14.opf done
#nodes        : 59220
Archimed1Export...
yToNorthAngle_CW_rad: 0.7853981852531433
edgeMin:   null
edgeMax:   null
latitude_rad:  0.7853982
clearness:     0.5
time1:         y: 2012	doy: 1	1h0
time2:         y: 2012	doy: 31	24h0
numberOfPixels:  25000
toriticyEnabled: true
withImages:      false

Scene
#nodes: 59220
bbox: BoundingBox (12.302637, 17.878384, 0.0) (31.458788, 34.635, 11.9)
IncidentRadiation:
Global (MJ): 68.29501
Direct (MJ): 24.586203
Diffuse (MJ): 43.708817
MirLauncher
pixelSize: 0.11331235524340313
xTableSize: 169
yTableSize: 147
withImages: false
MIR [0]
MIR [1]
MIR [2]
MIR [3]
MIR [4]
MIR [5]
MIR [6]
MIR [7]
MIR [8]
MIR [9]
MIR [10]
MIR [11]
MIR [12]
MIR [13]
MIR [14]
MIR [15]
MIR [16]
MIR [17]
MIR [18]
MIR [19]
MIR [20]
MIR [21]
MIR [22]
MIR [23]
MIR [24]
MIR [25]
MIR [26]
MIR [27]
MIR [28]
MIR [29]
MIR [30]
MIR [31]
MIR [32]
MIR [33]
MIR [34]
MIR [35]
MIR [36]
MIR [37]
MIR [38]
MIR [39]
MIR [40]
MIR [41]
MIR [42]
MIR [43]
MIR [44]
MIR [45]
Updating attributes for plant 1...
Color gradient: min irradiance_MJ_m2 (ignoring 5.0% lowest values) : 0.0
Color gradient: max irradiance_MJ_m2 (ignoring 5.0% highest values): 37.544704
Saving plant 1...
Updating attributes for plant 2...
Color gradient: min irradiance_MJ_m2 (ignoring 5.0% lowest values) : 0.0
Color gradient: max irradiance_MJ_m2 (ignoring 5.0% highest values): 38.322273
Saving plant 2...
Archimed1ExportScript completed
ScriptTristan2012 is over

Reloading the original ops file into Simeo in interactive mode:

private/thesimeoarchimed1scripttutorial.txt · Last modified: 2021/12/17 09:22 by 127.0.0.1