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

adds all ObsCore columns to search-query result (and keeps VLKB extensions)

parent 820f7bc5
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,9 @@ import java.util.Iterator; ...@@ -8,6 +8,9 @@ import java.util.Iterator;
class Dataset class Dataset
{ {
FormatResponseFilter.ObsDataset obsDataset;
class Access class Access
{ {
String accessFileUrl; String accessFileUrl;
......
...@@ -59,7 +59,8 @@ class SearchOutputData ...@@ -59,7 +59,8 @@ class SearchOutputData
prevSubsurveyId = dataset.subsurvey_id; prevSubsurveyId = dataset.subsurvey_id;
} }
if( Dataset.areDatasetsMergeable(datasetList) ) if( false )
//if( Dataset.areDatasetsMergeable(datasetList) )
{ {
Dataset mergedDataset = new Dataset(datasetList, inputs, mergeUrlRoot); Dataset mergedDataset = new Dataset(datasetList, inputs, mergeUrlRoot);
datasetList.add(mergedDataset); datasetList.add(mergedDataset);
......
...@@ -47,28 +47,66 @@ public final class XmlSerializer ...@@ -47,28 +47,66 @@ public final class XmlSerializer
out.flush(); out.flush();
} }
private static StarTable makeSearchResultsTable(Subsurvey[] ssurv) private static StarTable makeSearchResultsTable(Subsurvey[] ssurv)
{ {
ColumnInfo[] colInfos = new ColumnInfo[ 6 + 2*4 ]; // FIXME make static final
ColumnInfo[] colInfos =
int ix=0; {
new ColumnInfo( "dataproduct_type", String.class, "Dataproduct Type (image|cube)" ),
colInfos[ ix++ ] = new ColumnInfo( "overlap", Integer.class, "Overlap Code" ); new ColumnInfo( "calib_level", Integer.class, "Calibration level" ),
colInfos[ ix++ ] = new ColumnInfo( "overlapSky", Integer.class, "Overlap Code for Sky axes" ); new ColumnInfo( "obs_collection", String.class, "Collection" ),
colInfos[ ix++ ] = new ColumnInfo( "overlapSpec", Integer.class, "Overlap Code for Spectral axis" ); new ColumnInfo( "obs_id", String.class, "Observation Id" ),
new ColumnInfo( "obs_publisher_did", String.class, "Publisher Did" ),
colInfos[ ix++ ] = new ColumnInfo( "dataType", String.class, "Data Type (image|cube)" );
colInfos[ ix++ ] = new ColumnInfo( "pubdid", String.class, "PublisherDid" ); new ColumnInfo( "access_url", String.class, "Access URL" ),
colInfos[ ix++ ] = new ColumnInfo( "access_url", String.class, "Access URL" ); new ColumnInfo( "access_format", String.class, "Format (MIME type)" ),
new ColumnInfo( "access_estsize", Long.class, "Extimated size (KB)" ),
colInfos[ ix++ ] = new ColumnInfo( "P1lon", Double.class, "longitude" );
colInfos[ ix++ ] = new ColumnInfo( "P1lat", Double.class, "latitude" ); new ColumnInfo( "target_name", String.class, "Target" ),
colInfos[ ix++ ] = new ColumnInfo( "P2lon", Double.class, "longitude" );
colInfos[ ix++ ] = new ColumnInfo( "P2lat", Double.class, "latitude" ); new ColumnInfo( "s_ra", Double.class, "Right Ascention" ),
colInfos[ ix++ ] = new ColumnInfo( "P3lon", Double.class, "longitude" ); new ColumnInfo( "s_dec", Double.class, "Declination" ),
colInfos[ ix++ ] = new ColumnInfo( "P3lat", Double.class, "latitude" ); new ColumnInfo( "s_fov", Double.class, "Field of view" ),
colInfos[ ix++ ] = new ColumnInfo( "P4lon", Double.class, "longitude" ); new ColumnInfo( "s_region", String.class, "Region" ),
colInfos[ ix++ ] = new ColumnInfo( "P4lat", Double.class, "latitude" ); new ColumnInfo( "s_xel1", Long.class, "Pixels axis1" ),
new ColumnInfo( "s_xel2", Long.class, "Pixels axis2" ),
new ColumnInfo( "s_resolution", Double.class, "Spatial resolution" ),
new ColumnInfo( "t_min", Double.class, "Time min" ),
new ColumnInfo( "t_max", Double.class, "Time max" ),
new ColumnInfo( "t_exptime", Double.class, "Exposure time" ),
new ColumnInfo( "t_resolution", Double.class, "Time resolution" ),
new ColumnInfo( "t_xel", Long.class, "Time pixels" ),
new ColumnInfo( "em_min", Double.class, "Spectrum min" ),
new ColumnInfo( "em_max", Double.class, "Spectrum max" ),
new ColumnInfo( "em_res_power", Double.class, "Spectrum resolution power" ),
new ColumnInfo( "em_xel", Long.class, "Spectrum pixels" ),
new ColumnInfo( "o_ucd", String.class, "Observable UCD" ),
new ColumnInfo( "pol_states", String.class, "Polarization states" ),
new ColumnInfo( "pol_xel", Long.class, "Polarization pixels" ),
new ColumnInfo( "facility_name", String.class, "Facility" ),
new ColumnInfo( "instrument_name", String.class, "Instrument" ),
// VLKB extensions
new ColumnInfo( "overlap", Integer.class, "Overlap Code" ),
new ColumnInfo( "overlapSky", Integer.class, "Overlap Code for Sky axes" ),
new ColumnInfo( "overlapSpec", Integer.class, "Overlap Code for Spectral axis" ),
new ColumnInfo( "P1lon", Double.class, "P1 longitude" ),
new ColumnInfo( "P1lat", Double.class, "P1 latitude" ),
new ColumnInfo( "P2lon", Double.class, "P2 longitude" ),
new ColumnInfo( "P2lat", Double.class, "P2 latitude" ),
new ColumnInfo( "P3lon", Double.class, "P3 longitude" ),
new ColumnInfo( "P3lat", Double.class, "P3 latitude" ),
new ColumnInfo( "P4lon", Double.class, "P4 longitude" ),
new ColumnInfo( "P4lat", Double.class, "P4 latitude" )
};
RowListStarTable astro = new RowListStarTable( colInfos ); RowListStarTable astro = new RowListStarTable( colInfos );
...@@ -76,16 +114,50 @@ public final class XmlSerializer ...@@ -76,16 +114,50 @@ public final class XmlSerializer
{ {
for(Dataset dataset : subsurvey.datasetArr) for(Dataset dataset : subsurvey.datasetArr)
{ {
if(dataset.obsDataset == null) continue; // skip mergeable datasets
astro.addRow( new Object[] astro.addRow( new Object[]
{ {
// ObsCore
dataset.obsDataset.dataproduct_type,//dataset.dataType,
new Integer( dataset.obsDataset.calib_level ),
dataset.obsDataset.obs_collection,
dataset.obsDataset.obs_id,
dataset.obsDataset.obs_publisher_did,
dataset.obsDataset.access_url,//dataset.access.accessCutoutUrl,
dataset.obsDataset.access_format,
new Long( dataset.obsDataset.access_estsize ),
dataset.obsDataset.target_name,
new Double(dataset.obsDataset.s_ra),new Double(dataset.obsDataset.s_dec),new Double(dataset.obsDataset.s_fov),
dataset.obsDataset.s_region,
new Long( dataset.obsDataset.s_xel1 ), new Long( dataset.obsDataset.s_xel2 ),
new Double(dataset.obsDataset.s_resolution),
new Double(dataset.obsDataset.t_min), new Double(dataset.obsDataset.t_max),
new Double(dataset.obsDataset.t_exptime), new Double(dataset.obsDataset.t_resolution),
new Long( dataset.obsDataset.t_xel ),
new Double(dataset.obsDataset.em_min), new Double(dataset.obsDataset.em_max),
new Double(dataset.obsDataset.em_res_power),
new Long( dataset.obsDataset.em_xel ),
dataset.obsDataset.o_ucd,
dataset.obsDataset.pol_states,
new Long( dataset.obsDataset.pol_xel ),
dataset.obsDataset.facility_name,
dataset.obsDataset.instrument_name,
// VLKB extensions
new Integer( dataset.overlapCode ), new Integer( dataset.overlapCode ),
new Integer( dataset.overlapCodeSky ), new Integer( dataset.overlapCodeSky ),
new Integer( dataset.overlapCodeVel ), new Integer( dataset.overlapCodeVel ),
dataset.dataType,
dataset.publisherDid,
dataset.access.accessCutoutUrl,
new Double(dataset.vertices_deg.lon[0]), new Double(dataset.vertices_deg.lat[0]), new Double(dataset.vertices_deg.lon[0]), new Double(dataset.vertices_deg.lat[0]),
new Double(dataset.vertices_deg.lon[1]), new Double(dataset.vertices_deg.lat[1]), new Double(dataset.vertices_deg.lon[1]), new Double(dataset.vertices_deg.lat[1]),
new Double(dataset.vertices_deg.lon[2]), new Double(dataset.vertices_deg.lat[2]), new Double(dataset.vertices_deg.lon[2]), new Double(dataset.vertices_deg.lat[2]),
......
...@@ -225,15 +225,44 @@ public class DbPSearch ...@@ -225,15 +225,44 @@ public class DbPSearch
FormatResponseFilter.ObsDataset obsDataset = new FormatResponseFilter.ObsDataset(); FormatResponseFilter.ObsDataset obsDataset = new FormatResponseFilter.ObsDataset();
obsDataset.dataproduct_type = res.getString("dataproduct_type"); obsDataset.dataproduct_type = res.getString("dataproduct_type");
obsDataset.obs_publisher_did = res.getString("obs_publisher_did"); obsDataset.calib_level = res.getInt("calib_level");
obsDataset.obs_collection = res.getString("obs_collection"); obsDataset.obs_collection = res.getString("obs_collection");
obsDataset.access_url = res.getString("access_url"); obsDataset.obs_id = res.getString("obs_id");
obsDataset.obs_publisher_did = res.getString("obs_publisher_did");
obsDataset.em_min = res.getDouble("em_min"); obsDataset.access_url = res.getString("access_url");
boolean em_min_valid = !res.wasNull(); obsDataset.access_format = res.getString("access_format");
obsDataset.em_max = res.getDouble("em_max"); obsDataset.access_estsize = res.getLong("access_estsize");
boolean em_max_valid = !res.wasNull();
obsDataset.target_name = res.getString("target_name");
obsDataset.s_ra = res.getDouble("s_ra");
obsDataset.s_dec = res.getDouble("s_dec");
obsDataset.s_fov = res.getDouble("s_fov");
obsDataset.s_region = res.getString("s_region");
obsDataset.s_xel1 = res.getLong("s_xel1");
obsDataset.s_xel2 = res.getLong("s_xel2");
obsDataset.s_resolution = res.getDouble("s_resolution");
obsDataset.t_min = res.getDouble("t_min");
obsDataset.t_max = res.getDouble("t_max");
obsDataset.t_exptime = res.getDouble("t_exptime");
obsDataset.t_resolution = res.getDouble("t_resolution");
obsDataset.t_xel = res.getLong("t_xel");
obsDataset.em_min = res.getDouble("em_min"); boolean em_min_valid = !res.wasNull();
obsDataset.em_max = res.getDouble("em_max"); boolean em_max_valid = !res.wasNull();
obsDataset.em_valid = em_min_valid && em_max_valid;; obsDataset.em_valid = em_min_valid && em_max_valid;;
obsDataset.em_res_power = res.getDouble("em_res_power");
obsDataset.em_xel = res.getLong("em_xel");
obsDataset.o_ucd = res.getString("o_ucd");
obsDataset.pol_states = res.getString("pol_states");
obsDataset.pol_xel = res.getLong("pol_xel");
obsDataset.facility_name = res.getString("facility_name");
obsDataset.instrument_name = res.getString("instrument_name");
obsDataset.vertices_str = res.getString("polygon_region_galactic"); obsDataset.vertices_str = res.getString("polygon_region_galactic");
obsDataset.inputInsideDb = res.getBoolean("inputInsideDb"); obsDataset.inputInsideDb = res.getBoolean("inputInsideDb");
......
...@@ -155,14 +155,37 @@ public class FormatResponseFilter implements Filter ...@@ -155,14 +155,37 @@ public class FormatResponseFilter implements Filter
static class ObsDataset static class ObsDataset
{ {
String dataproduct_type; String dataproduct_type;
String obs_publisher_did; Integer calib_level;
String obs_collection; String obs_collection;
String obs_id;
String obs_publisher_did;
String access_url; String access_url;
String access_format;
Long access_estsize;
String target_name;
Double s_ra, s_dec, s_fov;
String s_region;
Long s_xel1, s_xel2;
Double s_resolution;
Double t_min, t_max, t_exptime, t_resolution;
Long t_xel;
double em_min; Double em_min, em_max, em_res_power;
double em_max; Long em_xel;
boolean em_valid; boolean em_valid;
String o_ucd;
String pol_states;
Long pol_xel;
String facility_name;
String instrument_name;
String vertices_str; String vertices_str;
boolean inputInsideDb; boolean inputInsideDb;
boolean dbInsideInput; boolean dbInsideInput;
...@@ -193,10 +216,13 @@ public class FormatResponseFilter implements Filter ...@@ -193,10 +216,13 @@ public class FormatResponseFilter implements Filter
private Dataset[] convert(FormatResponseFilter.ObsDataset[] obsDatasetArr, Coord coord, String queryString, String fitsRemotePath) private Dataset[] convert(FormatResponseFilter.ObsDataset[] obsDatasetArr, Coord coord, String queryString, String fitsRemotePath)
{ {
List<Dataset> datasetList = new ArrayList<Dataset>(); List<Dataset> datasetList = new ArrayList<Dataset>();
for(FormatResponseFilter.ObsDataset obsDataset : obsDatasetArr) for(FormatResponseFilter.ObsDataset obsDataset : obsDatasetArr)
{ {
Dataset dataset = new Dataset(); Dataset dataset = new Dataset();
dataset.obsDataset = obsDataset;
dataset.subsurvey_id = obsDataset.obs_collection; dataset.subsurvey_id = obsDataset.obs_collection;
dataset.overlapCodeSky = convertToOverlapCodeSky(obsDataset.inputInsideDb, obsDataset.dbInsideInput); dataset.overlapCodeSky = convertToOverlapCodeSky(obsDataset.inputInsideDb, obsDataset.dbInsideInput);
dataset.overlapCodeVel = convertToOverlapCodeVel(coord, obsDataset.em_valid, obsDataset.em_min, obsDataset.em_max); dataset.overlapCodeVel = convertToOverlapCodeVel(coord, obsDataset.em_valid, obsDataset.em_min, obsDataset.em_max);
...@@ -213,6 +239,7 @@ public class FormatResponseFilter implements Filter ...@@ -213,6 +239,7 @@ public class FormatResponseFilter implements Filter
datasetList.add(dataset); datasetList.add(dataset);
} }
return datasetList.toArray(new Dataset[0]); return datasetList.toArray(new Dataset[0]);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment