Commit 0ff398c2 authored by Cyrille Poncelet's avatar Cyrille Poncelet
Browse files

Review for XSF model, update converter and model

# Conflicts:
#	sources/xsf.generator/Environment.json
#	sources/xsf.generator/Sonar.json
parent a4175b0c
......@@ -341,9 +341,12 @@
}
]
},
{
"name": "temperature_indicative",
"name": "temperature",
"obligation": "O",
"comment": "sea water temperature",
"dims": [
......@@ -371,7 +374,35 @@
]
},
{
"name": "salinity_indicative",
"name": "temperature",
"obligation": "O",
"comment": "sea water temperature",
"dims": [
"profile",
"sampleCount"
],
"type": "float",
"attributes": [
{
"name": "standard_name",
"value": "sea_water_temperature"
},
{
"name": "units",
"value": "degree_Celsius"
},
{
"name": "_FillValue",
"value": "0.0f"
},
{
"name": "long_name",
"value": "Indicative sea water temperature, For a Sound velocity profile , this will be set to 0.00"
}
]
},
{
"name": "salinity",
"comment": "Salinity of water at given depth,For a Sound velocity profile , this will be set to 0.00",
"dims": [
"profile",
......@@ -392,6 +423,36 @@
"value": "0.0f"
}
]
},
{
"name": "absorption",
"comment": "Absorption values",
"dims": [
"profile",
"sampleCount"
],
"type": "float",
"attributes": [
{
"name": "long_name",
"value": "Acoustic absorption"
},
{
"name": "units",
"value": "dB/m"
},
{
"name": "valid_min",
"value": "0.0",
"type": "float"
},
{
"name": "_FillValue",
"value": "Float.NaN",
"type": "float"
}
]
}
],
"coordinatevariables": [],
......
......@@ -816,6 +816,31 @@
}
]
},
{
"name": "detected_bottom_range",
"obligation": "O",
"comment": "Range from the transducer face where the bottom detection criteria were encountered for the amplitude or the phase of the backscattered echoes. The range of the bottom at index bottom_index with a monostatic transducer and if a constant sound speed is applied is given by detected_bottom_range= sound_speed_at_transducer*(blanking_interval+bottom_index*sample_interval - sample_time_offset)/2.",
"dims": [
"ping_time",
"beam"
],
"type": "float",
"attributes": [
{
"name": "long_name",
"value": "Detected range of the bottom"
},
{
"name": "units",
"value": "m"
},
{
"name": "valid_min",
"value": "0.0"
}
]
},
{
"name": "time_varied_gain",
"obligation": "MA",
......@@ -1150,6 +1175,46 @@
}
]
},
{
"name": "transmit_transducer_index",
"obligation": "MA",
"comment": "Transmitting or monostatic transducer index associated with the given receiving beam",
"dims": [
"ping_time",
"beam"
],
"type": "int",
"attributes": [
{
"name": "valid_min",
"value": "0"
},
{
"name": "long_name",
"value": "Transmit transducer index"
}
]
},
{
"name": "transmit_beam_index",
"obligation": "MA",
"comment": "Transmit beam index associated with the given beam",
"dims": [
"ping_time",
"beam"
],
"type": "int",
"attributes": [
{
"name": "valid_min",
"value": "0"
},
{
"name": "long_name",
"value": "Transmit beam index associated with the given beam"
}
]
},
{
"name": "active_MRU",
"obligation": "MA",
......@@ -1500,27 +1565,7 @@
"value": "Float.NaN",
"type": "float"
}
]
},
{
"name": "beam_detection_range",
"obligation": "0",
"comment": "approximation for the main bottom detection range in sample",
"dims": [
"ping_time",
"beam"
],
"type": "float",
"attributes": [
{
"name": "long_name",
"value": "approximation of main bottom detection range in sample"
},
{
"name": "valid_min",
"value": "0"
}
]
]
}
],
"coordinatevariables": [
......@@ -3948,6 +3993,26 @@
}
]
},
{
"name": "raw_receive_transducer_index",
"obligation": "MA",
"comment": "Raw Receiving or monostatic transducer index associated with the given beam as given in Kmall datagraù",
"dims": [
"ping_time",
"beam"
],
"type": "int",
"attributes": [
{
"name": "valid_min",
"value": "0"
},
{
"name": "long_name",
"value": "Raw Receive transducer index (from datagram)"
}
]
},
{
"name": "raw_rx_beam_pointing_angle",
"comment": "The receiver beam pointing angle as given by the constructor. Match BeamPointingAngle of Water column datagram for all files and BeamPointAngReVertical_deg for kmall files ",
......@@ -3988,6 +4053,26 @@
}
]
},
{
"name": "beam_detection_range",
"obligation": "0",
"comment": "approximation for the main bottom detection range in sample",
"dims": [
"ping_time",
"beam"
],
"type": "float",
"attributes": [
{
"name": "long_name",
"value": "approximation of main bottom detection range in sample"
},
{
"name": "valid_min",
"value": "0"
}
]
},
{
"name": "beam_horizontal_direction_angle",
"comment": "The receiver beam steering angle (relative to nadir) applied in the across-track direction (varies according to beam number). Typically -75 to +75 degrees. In equidistant mode, this will not change. In equiangular mode, steering angles will vary.",
......@@ -4646,7 +4731,7 @@
"comment": "The bathymetry group contains information about sonar detection and data specific to bathmetry sonars",
"dims": [
{
"javaValue": "dataProxy.getBathyBeamCount()",
"javaValue": "dataProxy.getDetectionCount()",
"name": "detection",
"comment": "The maximum number of main soundings detection in this group per swath."
}
......
......@@ -338,13 +338,13 @@ public class SCGroupAdapter {
if(is_sensor_associated)
{
sourceCode.add(String.format("\n%sdef create_group(self, group: nc.Dataset, ident=None):", localIdent));
sourceCode.add(String.format("%s%sg = group.createGroup(self.get_group_path(ident))", localIdent, pythonIndent));
sourceCode.add(String.format("\n%sdef create_group(self, parent_group: nc.Dataset, ident):", localIdent));
sourceCode.add(String.format("%s%sg = parent_group.createGroup(ident)", localIdent, pythonIndent));
}
else
{
sourceCode.add(String.format("\n%sdef create_group(self, group: nc.Dataset):", localIdent));
sourceCode.add(String.format("%s%sg = group.createGroup(self.get_group_path())", localIdent, pythonIndent));
sourceCode.add(String.format("\n%sdef create_group(self, parent_group: nc.Dataset):", localIdent));
sourceCode.add(String.format("%s%sg = parent_group.createGroup(self.get_group_path())", localIdent, pythonIndent));
}
for(Type type:group.getTypes())
......@@ -370,7 +370,7 @@ public class SCGroupAdapter {
}
dictionary+="}";
sourceCode.add(String.format("%s%s%s", localIdent, pythonIndent,dictionary));
sourceCode.add(String.format("%s%stype_e = group.createEnumType(np.uint8, '%s', enum_dict)", localIdent, pythonIndent,name));
sourceCode.add(String.format("%s%stype_e = g.createEnumType(np.uint8, '%s', enum_dict)", localIdent, pythonIndent,name));
sourceCode.add(String.format("%s%stypes['%s'] = type_e", localIdent, pythonIndent,name));
}else if (type.getName().contains("*"))
{
......@@ -526,12 +526,16 @@ public class SCGroupAdapter {
for(Attribute att: v.attributes)
{
if (att.getName()== "_FillValue" )
if (att.getName().compareTo("_FillValue")==0 )
{
has_fill_value=true;
fill_value=att.getValue();
if(fill_value.contains("NaN"))
fill_value="np.nan";
if(fill_value.endsWith("f") && datatype.compareTo("str")!=0)
{
fill_value=fill_value.replace("f", "");
}
}
}
String dimensions="";
......@@ -553,7 +557,7 @@ public class SCGroupAdapter {
for(Attribute att: v.attributes)
{
if (att.getName()!= "_FillValue")
if (att.getName().compareTo("_FillValue")!=0)
writeAttribute(sourceCode,att,localIdent, "v");
}
......
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