Skip to content

Commit

Permalink
spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
mnlerman committed Oct 26, 2023
1 parent 3797e96 commit eedc29e
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ protected DsgCollectionImpl(String name, CalendarDateUnit timeUnit, String altUn
protected DsgCollectionImpl(String name, String timeName, CalendarDateUnit timeUnit, String altName,
String altUnits) {
this.name = name;
//this.timeName = timeName;
// this.timeName = timeName;
this.timeUnit = timeUnit;
//this.altName = altName;
// this.altName = altName;
this.altUnits = altUnits;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,8 @@ record = (Structure) writer.addVariable(null, recordName, DataType.STRUCTURE, re

StructureData obsData = pointFeat.getFeatureData();

Formatter coordNames = new Formatter().format("%s %s %s", pointFeat.getFeatureCollection().getTimeName(), latName, lonName);
Formatter coordNames =
new Formatter().format("%s %s %s", pointFeat.getFeatureCollection().getTimeName(), latName, lonName);
if (!Double.isNaN(pointFeat.getLocation().getAltitude())) {
coordNames.format(" %s", altitudeCoordinateName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ public WriterCFPointCollection(String fileOut, List<Attribute> globalAtts, List<

public void writeHeader(PointFeature pf) throws IOException {
List<VariableSimpleIF> coords = new ArrayList<>();
coords.add(VariableSimpleBuilder.makeScalar(pf.getFeatureCollection().getTimeName(), "time of measurement", timeUnit.getUdUnit(), DataType.DOUBLE)
.addAttribute(CF.CALENDAR, timeUnit.getCalendar().toString()).build());
coords.add(VariableSimpleBuilder.makeScalar(pf.getFeatureCollection().getTimeName(), "time of measurement",
timeUnit.getUdUnit(), DataType.DOUBLE).addAttribute(CF.CALENDAR, timeUnit.getCalendar().toString()).build());

coords.add(
VariableSimpleBuilder.makeScalar(latName, "latitude of measurement", CDM.LAT_UNITS, DataType.DOUBLE).build());
coords.add(
VariableSimpleBuilder.makeScalar(lonName, "longitude of measurement", CDM.LON_UNITS, DataType.DOUBLE).build());
Formatter coordNames = new Formatter().format("%s %s %s", pf.getFeatureCollection().getTimeName(), latName, lonName);
Formatter coordNames =
new Formatter().format("%s %s %s", pf.getFeatureCollection().getTimeName(), latName, lonName);
if (altUnits != null) {
coords.add(VariableSimpleBuilder.makeScalar(altName, "altitude of measurement", altUnits, DataType.DOUBLE)
.addAttribute(CF.POSITIVE, CF1Convention.getZisPositive(altName, altUnits)).build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,16 @@ public void writeHeader(List<StationFeature> stns, StationPointFeature spf) thro
StructureData obsData = spf.getFeatureData();

List<VariableSimpleIF> coords = new ArrayList<>();
coords.add(VariableSimpleBuilder.makeScalar(spf.getFeatureCollection().getTimeName(), "time of measurement", timeUnit.getUdUnit(), DataType.DOUBLE)
.addAttribute(CF.CALENDAR, timeUnit.getCalendar().toString()).build());
coords.add(VariableSimpleBuilder.makeScalar(spf.getFeatureCollection().getTimeName(), "time of measurement",
timeUnit.getUdUnit(), DataType.DOUBLE).addAttribute(CF.CALENDAR, timeUnit.getCalendar().toString()).build());

coords.add(VariableSimpleBuilder
.makeScalar(stationIndexName, "station index for this observation record", null, DataType.INT)
.addAttribute(CF.INSTANCE_DIMENSION, stationDimName).build());


Formatter coordNames = new Formatter().format("%s %s %s", spf.getFeatureCollection().getTimeName(), latName, lonName);
Formatter coordNames =
new Formatter().format("%s %s %s", spf.getFeatureCollection().getTimeName(), latName, lonName);
if (useAlt)
coordNames.format(" %s", stationAltName);

Expand Down Expand Up @@ -233,8 +234,9 @@ public void writeRecord(Station s, PointFeature sobs, StructureData sdata) throw
writeRecord(dsgStation.getName(), dsgStation.getTimeName(), sobs.getObservationTime(),
sobs.getObservationTimeAsCalendarDate(), dsgStation.getAltName(), sobs.getLocation().getAltitude(), sdata);
} else {
writeRecord(s.getName(), sobs.getFeatureCollection().getTimeName(), sobs.getObservationTime(), sobs.getObservationTimeAsCalendarDate(),
this.altitudeCoordinateName, sobs.getLocation().getAltitude(), sdata);
writeRecord(s.getName(), sobs.getFeatureCollection().getTimeName(), sobs.getObservationTime(),
sobs.getObservationTimeAsCalendarDate(), this.altitudeCoordinateName, sobs.getLocation().getAltitude(),
sdata);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,15 @@ public int writeTrajectory(TrajectoryFeature traj) throws IOException {
private void writeHeader(TrajectoryFeature feature, PointFeature obs) throws IOException {
// obs data
List<VariableSimpleIF> coords = new ArrayList<>();
coords.add(VariableSimpleBuilder.makeScalar(obs.getFeatureCollection().getTimeName(), "time of measurement", timeUnit.getUdUnit(), DataType.DOUBLE)
.addAttribute(CF.CALENDAR, timeUnit.getCalendar().toString()).build());
coords.add(VariableSimpleBuilder.makeScalar(obs.getFeatureCollection().getTimeName(), "time of measurement",
timeUnit.getUdUnit(), DataType.DOUBLE).addAttribute(CF.CALENDAR, timeUnit.getCalendar().toString()).build());

coords.add(
VariableSimpleBuilder.makeScalar(latName, "latitude of measurement", CDM.LAT_UNITS, DataType.DOUBLE).build());
coords.add(
VariableSimpleBuilder.makeScalar(lonName, "longitude of measurement", CDM.LON_UNITS, DataType.DOUBLE).build());
Formatter coordNames = new Formatter().format("%s %s %s", obs.getFeatureCollection().getTimeName(), latName, lonName);
Formatter coordNames =
new Formatter().format("%s %s %s", obs.getFeatureCollection().getTimeName(), latName, lonName);
if (altUnits != null) {
coords.add(VariableSimpleBuilder.makeScalar(altName, "altitude of measurement", altUnits, DataType.DOUBLE)
.addAttribute(CF.POSITIVE, CF1Convention.getZisPositive(altName, altUnits)).build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,15 @@ class WriterCFPointCollection extends WriterCFPointAbstract {

void writeHeader(PointFeature pf) throws IOException {
List<VariableSimpleIF> coords = new ArrayList<>();
coords.add(VariableSimpleBuilder.makeScalar(pf.getFeatureCollection().getTimeName(), "time of measurement", timeUnit.getUdUnit(), DataType.DOUBLE)
.addAttribute(CF.CALENDAR, timeUnit.getCalendar().toString()).build());
coords.add(VariableSimpleBuilder.makeScalar(pf.getFeatureCollection().getTimeName(), "time of measurement",
timeUnit.getUdUnit(), DataType.DOUBLE).addAttribute(CF.CALENDAR, timeUnit.getCalendar().toString()).build());

coords.add(
VariableSimpleBuilder.makeScalar(latName, "latitude of measurement", CDM.LAT_UNITS, DataType.DOUBLE).build());
coords.add(
VariableSimpleBuilder.makeScalar(lonName, "longitude of measurement", CDM.LON_UNITS, DataType.DOUBLE).build());
Formatter coordNames = new Formatter().format("%s %s %s", pf.getFeatureCollection().getTimeName(), latName, lonName);
Formatter coordNames =
new Formatter().format("%s %s %s", pf.getFeatureCollection().getTimeName(), latName, lonName);
if (altUnits != null) {
coords.add(VariableSimpleBuilder.makeScalar(altName, "altitude of measurement", altUnits, DataType.DOUBLE)
.addAttribute(CF.POSITIVE, CF1Convention.getZisPositive(altName, altUnits)).build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,15 @@ int writeTrajectory(TrajectoryFeature traj) throws IOException {
private void writeHeader(TrajectoryFeature feature, PointFeature obs) throws IOException {
// obs data
List<VariableSimpleIF> coords = new ArrayList<>();
coords.add(VariableSimpleBuilder.makeScalar(obs.getFeatureCollection().getTimeName(), "time of measurement", timeUnit.getUdUnit(), DataType.DOUBLE)
.addAttribute(CF.CALENDAR, timeUnit.getCalendar().toString()).build());
coords.add(VariableSimpleBuilder.makeScalar(obs.getFeatureCollection().getTimeName(), "time of measurement",
timeUnit.getUdUnit(), DataType.DOUBLE).addAttribute(CF.CALENDAR, timeUnit.getCalendar().toString()).build());

coords.add(
VariableSimpleBuilder.makeScalar(latName, "latitude of measurement", CDM.LAT_UNITS, DataType.DOUBLE).build());
coords.add(
VariableSimpleBuilder.makeScalar(lonName, "longitude of measurement", CDM.LON_UNITS, DataType.DOUBLE).build());
Formatter coordNames = new Formatter().format("%s %s %s", obs.getFeatureCollection().getTimeName(), latName, lonName);
Formatter coordNames =
new Formatter().format("%s %s %s", obs.getFeatureCollection().getTimeName(), latName, lonName);
if (altUnits != null) {
coords.add(VariableSimpleBuilder.makeScalar(altName, "altitude of measurement", altUnits, DataType.DOUBLE)
.addAttribute(CF.POSITIVE, CF1Convention.getZisPositive(altName, altUnits)).build());
Expand Down

0 comments on commit eedc29e

Please sign in to comment.