Commit e988a40f authored by Miguel Tremblay's avatar Miguel Tremblay
Browse files

Subsurface temperature can be between 0.01 m and 1.4 m

parent 4c6fae37
......@@ -125,17 +125,23 @@ class Metro_data_station(Metro_data):
"""
Get the sensor SST depth value
Return 0.4 if value in station config file is not between 0.2 and 0.6 and if no flag '--use-sst-sensor-depth' is used. Else returns value provided for sensor SST depth in station config file.
Return 0.4 if no flag '--use-sst-sensor-depth' is used.
Else returns value provided for sensor SST depth in station config file,
provided that it is included in METRo grid, ie. [0.01,1.4] m.
See METRo documentation page for more details:
http://documentation.wikia.com/wiki/Vertical_levels_(METRo)
"""
if metro_config.get_value('SST_DEPTH') == False:
return 0.4
else:
dStation_header = self.get_header()
sStation_sst_depth = dStation_header['SST_DEPTH']
if sStation_sst_depth == "None" or sStation_sst_depth > 0.6 or sStation_sst_depth < 0.2:
sMessage = _("Sensor SST depth value in station config file is not between 0.2 and 0.6. Value 0.4 for sensor SST depth will be used.")
metro_logger.print_message(metro_logger.LOGGER_MSG_CRITICAL,\
sMessage)
return 0.4
fStation_sst_depth = dStation_header['SST_DEPTH']
if fStation_sst_depth == "None" \
or fStation_sst_depth > 1.4 \
or fStation_sst_depth < 0.01:
sMessage = _("Sensor SST depth value in station config file is not between 0.01 m and 1.4 m. Given value: '%s' m.") \
% fStation_sst_depth
metro_logger.print_message(metro_logger.LOGGER_MSG_STOP,\
sMessage)
else:
return sStation_sst_depth
return fStation_sst_depth
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment