Skip to content
Draft
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 @@ -99,6 +99,7 @@ public class ServerParams {
public static final String LSST = "lsst";
public static final String ALL = "all";
public static final String CDS = "cds";
public static final String IS_HIPS_TILE = "isHipsTile";
public static final String HIPS_SOURCES = "hipsSources";
public static final String HIPS_LIST_SOURCE= "hipsListSource";
public static final String HIPS_LIST_SOURCE_NAME= "hipsListSourceName";
Expand Down
10 changes: 10 additions & 0 deletions src/firefly/java/edu/caltech/ipac/firefly/server/SrvParam.java
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,16 @@ public ImagePt getRequiredImagePt(String key) {
}
}

public WorldPt getRequiredWorldPt(String key) {
String v= getRequired(key);
try {
return WorldPt.parse(v);
} catch (NumberFormatException e) {
throw new IllegalArgumentException(
"parameter could not be parsed as WorldPt: parameter: "+ key + ", value: "+v, e);
}
}

public ImagePt[] getRequiredImagePtAry(String key) {
String v= getRequired(key);
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
package edu.caltech.ipac.firefly.server.rpc;

import edu.caltech.ipac.firefly.core.Util;
import static edu.caltech.ipac.util.FormatUtil.Format.*;
import edu.caltech.ipac.firefly.data.ServerParams;
import edu.caltech.ipac.firefly.server.ServCommand;
import edu.caltech.ipac.firefly.server.ServerCommandAccess;
import edu.caltech.ipac.firefly.server.SrvParam;
import edu.caltech.ipac.firefly.server.util.Logger;
import edu.caltech.ipac.firefly.server.visualize.DirectStretchUtils.CompressType;
import edu.caltech.ipac.firefly.server.visualize.FluxValueUtil;
import edu.caltech.ipac.firefly.server.visualize.VisJsonSerializer;
import edu.caltech.ipac.firefly.server.visualize.VisServerOps;
import edu.caltech.ipac.firefly.server.visualize.imagesources.ImageMasterData;
Expand All @@ -19,7 +19,6 @@
import edu.caltech.ipac.firefly.visualize.WebPlotRequest;
import edu.caltech.ipac.firefly.visualize.WebPlotResult;
import edu.caltech.ipac.visualize.plot.ImagePt;
import edu.caltech.ipac.visualize.plot.PixelValue;
import edu.caltech.ipac.visualize.plot.plotdata.FitsExtract;
import jakarta.servlet.ServletOutputStream;
import jakarta.servlet.http.HttpServletRequest;
Expand All @@ -35,6 +34,9 @@
import java.util.List;
import java.util.Map;

import static edu.caltech.ipac.util.FormatUtil.Format.JSON;
import static edu.caltech.ipac.util.FormatUtil.Format.OCTET_STREAM;

/**
* @author Trey Roby
* Date: 2/8/12
Expand All @@ -44,9 +46,20 @@ public class VisServerCommands {

public static class FileFluxCmdJson extends ServCommand {
public String doCommand(SrvParam sp) throws IllegalArgumentException {
PlotState[] stateAry= sp.getStateAry();
List<PixelValue.Result> res= VisServerOps.getFlux(stateAry,sp.getRequiredImagePt("pt"));
return VisJsonSerializer.createPixelResultJson(res,stateAry[0].getBands(),stateAry.length);
var isHips= sp.getOptionalBoolean(ServerParams.IS_HIPS_TILE, false);
if (isHips) {
var res= FluxValueUtil.getFluxHiPS(
sp.getRequired(ServerParams.URL),
sp.getRequiredImagePt("pt"),
sp.getRequiredWorldPt("wpt"),
sp.getRequiredInt(ServerParams.PLANE));
return VisJsonSerializer.createPixelResultJson(res,new Band[] {Band.NO_BAND},1);
}
else {
var stateAry= sp.getStateAry();
var res= FluxValueUtil.getFlux(sp.getStateAry(),sp.getRequiredImagePt("pt"));
return VisJsonSerializer.createPixelResultJson(res,stateAry[0].getBands(),stateAry.length);
}
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private void handleHiPSRequest(HttpServletRequest req, HttpServletResponse res,
SrvParam sp= new SrvParam(req.getParameterMap());
String hips= sp.getRequired(HIPS_PARAM);
boolean alwaysUseCached= sp.getOptionalBoolean(ALWAYS_USE_CACHED,false);
FileInfo fi= HiPSRetrieve.retrieveHiPSData(hips, null, alwaysUseCached);
FileInfo fi= HiPSRetrieve.retrieveHiPSData(hips, alwaysUseCached);

if (fi.getFile()==null) {
if (fi.getResponseCode()==204) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ private static Result retrieveFile(SrvParam sp, FileItemInput uploadedItem) thro
} else if (fromUrl != null) { // from a URL... get it
String fname;
if (hipsCache) {
statusFileInfo= HiPSRetrieve.retrieveHiPSData(fromUrl,null,false);
statusFileInfo= HiPSRetrieve.retrieveHiPSData(fromUrl,false);
fname= (statusFileInfo.getFile()!=null) ? statusFileInfo.getFile().getName() : null;
}
else {
Expand Down
Loading