Merge "Issue #1962 Allow Viirs Decoder to accept numeric missing values." into omaha_13.4.1
Former-commit-id:0cd2fe1b01
[formerly6d0e867afd
] [formerlyb5c86153d3
] [formerly85bb98e13e
[formerlyb5c86153d3
[formerly 80a023582f55b076cfbb27e260ed357c35d68ad7]]] Former-commit-id:85bb98e13e
Former-commit-id: 3b0cb62239e00e07c4e408b70806ff0e510d2e09 [formerlye851193480
] Former-commit-id:9e0167500e
This commit is contained in:
commit
1112ec62fe
1 changed files with 23 additions and 6 deletions
|
@ -62,6 +62,8 @@ import com.vividsolutions.jts.geom.GeometryFactory;
|
|||
* Dec 1, 2011 mschenke Initial creation
|
||||
* Feb 21, 2012 #30 mschenke Changed VIIRS decoder to read time attribute out of record
|
||||
* instead of using WMO header
|
||||
* May 01, 2013 1962 bsteffen Allow Viirs Decoder to accept numeric
|
||||
* missing values.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -236,12 +238,27 @@ public class VIIRSDecoder extends AbstractNPPDecoder {
|
|||
|
||||
for (Attribute attr : var.getAttributes()) {
|
||||
if (MISSING_VALUE_ID.equals(attr.getName())) {
|
||||
String missing = attr.getStringValue();
|
||||
String[] split = missing
|
||||
.split(MISSING_VALUE_SPLIT_STRING);
|
||||
missingValues = new float[split.length];
|
||||
for (int i = 0; i < split.length; ++i) {
|
||||
missingValues[i] = Float.parseFloat(split[i]);
|
||||
if (attr.getDataType().isString()) {
|
||||
String missing = attr.getStringValue();
|
||||
String[] split = missing
|
||||
.split(MISSING_VALUE_SPLIT_STRING);
|
||||
missingValues = new float[split.length];
|
||||
for (int i = 0; i < split.length; ++i) {
|
||||
missingValues[i] = Float
|
||||
.parseFloat(split[i]);
|
||||
}
|
||||
} else if(attr.getDataType().isNumeric()){
|
||||
if(attr.isArray()){
|
||||
missingValues = new float[attr.getLength()];
|
||||
for (int i = 0; i < missingValues.length; i += 1) {
|
||||
missingValues[i] = attr
|
||||
.getNumericValue(i)
|
||||
.floatValue();
|
||||
}
|
||||
}else{
|
||||
missingValues = new float[] { attr
|
||||
.getNumericValue().floatValue() };
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue