Skip to content

Commit

Permalink
null check for missing time axis
Browse files Browse the repository at this point in the history
  • Loading branch information
mnlerman committed Dec 19, 2023
1 parent b468640 commit c751cdc
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ private class CoverageAsStationProfileCollection extends StationProfileCollectio
private VarGroup varGroup;

CoverageAsStationProfileCollection(VarGroup varGroup) {
super(varGroup.name + " AsStationProfileCollection", varGroup.timeAxis.getName(), varGroup.dateUnit,
varGroup.zAxis.getName(), varGroup.zUnit);
super(varGroup.name + " AsStationProfileCollection", varGroup.dateUnit, varGroup.zUnit);
this.timeName = varGroup.timeAxis != null ? varGroup.timeAxis.getName() : "time";
this.altName = varGroup.zAxis != null ? varGroup.zAxis.getName() : "altitude";
this.varGroup = varGroup;
Expand Down Expand Up @@ -310,8 +309,9 @@ public boolean hasNext() throws IOException {
@Override
public PointFeatureCollection next() throws IOException {
double obsTime = this.timeAxis != null ? this.timeAxis.getCoordMidpoint(curr) : 0.0;
String timeName = this.timeAxis != null ? this.timeAxis.getName() : "time";
curr++;
return new CoverageAsProfileFeature(obsTime, varGroup.timeAxis.getName(), varGroup.dateUnit,
return new CoverageAsProfileFeature(obsTime, timeName, varGroup.dateUnit,
varGroup.zAxis.getName(), varGroup.zUnit, getLatitude(), getLongitude(), this.varIters);
}
}
Expand Down

0 comments on commit c751cdc

Please sign in to comment.