Issue #2454 Ice model, general ensemble model troubles, null cycle times
Former-commit-id:ba2e1ed3fc
[formerly 5fd82b153d87228037e594c838dc3c445c8874aa] Former-commit-id:94b5bd79f9
This commit is contained in:
parent
173e28b9d9
commit
5ca57c8edd
2 changed files with 20 additions and 7 deletions
|
@ -50,6 +50,7 @@ import com.raytheon.uf.common.status.UFStatus;
|
|||
* Jun 06, 2013 2038 djohnson Remove throws ParseException.
|
||||
* Sept 25, 2013 1797 dhladky separated overrides from time.
|
||||
* Oct 10, 2013 1797 bgonzale Refactored registry Time objects.
|
||||
* Oct 24, 2013 2454 dhladky Trouble with general gridded cycles that don't exist being null instead of empty.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -65,9 +66,6 @@ public class GriddedTime extends Time implements
|
|||
|
||||
private static final long serialVersionUID = -7032078355732493125L;
|
||||
|
||||
private static final IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(GriddedTime.class);
|
||||
|
||||
@XmlElement(name = "step")
|
||||
@DynamicSerializeElement
|
||||
private Double step;
|
||||
|
@ -82,7 +80,7 @@ public class GriddedTime extends Time implements
|
|||
|
||||
@XmlElements({ @XmlElement(name = "cycleTimes", type = Integer.class) })
|
||||
@DynamicSerializeElement
|
||||
private List<Integer> cycleTimes;
|
||||
private List<Integer> cycleTimes = new ArrayList<Integer>();
|
||||
|
||||
/**
|
||||
* Default Constructor.
|
||||
|
|
|
@ -49,6 +49,7 @@ import dods.dap.PrimitiveVector;
|
|||
* Nov 19, 2012 1166 djohnson Clean up JAXB representation of registry objects.
|
||||
* Jan 08, 2013 1466 dhladky NCOM dataset name parsing fix.
|
||||
* Jan 18, 2013 1513 dhladky Level Lookup improvements.
|
||||
* Oct 24, 2013 2454 dhladky NOMADS change to ensemble configuration.
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
|
@ -260,14 +261,28 @@ public final class OpenDAPParseUtility {
|
|||
*/
|
||||
public Ensemble parseEnsemble(AttributeTable table) {
|
||||
|
||||
String sname = serviceConfig.getConstantValue("NAME");
|
||||
Ensemble ens = new Ensemble();
|
||||
|
||||
if (table.getAttribute(sname) != null) {
|
||||
String name = trim(table.getAttribute(sname).getValueAt(0));
|
||||
// Ensemble members used to be listed under the attribute "grads_name".
|
||||
// Somewhere along the way, GRADS/NOMADS stopped doing that to identify it's ensembles.
|
||||
// Both methods are listed, the original and the new as a fall back.
|
||||
|
||||
if (table.getAttribute(serviceConfig.getConstantValue("NAME")) != null) {
|
||||
String name = trim(table.getAttribute(serviceConfig.getConstantValue("NAME")).getValueAt(0));
|
||||
String[] members = COMMA_PATTERN.split(name);
|
||||
ens.setMembers(Arrays.asList(members));
|
||||
} else if (table.getAttribute(serviceConfig.getConstantValue("SIZE")) != null) {
|
||||
int size = Integer.parseInt(trim(table.getAttribute(serviceConfig.getConstantValue("SIZE")).getValueAt(0)));
|
||||
List<String> members = new ArrayList<String>(size);
|
||||
if (size > 0) {
|
||||
for (Integer i = 0; i < size; i++) {
|
||||
members.add(i.toString());
|
||||
}
|
||||
ens.setMembers(members);
|
||||
}
|
||||
// empty default ensemble if no size exists
|
||||
}
|
||||
|
||||
return ens;
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue