diff --git a/data-access/servlet/src/main/java/webapi/ServletCutout.java b/data-access/servlet/src/main/java/webapi/ServletCutout.java index 344716da06fb7f744bd7a3798d9ef11916a5ca92..875ac5c0d0498964b590c1123133742314d1ae9a 100644 --- a/data-access/servlet/src/main/java/webapi/ServletCutout.java +++ b/data-access/servlet/src/main/java/webapi/ServletCutout.java @@ -152,7 +152,7 @@ public class ServletCutout extends javax.servlet.http.HttpServlet rsl.resolve(id); relPathname = rsl.relPathname(); hdunum = rsl.hdunum(); - String subsurveyId = rsl.obsCollection(); //this implementation assumes ObsCore::obs_collection holds ssID + String subsurveyId = rsl.obsCollection(); FitsCard[] extraCards = null; if(subsurveyId != null) { @@ -173,31 +173,7 @@ public class ServletCutout extends javax.servlet.http.HttpServlet CutResult cutResult = cutout.doFile(relPathname, hdunum, pos, band, time, pol, pixels, false, null); - DataLink dlk = new DataLink(); - - dlk.id = id; - dlk.accessUrl = dlk.convertLocalPathnameToRemoteUrl(cutResult.filename, - settings.fitsPaths.cutouts(), settings.fitsPaths.cutoutsUrl()); - dlk.serviceDef = null; - dlk.errorMessage = null; - dlk.description = "A cutout from " + id;// + " by parameters " - // + pos.toString() + " " + band.toString() + " " + time.toString() + " " + pol.toString(); - dlk.semantics = "http://www.ivoa.net/rdf/datalink/core#proc#cutout"; - dlk.contentType = "application/fits"; - dlk.contentLength = cutResult.filesize; - - // VLKB-extension to DataLink: - Coord coord = new Coord(DEFAULT_SKY_SYSTEM, pos, DEFAULT_SPEC_SYSTEM, band, time, pol); - LOGGER.info(coord.toString()); - - dlk.inputs = new Inputs(id, coord, countNullValues); - dlk.versionString = Version.asString; - dlk.cut = null; - dlk.absCutPathname = cutResult.filename; - dlk.datacubeCount = 1; - dlk.nullVals = ((cutResult.nullValueCount.percent < 0) || (cutResult.nullValueCount.totalCount < 1)) ? - null : cutResult.nullValueCount; - dlk.mcutResultArr = null; + DataLink dlk = new DataLink(settings, cutResult, id, pos, band, time, pol, countNullValues); return dlk; } diff --git a/data-access/servlet/src/main/java/webapi/output/DataLink.java b/data-access/servlet/src/main/java/webapi/output/DataLink.java index 7c40950f4d47a2491d303d74a2e9a08163b593cc..82a89fb4a9a53f90ace077c7b3002f6155439d61 100644 --- a/data-access/servlet/src/main/java/webapi/output/DataLink.java +++ b/data-access/servlet/src/main/java/webapi/output/DataLink.java @@ -3,6 +3,7 @@ import java.util.logging.Logger; import java.util.List; import java.util.ArrayList; +import vo.parameter.*; class DataLink { @@ -38,6 +39,37 @@ class DataLink this.datacubeCount = 1; } + + // used in ServeltCutout + public DataLink(Settings settings, CutResult cutResult, + String id, Pos pos, Band band, Time time, Pol pol, boolean countNullValues) + { + this.id = id; + this.accessUrl = convertLocalPathnameToRemoteUrl(cutResult.filename, + settings.fitsPaths.cutouts(), settings.fitsPaths.cutoutsUrl()); + this.serviceDef = null; + this.errorMessage = null; + this.description = "A cutout from " + id; + // + " by parameters " + // + pos.toString() + " " + band.toString() + " " + time.toString() + " " + pol.toString(); + this.semantics = "http://www.ivoa.net/rdf/datalink/core#proc#cutout"; + this.contentType = "application/fits"; + this.contentLength = cutResult.filesize; + + // VLKB-extension to DataLink: + Coord coord = new Coord(pos.system.toString(), pos, band.system.toString(), band, time, pol); + LOGGER.info(coord.toString()); + + this.inputs = new Inputs(id, coord, countNullValues); + this.versionString = Version.asString; + this.cut = null; + this.absCutPathname = cutResult.filename; + this.datacubeCount = 1; + this.nullVals = ((cutResult.nullValueCount.percent < 0) || (cutResult.nullValueCount.totalCount < 1)) ? + null : cutResult.nullValueCount; + this.mcutResultArr = null; + } + // FIXME fake, only to compile MCutout and Merge public DataLink(CutResult cutResult) { @@ -63,6 +95,7 @@ class DataLink } + // used in MCutout public DataLink(MCutResult cutResult) { this.nullVals = new NullValueCount();