diff --git a/data-access/engine/src/common/include/ast4vl.hpp b/data-access/engine/src/common/include/ast4vl.hpp index 9961cb59def444b9c377061507b99dcab7084db2..db7542312b93808d205688973be05657cb46c2c1 100644 --- a/data-access/engine/src/common/include/ast4vl.hpp +++ b/data-access/engine/src/common/include/ast4vl.hpp @@ -21,13 +21,6 @@ struct Bounds int naxis; }; -struct uint_bounds -{ - unsigned int pix1; - unsigned int pix2; - unsigned char type; -}; - struct double_xy { double x; diff --git a/data-access/engine/src/common/include/cutout.hpp b/data-access/engine/src/common/include/cutout.hpp index 16670a503e9916cbefde20b5f261c909e735f3f1..0b70c1d890a4aef981d2b2654a7d8f6de95966be 100644 --- a/data-access/engine/src/common/include/cutout.hpp +++ b/data-access/engine/src/common/include/cutout.hpp @@ -12,6 +12,14 @@ enum class specsystem {NONE, VELO_LSRK, WAVE_Barycentric}; enum class timesystem {NONE, MJD_UTC}; +struct uint_bounds +{ + unsigned int pix1; + unsigned int pix2; + unsigned char type; +}; + + /* SODA */ struct circle @@ -82,11 +90,13 @@ struct coordinates double time_value[2]; // time interval (MJD in UTC) std::vector<std::string> pol; // polarization states FIXME pol should be Set<enums> + + std::vector<uint_bounds> pixel_i; // PIXEL_i for non-standard axes allow direct cut without WCS }; coordinates parse_coordinates(const std::string region_string); coordinates to_coordinates(const position pos, const band bnd, const time_axis time, - const std::vector<std::string> pol); + const std::vector<std::string> pol, const std::vector<uint_bounds> pixel_i); /* cutout */ diff --git a/data-access/engine/src/common/include/cutout_nljson.hpp b/data-access/engine/src/common/include/cutout_nljson.hpp index 4a86e42b6a6a16d59b37718fa6ff3725c6db685d..572a2818ae75d13e973afdfa9c14233e89baf1c8 100644 --- a/data-access/engine/src/common/include/cutout_nljson.hpp +++ b/data-access/engine/src/common/include/cutout_nljson.hpp @@ -15,6 +15,8 @@ void to_json(json& j, const cutout_res_s& p); void to_json(json& j, const fits_card& p); void from_json(const json& j, fits_card& p); +void from_json(const json& j, uint_bounds& p); + void to_json(json& j, const coordinates& p); void from_json(const json& j, coordinates& p); diff --git a/data-access/engine/src/common/src/cutout.cpp b/data-access/engine/src/common/src/cutout.cpp index cb1eea55cf81c75dc4c634d6552bd97b78950f1e..f32256d90a1b32caf33c0011c61e4f0c20ca2fa5 100644 --- a/data-access/engine/src/common/src/cutout.cpp +++ b/data-access/engine/src/common/src/cutout.cpp @@ -177,6 +177,7 @@ string axistype2string(unsigned char cc) case 'b': return "BAND"; break; case 't': return "TIME"; break; case 'p': return "POL"; break; + case 'x': return "PIXEL_i"; break; case ' ': return "UNKNOWN"; break; default: throw invalid_argument(cc + " is not a valid axis type"); @@ -207,7 +208,7 @@ coordinates parse_coordinates(const string region_string) LOG_trace(string(__func__) + " : " + region_string); json_region reg(region_string); - coordinates coord = to_coordinates(reg.get_pos(), reg.get_band(), reg.get_time(), reg.get_pol()); + coordinates coord = to_coordinates(reg.get_pos(), reg.get_band(), reg.get_time(), reg.get_pol(), reg.get_pixel_i()); LOG_STREAM << "coord parsed: " << coord << endl; @@ -215,7 +216,8 @@ coordinates parse_coordinates(const string region_string) } -coordinates to_coordinates(const position pos, const band bnd, const time_axis time, const std::vector<std::string> pol) +coordinates to_coordinates(const position pos, const band bnd, const time_axis time, + const std::vector<std::string> pol, const std::vector<uint_bounds> pixel_i) { coordinates coord; coord.skysys = pos.sys; @@ -274,6 +276,8 @@ coordinates to_coordinates(const position pos, const band bnd, const time_axis t coord.pol = pol; + coord.pixel_i = pixel_i; + return coord; } @@ -336,7 +340,8 @@ cutout_res_s do_cutout_file( const string abs_subimg_pathname = conf_fits_cutpath + "/" + generate_cut_fitsname(fits_pathname, hdunum); const string abs_fits_pathname{ conf_fits_path + "/" + fits_pathname }; - coordinates coord = to_coordinates(pos, bnd, time, pol); + vector<uint_bounds> pixel_i_none; + coordinates coord = to_coordinates(pos, bnd, time, pol, pixel_i_none); uintmax_t filesize = cutout_file(abs_fits_pathname, hdunum, coord, abs_subimg_pathname, extra_cards); diff --git a/data-access/engine/src/common/src/cutout_nljson.cpp b/data-access/engine/src/common/src/cutout_nljson.cpp index 8c7cc8ad7fd5837f897863283045f613c616565c..1c983e592d0e9fd8b4d6c3952f923afa8984c6ad 100644 --- a/data-access/engine/src/common/src/cutout_nljson.cpp +++ b/data-access/engine/src/common/src/cutout_nljson.cpp @@ -119,6 +119,13 @@ void from_json(const json& j, fits_card& p) } +void from_json(const json& j, uint_bounds& p) +{ + if(j.contains("pix1")) j.at("pix1").get_to(p.pix1); else p.pix1 = 0; + if(j.contains("pix2")) j.at("pix2").get_to(p.pix2); else p.pix2 = 0; + if(j.contains("type")) j.at("type").get_to(p.type); else p.type = ' '; +} + // cutout diff --git a/data-access/engine/src/common/src/json_region.hpp b/data-access/engine/src/common/src/json_region.hpp index f45fe6efc5af860254e558c3bdd2572dc4d50688..b66337bff021f21be6937ebeb1446609aa6ee509 100644 --- a/data-access/engine/src/common/src/json_region.hpp +++ b/data-access/engine/src/common/src/json_region.hpp @@ -52,16 +52,29 @@ class json_region std::vector<std::string> get_pol() { - std::vector<std::string> str; + std::vector<std::string> str_vec; if(m_jservice.contains("pol")) { json j = m_jservice.at("pol"); - str = j.get<std::vector<std::string>>(); + str_vec = j.get<std::vector<std::string>>(); } - return str; + return str_vec; } + std::vector<uint_bounds> get_pixel_i() + { + std::vector<uint_bounds> pixi_vec; + if(m_jservice.contains("pixel_i")) + { + json j = m_jservice.at("pixel_i"); + pixi_vec = j.get<std::vector<uint_bounds>>(); + } + return pixi_vec; + } + + + private: json m_jservice; }; diff --git a/data-access/engine/src/vlkb/src/ast.cpp b/data-access/engine/src/vlkb/src/ast.cpp index 537afb65888903fabb8369053ccf9bd013db03e0..deb0a4d135eb5f0209855a6baf66f7cbe02e5943 100644 --- a/data-access/engine/src/vlkb/src/ast.cpp +++ b/data-access/engine/src/vlkb/src/ast.cpp @@ -170,6 +170,11 @@ vector<string> split (const string &s, char delim) return result; } +void update_with_pixel_i(vector<uint_bounds>& bnds, vector<uint_bounds> pix_vec) +{ + for(unsigned int i=0; ( i<pix_vec.size() ) && ( i<bnds.size() ); i++) + if(pix_vec[i].type == 'x') bnds[i] = pix_vec[i]; +} int vlkb_overlap(const string& pathname, const string& region, vector<uint_bounds>& bnds) { @@ -188,6 +193,7 @@ int vlkb_overlap(const string& pathname, const string& region, vector<uint_bound fitsfiles::Hdu hd = allHdus.at(i); bnds = calc_overlap(hd.m_header, coord, ov_code); } + update_with_pixel_i(bnds, coord.pixel_i); return ov_code; } diff --git a/data-access/engine/src/vlkb/src/main.cpp b/data-access/engine/src/vlkb/src/main.cpp index 0bad88945305a4d18ee7b92dea74050caa6b4266..c23d0ad94925e25f53374754a5f2209521198973 100644 --- a/data-access/engine/src/vlkb/src/main.cpp +++ b/data-access/engine/src/vlkb/src/main.cpp @@ -267,7 +267,7 @@ int cmd_cutout(int argc, char * argv[]) << endl << "region in JSON form of VO-SODA params. For example 'POS=CIRCLE 21.4458 -1.373 0.1' :" << endl - << " \'{\"pos\":{\"circle\":{\"lat\":-1.373,\"lon\":21.4458,\"radius\":0.1},\"system\":\"ICRS\"},\"service\":\"SUBIMG\"}\'" + << " \'{\"pos\":{\"circle\":{\"lat\":-1.373,\"lon\":21.4458,\"radius\":0.1},\"system\":\"ICRS\"}}\'" << endl; return EXIT_FAILURE; } @@ -542,7 +542,7 @@ int cmd_overlap(int argc, char * argv[]) << "Usage: overlap <filename.fits[ext]> <region>\n" << "\n" << "Calculate overlap between HDU in file and region.\n\nregion in JSON form of VO-SODA params. For example 'POS=CIRCLE 21.4458 -1.373 0.1' :\n" - " \'{\"pos\":{\"circle\":{\"lat\":-1.373,\"lon\":21.4458,\"radius\":0.1},\"system\":\"ICRS\"},\"service\":\"SUBIMG\"}\'\n"; + " \'{\"pos\":{\"circle\":{\"lat\":-1.373,\"lon\":21.4458,\"radius\":0.1},\"system\":\"ICRS\"}}\'\n"; rc = EXIT_FAILURE; } else diff --git a/data-access/servlet/src/main/java/common/Pixeli.java b/data-access/servlet/src/main/java/common/Pixeli.java new file mode 100644 index 0000000000000000000000000000000000000000..1bc998229d726035ab97c1e03f0ba6e3a8b344e5 --- /dev/null +++ b/data-access/servlet/src/main/java/common/Pixeli.java @@ -0,0 +1,8 @@ + + +class Pixeli +{ + int pix1,pix2; + int type; + Pixeli(int px1, int px2, char cc) {this.pix1=px1; this.pix2=px2; this.type=cc;} +} diff --git a/data-access/servlet/src/main/java/common/json/JsonEncoder.java b/data-access/servlet/src/main/java/common/json/JsonEncoder.java index 99d6ed830af5865d26ffb29918bcd1e6cbf7d388..4bda79e617175190ef340dfcedb3a24b8cd4bf18 100644 --- a/data-access/servlet/src/main/java/common/json/JsonEncoder.java +++ b/data-access/servlet/src/main/java/common/json/JsonEncoder.java @@ -90,81 +90,99 @@ public class JsonEncoder } } - - public void add(FitsCard[] extraCards) - { - if((extraCards != null) && (extraCards.length > 0)) - { - obj.put("extra_cards", extraCardsToJson(extraCards)); - } - } - - - public void add(boolean countNullValues) - { - obj.put("count_null_values", countNullValues); - } - - - - private JSONArray extraCardsToJson(FitsCard[] extraCards) - { - JSONArray jcards = new JSONArray(); - for(FitsCard card : extraCards) - { - JSONObject j = new JSONObject(); - j.put("key", card.key); - j.put("value", card.value); - j.put("comment", card.comment); - jcards.add(j); - } - return jcards; - } - - - private JSONObject objJCircle(Circle circle) - { - JSONObject obj = new JSONObject(); - obj.put("lon", circle.lon); - obj.put("lat", circle.lat); - obj.put("radius", circle.radius); - return obj; - } - - - private JSONObject objJRange(Range range) - { - JSONObject obj = new JSONObject(); - obj.put("lon1", range.lon1); - obj.put("lon2", range.lon2); - obj.put("lat1", range.lat1); - obj.put("lat2", range.lat2); - return obj; - } - - private JSONObject objJPolygon(Polygon poly) - { - JSONObject obj = new JSONObject(); - obj.put("lon", genPolyLonJsonArr(poly)); - obj.put("lat", genPolyLatJsonArr(poly)); - return obj; - } - - - private JSONArray genPolyLonJsonArr(Polygon polygon) - { - JSONArray jarr = new JSONArray(); - for(double dbl : polygon.lon) jarr.add(dbl); - return jarr; - } - - - private JSONArray genPolyLatJsonArr(Polygon polygon) - { - JSONArray jarr = new JSONArray(); - for(double dbl : polygon.lat) jarr.add(dbl); - return jarr; - } + public void add(Pixeli[] pixiArr) + { + if(pixiArr != null) + { + JSONArray jarr = new JSONArray(); + for(Pixeli elem : pixiArr) + { + JSONObject j = new JSONObject(); + j.put("pix1", elem.pix1); + j.put("pix2", elem.pix2); + j.put("type", elem.type); + jarr.add(j); + } + this.obj.put("pixel_i", jarr); + } + } + + + + public void add(FitsCard[] extraCards) + { + if((extraCards != null) && (extraCards.length > 0)) + { + obj.put("extra_cards", extraCardsToJson(extraCards)); + } + } + + + public void add(boolean countNullValues) + { + obj.put("count_null_values", countNullValues); + } + + + + private JSONArray extraCardsToJson(FitsCard[] extraCards) + { + JSONArray jcards = new JSONArray(); + for(FitsCard card : extraCards) + { + JSONObject j = new JSONObject(); + j.put("key", card.key); + j.put("value", card.value); + j.put("comment", card.comment); + jcards.add(j); + } + return jcards; + } + + + private JSONObject objJCircle(Circle circle) + { + JSONObject obj = new JSONObject(); + obj.put("lon", circle.lon); + obj.put("lat", circle.lat); + obj.put("radius", circle.radius); + return obj; + } + + + private JSONObject objJRange(Range range) + { + JSONObject obj = new JSONObject(); + obj.put("lon1", range.lon1); + obj.put("lon2", range.lon2); + obj.put("lat1", range.lat1); + obj.put("lat2", range.lat2); + return obj; + } + + private JSONObject objJPolygon(Polygon poly) + { + JSONObject obj = new JSONObject(); + obj.put("lon", genPolyLonJsonArr(poly)); + obj.put("lat", genPolyLatJsonArr(poly)); + return obj; + } + + + private JSONArray genPolyLonJsonArr(Polygon polygon) + { + JSONArray jarr = new JSONArray(); + for(double dbl : polygon.lon) jarr.add(dbl); + return jarr; + } + + + private JSONArray genPolyLatJsonArr(Polygon polygon) + { + JSONArray jarr = new JSONArray(); + for(double dbl : polygon.lat) jarr.add(dbl); + return jarr; + } } diff --git a/data-access/servlet/src/main/java/cutout/Soda.java b/data-access/servlet/src/main/java/cutout/Soda.java index d113c3216aefb3affd02433f93f851c8ef38831a..4ab7e68a68eb519379b9883adc3c14702f33d3ef 100644 --- a/data-access/servlet/src/main/java/cutout/Soda.java +++ b/data-access/servlet/src/main/java/cutout/Soda.java @@ -15,7 +15,7 @@ public interface Soda { public int doStream(String relPathname, int hdunum, - Pos pos, Band band, Time time, Pol pol, + Pos pos, Band band, Time time, Pol pol, Pixeli[] pixeli, OutputStream outputStream) throws IOException, InterruptedException; public int doStream(String relPathname, int hdunum, String pixels, diff --git a/data-access/servlet/src/main/java/cutout/SodaImpl.java b/data-access/servlet/src/main/java/cutout/SodaImpl.java index 5b182c2fd1cc9bf01d8f25a030dba54c4d645367..959ef54f68dd38df638f08b607c11e42c539fae5 100644 --- a/data-access/servlet/src/main/java/cutout/SodaImpl.java +++ b/data-access/servlet/src/main/java/cutout/SodaImpl.java @@ -44,7 +44,7 @@ class SodaImpl implements Soda public int doStream(String relPathname, int hdunum, - Pos pos, Band band, Time time, Pol pol, + Pos pos, Band band, Time time, Pol pol, Pixeli[] pixeli, OutputStream outputStream) throws IOException, InterruptedException { Instant start = Instant.now(); @@ -54,13 +54,23 @@ class SodaImpl implements Soda LOGGER.finest("supplied outputStream for cut-file is null"); // FIXME throw excpetion here - boolean has_overlap = false; - String boundsString = ""; + /*/ DBG start + Pixeli[] pixeli = + { + new Pixeli(0,0,' '), + new Pixeli(0,0,' '), + new Pixeli(10,20,'x') + }; + // DBG end*/ + + boolean has_overlap = false; + String boundsString = ""; JsonEncoder jReq = new JsonEncoder(); jReq.add(pos); jReq.add(band); jReq.add(time); jReq.add(pol); + jReq.add(pixeli); String coordString = jReq.toString(); LOGGER.finest("coordString: " + coordString); @@ -82,36 +92,36 @@ class SodaImpl implements Soda if(rc == 0) { - return rc; // OK + return rc; // OK } else if(rc == 1) { - return rc; // OK, but no overlap + return rc; // OK, but no overlap } else { throw new IllegalArgumentException( "overlap computation could not be completed with the given arguments. " - + errorStrBuilder.toString()); + + errorStrBuilder.toString()); } } - public int doStream(String relPathname, int hdunum, - String pixels, OutputStream outputStream) throws IOException, InterruptedException - { - Instant start = Instant.now(); - LOGGER.fine("trace"); + public int doStream(String relPathname, int hdunum, + String pixels, OutputStream outputStream) throws IOException, InterruptedException + { + Instant start = Instant.now(); + LOGGER.fine("trace"); if(outputStream == null) LOGGER.finest("supplied outputStream for cut-file is null"); - final boolean isDavCall= relPathname.startsWith("http://") || relPathname.startsWith("https://"); - final boolean isAbsPath= relPathname.startsWith("/"); - String absPathname = (isDavCall || isAbsPath) ? relPathname - : (fitsPaths.surveys() +"/"+ relPathname); + final boolean isDavCall= relPathname.startsWith("http://") || relPathname.startsWith("https://"); + final boolean isAbsPath= relPathname.startsWith("/"); + String absPathname = (isDavCall || isAbsPath) ? relPathname + : (fitsPaths.surveys() +"/"+ relPathname); String[] cmd = new String[5]; cmd[0] = "/usr/local/bin/vlkb"; @@ -131,32 +141,32 @@ class SodaImpl implements Soda if(rc == 0) { - return rc; // OK + return rc; // OK } else if(rc == 1) { - return rc; // OK, but no overlap + return rc; // OK, but no overlap } else { throw new IllegalArgumentException( "overlap computation could not be completed with the given arguments. " - + errorStrBuilder.toString()); + + errorStrBuilder.toString()); } } - public int doStreamHeader(String relPathname, int hdunum, - OutputStream outputStream) throws IOException, InterruptedException - { - Instant start = Instant.now(); - LOGGER.fine("trace"); + public int doStreamHeader(String relPathname, int hdunum, + OutputStream outputStream) throws IOException, InterruptedException + { + Instant start = Instant.now(); + LOGGER.fine("trace"); if(outputStream == null) LOGGER.finest("supplied response outputStream is null"); - final boolean isAbsPath= relPathname.startsWith("/"); - String absPathname = isAbsPath ? relPathname : (fitsPaths.surveys() +"/"+ relPathname); + final boolean isAbsPath= relPathname.startsWith("/"); + String absPathname = isAbsPath ? relPathname : (fitsPaths.surveys() +"/"+ relPathname); String[] cmd = new String[4]; cmd[0] = "/usr/local/bin/vlkb"; @@ -175,12 +185,12 @@ class SodaImpl implements Soda if(rc == 0) { - return rc; // OK + return rc; // OK } else { throw new IllegalArgumentException("header could not be retrieved (rc=" - + rc + ") " + errorStrBuilder.toString()); + + rc + ") " + errorStrBuilder.toString()); } } diff --git a/data-access/servlet/src/main/java/cutout/webapi/ServletCutout.java b/data-access/servlet/src/main/java/cutout/webapi/ServletCutout.java index 841f05e215f5fc383d23f30fdefe49bbcbe466ad..7f87953a8e31894942e8544721bcad3f3729ede7 100644 --- a/data-access/servlet/src/main/java/cutout/webapi/ServletCutout.java +++ b/data-access/servlet/src/main/java/cutout/webapi/ServletCutout.java @@ -115,8 +115,9 @@ public class ServletCutout extends HttpServlet } - protected int doCutoutStream(String id, Pos pos, Band band, Time time, Pol pol, String pixels, - OutputStream respOutputStream) throws IOException, InterruptedException + protected int doCutoutStream(String id, + Pos pos, Band band, Time time, Pol pol, Pixeli[] pixeli, + String pixels, OutputStream respOutputStream) throws IOException, InterruptedException { LOGGER.fine("trace " + pos); @@ -129,19 +130,20 @@ public class ServletCutout extends HttpServlet // if only ID given return header boolean headerReq = (id!=null) && (pos==null) && (band==null) && (time==null) && (pol==null) + && (pixeli==null) && (pixels==null); resolver.resolve(id); if(headerReq) return soda.doStreamHeader(resolver.relPathname(), resolver.hdunum(), - respOutputStream); + respOutputStream); else if(pixels != null) return soda.doStream(resolver.relPathname(), resolver.hdunum(), - pixels, respOutputStream); + pixels, respOutputStream); else return soda.doStream(resolver.relPathname(), resolver.hdunum(), - pos, band, time, pol, respOutputStream); + pos, band, time, pol, pixeli, respOutputStream); } @@ -276,6 +278,7 @@ public class ServletCutout extends HttpServlet Band band = Band.parseBand(params); Time time = Time.parseTime(params); Pol pol = Pol.parsePol(params); + Pixeli[] pixeli = parseMultiplePixeliParam(params, "PIXEL_"); String pixels = SingleStringParam.parseSingleStringParam(params, "PIXELS"); String respFormat = sodaReq_getResponseFormat(request, DEFAULT_RESPONSEFORMAT); @@ -285,7 +288,7 @@ public class ServletCutout extends HttpServlet if(respFormat.startsWith("application/fits")) { response.setContentType(respFormat); - int rc = doCutoutStream(id, pos, band, time, pol, pixels, respOutputStream); + int rc = doCutoutStream(id,pos,band,time,pol,pixeli, pixels, respOutputStream); if(rc == 1) response.setStatus(HttpServletResponse.SC_NO_CONTENT); } else if(respFormat.startsWith("application/x-vlkb+xml")) @@ -434,17 +437,78 @@ public class ServletCutout extends HttpServlet return (null != soda_getSingleValue(request, "nullvals")); } + private Pixeli[] parseMultiplePixeliParam(Map<String, String[]> params, String keyRoot) + { + LOGGER.fine("trace"); + + final int maxAxes = 5; + Pixeli[] pixiArr = new Pixeli[maxAxes]; + boolean atLeastOneFound = false; + + for(int i=0; i <maxAxes; i++) + { + Pixeli pixi = new Pixeli(0,0,' '); + + String[] valArr = params.get(keyRoot + String.valueOf(i+1)); + if((valArr != null) && valArr.length != 0) + { + if(valArr.length > 1) + throw new IllegalArgumentException( + "MultiValuedParamNotSupported: " + + valArr[0] + " was found " + valArr.length + " times"); + else + { + // PIXEL_i=m n + String value = valArr[0]; + String[] parts = value.split(" "); + if(parts.length != 2) + { + throw new IllegalArgumentException( + "PIXLE_i is interval with two space separated values but " + + parts.length + " values found: " + value); + } + else + { + try + { + int pix1 = Integer.parseInt(parts[0]); + int pix2 = Integer.parseInt(parts[1]); + if( pix1 < 0 || pix2 < 0) + { + throw new IllegalArgumentException( + "PIXLE_i interval must be positive integers but: " + + String.valueOf(pix1) + " " + String.valueOf(pix2)); + } + pixi = new Pixeli(pix1,pix2,'x'); + atLeastOneFound = true; + } + catch(NumberFormatException e) + { + throw new IllegalArgumentException( + "PIXLE_i is interval of integers but : " + + e.getMessage()); + } + } + } + } + pixiArr[i] = pixi; + LOGGER.fine("pixiArr["+ i +"]: " + pixiArr[i].pix1 +" "+ pixiArr[i].pix2 + +" " + pixiArr[i].type); + } + // dont return empty (0,0,' ') array + return atLeastOneFound ? pixiArr : null; + } } /* from SODA (upon error): - Error codes are specified in DALI. Error documents should be text - using the text/plain content-type and the text must begin with one of the - following strings: + Error codes are specified in DALI. Error documents should be text + using the text/plain content-type and the text must begin with one of the + following strings: - Error CodeDescription - --------------------------------------- + Error CodeDescription + --------------------------------------- Error: General error (not covered below) AuthenticationError: Not authenticated @@ -455,15 +519,15 @@ UsageError: Permanent error (retry pointless) MultiValuedParamNotSupported: request included multiple values for a parameter but the service only supports a single value -*/ + */ /* from DALI (upon successful request): - The service should set HTTP headers (Fielding and Gettys et al., - 1999) that are useful to the correct values where possible. Recommended - headers to set when possible: - Content-Type - Content-Encoding - Content-Length -- not in SPDA-stream impossible to know - Last-Modified -- not in SODA-stream impossible to know - */ + The service should set HTTP headers (Fielding and Gettys et al., + 1999) that are useful to the correct values where possible. Recommended + headers to set when possible: + Content-Type + Content-Encoding + Content-Length -- not in SPDA-stream impossible to know + Last-Modified -- not in SODA-stream impossible to know + */ diff --git a/data-access/servlet/src/main/java/mcutout/VlkbCli.java b/data-access/servlet/src/main/java/mcutout/VlkbCli.java index 0c742f58f58ed89b2cd0cd117ee57bdaffb348d4..701d9271241ad9d4af63cec9122785930a5d660c 100644 --- a/data-access/servlet/src/main/java/mcutout/VlkbCli.java +++ b/data-access/servlet/src/main/java/mcutout/VlkbCli.java @@ -107,9 +107,11 @@ class VlkbCli implements Vlkb { LOGGER.fine("trace: " + cutAbsPathname ); + Pixeli[] pixeli = null; + try(OutputStream fileOutputStream = new FileOutputStream(new File(cutAbsPathname))) { - soda.doStream(relPathname, hdunum, pos, band, time, pol, fileOutputStream); + soda.doStream(relPathname, hdunum, pos, band, time, pol, pixeli, fileOutputStream); } }