Skip to content

IRSA-2442 and IRSA-2742: adding ISSA and 2mass 6 degrees datasets #817

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@ public class TwoMassIbeDataSource extends BaseIbeDataSource {
public static final String XDATE_KEY = "xdate";
public static final String SCAN_KEY = "scan";

public static final String XTRA_CONSTRAINT = "xtraConstraint"; // IRSA-2742

private DS ds;

public enum DS {
ASKY("asky", "allsky","allsky"),
ASKYW("askyw","full","full"),
SX("sx","sixxcat","sixxcat"),
SXW("sxw","sixxfull","sixxfull"),
//MOSAIC("mosaic", "mosaic", "sixdeg"), // not ready yet
MOSAIC("mosaic", "mosaic", "sixdeg"), // not ready yet
CAL("cal", "calibration", "calibration");

private String name;
Expand Down Expand Up @@ -109,9 +111,15 @@ public IbeDataParam makeDataParam(Map<String, String> pathInfo) {
fname = "image/" + fname;
}

// sample path
// http://<hostname>:8000/ibe/data/twomass/allsky/allsky/980623n/s076/image/hi0760126.fits.gz
dataParam.setFilePath(ordate+hemisphere+"/"+"s"+ne.format(scanno)+"/"+ fname);
if(this.ds.equals(DS.MOSAIC)){
//ex https://<hostname>/ibe/data/twomass/mosaic/sixdeg/j/01381/mosaic_6deg_j01381_1asec.fits
int seqnum = StringUtils.getInt(pathInfo.get("seqnum"));
dataParam.setFilePath( pathInfo.get("fname") );
}else {
// sample path
// http://<hostname>:8000/ibe/data/twomass/allsky/allsky/980623n/s076/image/hi0760126.fits.gz
dataParam.setFilePath(ordate + hemisphere + "/" + "s" + ne.format(scanno) + "/" + fname);
}

// check cutout params
// look for ra_obj first - moving object search
Expand Down Expand Up @@ -198,9 +206,19 @@ private String processConstraints(Map<String, String> queryInfo) {
ArrayList<String> constraints = new ArrayList<String>();
String constrStr = "";

//Add proper filter for mosaic in IBE (IRSA-2742)
String filter = queryInfo.get(XTRA_CONSTRAINT);
String filterStr = "";
String band = queryInfo.get(BAND_KEY);
if (!StringUtils.isEmpty(band)&&!band.startsWith("A")) {
constraints.add("filter=\'"+band.toLowerCase()+"\'");
if (!StringUtils.isEmpty(band) && !band.startsWith("A")) {
filterStr += "filter = \'" + band.toLowerCase() + "\'";
if (!StringUtils.isEmpty(filter)) {
filterStr += " and " + filter;
}
constraints.add(filterStr);
} else if (!StringUtils.isEmpty(filter)) {
filterStr += "filter = " + filter;
constraints.add(filterStr);
}

String hem = queryInfo.get(HEM_KEY);
Expand Down
Loading