Skip to content
Snippets Groups Projects
Commit 0ea430f9 authored by Robert Butora's avatar Robert Butora
Browse files

updates new vlkb-volib: shape changed to enum

parent cda67320
No related branches found
No related tags found
No related merge requests found
...@@ -85,8 +85,8 @@ class CutoutImpl implements Cutout ...@@ -85,8 +85,8 @@ class CutoutImpl implements Cutout
if(band != null) if(band != null)
{ {
String specSystem = band.system.name(); String specSystem = band.system.name();
double vl = band.wavelength[0]; double vl = band.getMin();
double vu = band.wavelength[1]; double vu = band.getMax();
region =region + "specsystem=" + specSystem + "&vl=" + String.valueOf(vl) + "&vu=" + String.valueOf(vu); region =region + "specsystem=" + specSystem + "&vl=" + String.valueOf(vl) + "&vu=" + String.valueOf(vu);
} }
......
...@@ -57,7 +57,8 @@ public class JsonEncoder ...@@ -57,7 +57,8 @@ public class JsonEncoder
j.put("system", band.system.toString()); j.put("system", band.system.toString());
JSONArray arr = new JSONArray(); JSONArray arr = new JSONArray();
for(double dbl : band.wavelength) arr.add(dbl); arr.add(band.getMin());
arr.add(band.getMax());
j.put("interval",arr); j.put("interval",arr);
this.obj.put("band", j); this.obj.put("band", j);
...@@ -73,7 +74,8 @@ public class JsonEncoder ...@@ -73,7 +74,8 @@ public class JsonEncoder
j.put("system", time.system.toString()); j.put("system", time.system.toString());
JSONArray arr = new JSONArray(); JSONArray arr = new JSONArray();
for(double dbl : time.mjdUtc) arr.add(dbl); arr.add(time.getMin());
arr.add(time.getMax());
j.put("interval",arr); j.put("interval",arr);
this.obj.put("time", j); this.obj.put("time", j);
......
...@@ -86,15 +86,17 @@ public class JsonEncoderMerge ...@@ -86,15 +86,17 @@ public class JsonEncoderMerge
private static JSONArray arrJBand(Band band) private static JSONArray arrJBand(Band band)
{ {
JSONArray arr = new JSONArray(); JSONArray arr = new JSONArray();
for(double dbl : band.wavelength) arr.add(dbl); arr.add(band.getMin());
arr.add(band.getMax());
return arr; return arr;
} }
private static JSONArray genTimeJsonArr(Time time) private static JSONArray genTimeJsonArr(Time time)
{ {
JSONArray jarr = new JSONArray(); JSONArray arr = new JSONArray();
for(double dbl : time.mjdUtc) jarr.add(dbl); arr.add(time.getMin());
return jarr; arr.add(time.getMax());
return arr;
} }
private static JSONArray genPolyLonJsonArr(Polygon polygon) private static JSONArray genPolyLonJsonArr(Polygon polygon)
......
...@@ -105,9 +105,9 @@ public class ServletCutout extends javax.servlet.http.HttpServlet ...@@ -105,9 +105,9 @@ public class ServletCutout extends javax.servlet.http.HttpServlet
Resolver rsl = new ResolverFromId(); Resolver rsl = new ResolverFromId();
rsl.resolve(id); rsl.resolve(id);
// if(pos != null) pos.setSystem(Pos.System.valueOf(DEFAULT_SKY_SYSTEM)); // if(pos != null) pos.setSystem(DEFAULT_SKY_SYSTEM);
if(band != null) band.setSystem(Band.System.valueOf(DEFAULT_SPEC_SYSTEM)); if(band != null) band.setSystem(DEFAULT_SPEC_SYSTEM);
if(time != null) time.setSystem(Time.System.valueOf(DEFAULT_TIME_SYSTEM)); if(time != null) time.setSystem(DEFAULT_TIME_SYSTEM);
cutout.doStream(rsl.relPathname(), rsl.hdunum(), pos, band, time, pol, respOutputStream); cutout.doStream(rsl.relPathname(), rsl.hdunum(), pos, band, time, pol, respOutputStream);
} }
...@@ -153,9 +153,9 @@ public class ServletCutout extends javax.servlet.http.HttpServlet ...@@ -153,9 +153,9 @@ public class ServletCutout extends javax.servlet.http.HttpServlet
final String DEFAULT_TIME_SYSTEM = "MJD_UTC"; // FIXME take from confif file final String DEFAULT_TIME_SYSTEM = "MJD_UTC"; // FIXME take from confif file
if(pos != null) pos.setSystem(Pos.System.valueOf(DEFAULT_SKY_SYSTEM)); if(pos != null) pos.setSystem(DEFAULT_SKY_SYSTEM);
if(band != null) band.setSystem(Band.System.valueOf(DEFAULT_SPEC_SYSTEM)); if(band != null) band.setSystem(DEFAULT_SPEC_SYSTEM);
if(time != null) time.setSystem(Time.System.valueOf(DEFAULT_TIME_SYSTEM)); if(time != null) time.setSystem(DEFAULT_TIME_SYSTEM);
CutResult cutResult = cutout.doFile(relPathname, hdunum, pos, band, time, pol, false, null); CutResult cutResult = cutout.doFile(relPathname, hdunum, pos, band, time, pol, false, null);
......
...@@ -84,8 +84,8 @@ public final class XmlSerializer ...@@ -84,8 +84,8 @@ public final class XmlSerializer
if(coord.band != null) if(coord.band != null)
{ {
xml.append("<vl>" + String.valueOf(coord.band.wavelength[0]) +"</vl>"); xml.append("<vl>" + String.valueOf(coord.band.getMin()) +"</vl>");
xml.append("<vu>" + String.valueOf(coord.band.wavelength[1]) +"</vu>"); xml.append("<vu>" + String.valueOf(coord.band.getMax()) +"</vu>");
xml.append("<vtype>" + coord.specSystem + "</vtype>"); xml.append("<vtype>" + coord.specSystem + "</vtype>");
} }
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment