From GridLAB-D Wiki
Jump to: navigation, search

sanitize - Command option to sanitize models


host% gridlabd model_name.glm --sanitize


The sanitizing process destroys the name and position data of objects in a GLM file. This can be used to protect sensitive data is models.

Object names are obfuscated by generating a unique hexadecimal number and appending it to the sanitize_prefix string.

Object positions are obfuscated by moving the latitude by +/-5 degrees and the longtitude by +/-180 degrees.

When the process runs, an index file can be output to allow future recovery of the names and positions, if desired.

The follow global variables can be used to control the sanitizing process.

Specifies the sanitizing options. The current valid options are NAMES and POSITIONS. The default is to sanitize both names and positions.
Specifies the name of the sanitizing index file. If the index is ".xml" or ".txt", then "-index.xml" or "-index.txt" will be appended to the base model name (the ".glm" is truncated). Only XML and TXT file types are recognized. The default index file is "modelname-index.txt".
Specifies the lat/lon offset to use when changing the position of objects. Offsets are specified as either lat,lon or lat/lon where lat and lon are decimal values in the range ±90 and ±180, respectively. If the offset is blank, a random value in the range ±5 and ±180, respectively, is used. If the offset is destroy all the latitude and longitude information found in objects is completely erased. The erased values cannot be recovered from the index file.
Specifies the prefix to use on names. The default is "GLD_". Prefixes are strongly recommended because the obfuscated names can begin with a digit, which is not allowed in GridLAB-D unless relax_naming_rules is used.


The following example sanitizes the GLM file sensitive.glm and outputs an index file sensitive-index.txt

host% gridlabd sensitive.glm --sanitize

The following example only sanitized the object names and outputs the index file as an XML file named index.xml:

host% gridlabd sensitive.glm -D sanitize=NAMES -D sanitize_index=index.xml --sanitize


Coordinates above +85N latitude or below -85S latitude may be corrupted irretrievably because positions can be moved by as much as ±5 degrees, go above or below ±90 and get truncated.

See also