Skip to content
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
5 changes: 2 additions & 3 deletions buildScript/depends.gincl
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ ext {
webservices_lib = [':archive_dto_irsa',
':axis',
':archive_dto_votable',
':xbean',
':fits' ]
':xbean']

ehcache_lib = [':ehcache-2.7.4',
':slf4j-api-1.6.6',
Expand Down Expand Up @@ -56,7 +55,7 @@ ext {
firefly_lib = [ firefly_ext_lib, ':firefly' ]


FIREFLY_RUNTIME = fits_io_lib + apache_lib + spring_lib + webservices_lib +
FIREFLY_RUNTIME = [':firefly_data'] + fits_io_lib + apache_lib + spring_lib + webservices_lib +
log4j_lib + josso_lib + xstream_lib + xbeanfinder_lib +
gwt_lib_rt + ehcache_lib + starlink_lib + j2ee_rt_lib + json_lib

Expand Down
Binary file removed jars/data/fits.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
rootProject.name = 'firefly_root'

include 'simbad', 'xstream', 'firefly', 'fftools'
include 'simbad', 'xstream', 'firefly', 'fftools', 'firefly_data'

project(":simbad").projectDir = file('src/external/simbad')
project(":xstream").projectDir = file('src/external/xstream')
project(":firefly").projectDir = file('src/firefly')
project(":fftools").projectDir = file('src/fftools')
project(":firefly_data").projectDir = file('src/firefly_data')

2 changes: 1 addition & 1 deletion src/firefly/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ext["app-name"] = 'firefly'
apply from: "$fireflyPath/buildScript/gwt_webapp.gincl"

dependencies {
compile project(':xstream'), project(':simbad')
compile project(':xstream'), project(':simbad'), project(':firefly_data')
webappLib mysql_lib, FIREFLY_RUNTIME + ":$jar.baseName"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
public class AllSkyRetriever implements FileRetriever {

private static final ReservedImage RESERVED_IMAGES[] = {
new ReservedImage("e90gal07.fits",
new ReservedImage("allsky/e90gal07.fits",
"All Sky Image -- DIRBE 60 micron", "sky"),
new ReservedImage("e90gal09.fits",
new ReservedImage("allsky/e90gal09.fits",
"All Sky Image -- DIRBE 140 micron", "sky"),
new ReservedImage("e90gal04.fits",
new ReservedImage("allsky/e90gal04.fits",
"All Sky Image -- DIRBE 4.9 micron", "sky"),
new ReservedImage("allsky.fits",
new ReservedImage("allsky/allsky.fits",
"ISSA All Sky Image", "sky")
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import edu.caltech.ipac.visualize.plot.ImagePlot;

import java.io.File;
import java.util.HashMap;
import java.util.Map;
/**
* User: roby
* Date: Jul 29, 2008
Expand Down Expand Up @@ -135,7 +137,35 @@ public static void initCounters() {
}
}

private static final Map<String, String> footprintMap;
static {
footprintMap = new HashMap<String, String>();
footprintMap.put("HST", "footprint/Footprint_HST.reg");
footprintMap.put("HST_NICMOS", "footprint/Footprint_HST.reg");
footprintMap.put("HST_WFPC2", "footprint/Footprint_HST.reg");
footprintMap.put("HST_ACS/WFC", "footprint/Footprint_HST.reg");
footprintMap.put("HST_ACS/HRC", "footprint/Footprint_HST.reg");
footprintMap.put("HST_ACS/SBC", "footprint/Footprint_HST.reg");
footprintMap.put("HST_WFC3/UVIS","footprint/Footprint_HST.reg");
footprintMap.put("HST_WFC3/IR", "footprint/Footprint_HST.reg");
footprintMap.put("JWST", "footprint/Footprint_JWST.reg");
footprintMap.put("JWST_FGS", "footprint/Footprint_JWST.reg");
footprintMap.put("JWST_MIRI", "footprint/Footprint_JWST.reg");
footprintMap.put("JWST_NIRCAM", "footprint/Footprint_JWST.reg");
footprintMap.put("JWST_NIS", "footprint/Footprint_JWST.reg");
footprintMap.put("JWST_NIRSPEC","footprint/Footprint_JWST.reg");
footprintMap.put("SPITZER", "footprint/Footprint_SPITZER.reg" );
footprintMap.put("SPITZER_IRAC36", "footprint/Footprint_SPITZER.reg");
footprintMap.put("SPITZER_IRAC45", "footprint/Footprint_SPITZER.reg");
footprintMap.put("WFIRST", "footprint/Footprint_WFIRST.reg");
}

static public void addFootprint(String key, String path) {
footprintMap.put(key, path);
}

static public String getFootprint(String key) {
return footprintMap.get(key);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Time: 1:27 PM
*/


import edu.caltech.ipac.firefly.data.DataEntry;
import edu.caltech.ipac.firefly.data.ServerParams;
import edu.caltech.ipac.firefly.data.TableServerRequest;
import edu.caltech.ipac.firefly.data.table.TableMeta;
Expand All @@ -23,13 +23,17 @@
import edu.caltech.ipac.firefly.visualize.WebPlotRequest;
import edu.caltech.ipac.firefly.visualize.WebPlotResult;
import edu.caltech.ipac.firefly.visualize.draw.StaticDrawInfo;
import edu.caltech.ipac.util.FileUtil;
import edu.caltech.ipac.util.DataGroup;
import edu.caltech.ipac.visualize.plot.ImagePt;

import nom.tam.fits.FitsException;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;

import java.io.BufferedReader;
import java.io.IOException;
import java.net.URL;
import java.util.*;

/**
Expand Down Expand Up @@ -432,16 +436,22 @@ public String doCommand(Map<String, String[]> paramMap) throws IllegalArgumentEx
}

public static class DS9Region extends ServerCommandAccess.ServCommand {
private static final String footprintKey = "${footprintDef}";

public String doCommand(Map<String, String[]> paramMap) throws IllegalArgumentException {
SrvParam sp= new SrvParam(paramMap);
public String doCommand(Map<String, String[]> paramMap) throws IllegalArgumentException, IOException {
SrvParam sp = new SrvParam(paramMap);
String fileKey = sp.getRequired(ServerParams.FILE_KEY);
WebPlotResult result= VisServerOps.getDS9Region(fileKey);
WebPlotResult result;

if (fileKey.contains(footprintKey)) {
result = VisServerOps.getFootprintRegion(fileKey.substring(footprintKey.length()));
} else {
result = VisServerOps.getDS9Region(fileKey);
}
return WebPlotResultSerializer.createJson(result, sp.isJsonDeep());
}
}


public static class SaveDS9Region extends ServerCommandAccess.ServCommand {

public String doCommand(Map<String, String[]> paramMap) throws IllegalArgumentException {
Expand Down Expand Up @@ -473,9 +483,6 @@ public String doCommand(Map<String, String[]> paramMap) throws IllegalArgumentEx
}
}




//=============================================
//-------------- Utility Methods --------------
//=============================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@
import java.awt.geom.Rectangle2D;
import java.awt.image.IndexColorModel;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.ArrayList;
Expand All @@ -72,6 +75,7 @@
import static edu.caltech.ipac.visualize.draw.AreaStatisticsUtil.WhichReadout.LEFT;
import static edu.caltech.ipac.visualize.draw.AreaStatisticsUtil.WhichReadout.RIGHT;


/**
* User: roby
* Date: Aug 7, 2008
Expand Down Expand Up @@ -1434,10 +1438,47 @@ public static WebPlotResult getDS9Region(String fileKey) {
retval = createError("on getDSRegion", null, e);
}
return retval;

}


public static WebPlotResult getFootprintRegion(String fpInfo) {

List<String> rAsStrList = new ArrayList<String>();
List<String> msgList = new ArrayList<String>();
WebPlotResult retval = new WebPlotResult();
String fileName;

if ((fileName = (String)VisContext.getFootprint(fpInfo)) != null) {
int idx = fpInfo.indexOf('_');

String tag = idx >= 0 ? fpInfo.substring(idx + 1) : fpInfo;

try {
InputStream in = VisServerOps.class.getClassLoader().getResourceAsStream(fileName);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String tmpLine;

while ((tmpLine = br.readLine()) != null) {
tmpLine = tmpLine.trim();
if (!tmpLine.startsWith("#") && (tmpLine.contains("tag={" + tag)))
rAsStrList.add(tmpLine);
}
if (rAsStrList.size() == 0) {
msgList.add("no region is defined in the footprint file");
}
} catch (Exception e) {
retval = createError("on getFootprintRegion", null, e);
}
} else {
msgList.add("no footprint description file is found");
}
retval.putResult(WebPlotResult.REGION_DATA,
new DataEntry.Str(StringUtils.combineStringList(rAsStrList)));
retval.putResult(WebPlotResult.REGION_ERRORS,
new DataEntry.Str(StringUtils.combineStringList(msgList)));
return retval;
}

public static synchronized boolean addSavedRequest(String saveKey, WebPlotRequest request) {
Cache cache = UserCache.getInstance();
CacheKey key = new StringKey(saveKey);
Expand Down
13 changes: 11 additions & 2 deletions src/firefly/js/core/ReduxFlux.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ import DrawLayerCntlr, {makeDetachLayerActionCreator,
markerToolStartActionCreator,
markerToolMoveActionCreator,
markerToolEndActionCreator,
markerToolCreateLayerActionCreator} from '../visualize/DrawLayerCntlr.js';
markerToolCreateLayerActionCreator,
footprintCreateLayerActionCreator,
footprintStartActionCreator,
footprintMoveActionCreator,
footprintEndActionCreator} from '../visualize/DrawLayerCntlr.js';
import MultiViewCntlr, {IMAGE_MULTI_VIEW_KEY} from '../visualize/MultiViewCntlr.js';
import ComponentCntlr, {DIALOG_OR_COMPONENT_KEY} from '../core/ComponentCntlr.js';
import {masterSaga} from './MasterSaga.js';
Expand All @@ -56,6 +60,7 @@ import WebGrid from '../drawingLayers/WebGrid.js';

import RegionPlot from '../drawingLayers/RegionPlot.js';
import MarkerTool from '../drawingLayers/MarkerTool.js';
import FootprintTool from '../drawingLayers/FootprintTool.js';
import {showExampleDialog} from '../ui/ExampleDialog.jsx';

//==============
Expand All @@ -79,7 +84,7 @@ const actionCreators = new Map();

const drawLayerFactory= DrawLayerFactory.makeFactory(ActiveTarget,SelectArea,DistanceTool,
PointSelection, StatsPoint, NorthUpCompass,
Catalog, WebGrid, RegionPlot, MarkerTool);
Catalog, WebGrid, RegionPlot, MarkerTool, FootprintTool);



Expand Down Expand Up @@ -142,6 +147,10 @@ actionCreators.set(DrawLayerCntlr.MARKER_START, markerToolStartActionCreator);
actionCreators.set(DrawLayerCntlr.MARKER_MOVE, markerToolMoveActionCreator);
actionCreators.set(DrawLayerCntlr.MARKER_END, markerToolEndActionCreator);
actionCreators.set(DrawLayerCntlr.MARKER_CREATE, markerToolCreateLayerActionCreator);
actionCreators.set(DrawLayerCntlr.FOOTPRINT_CREATE, footprintCreateLayerActionCreator);
actionCreators.set(DrawLayerCntlr.FOOTPRINT_START, footprintStartActionCreator);
actionCreators.set(DrawLayerCntlr.FOOTPRINT_END, footprintEndActionCreator);
actionCreators.set(DrawLayerCntlr.FOOTPRINT_MOVE, footprintMoveActionCreator);

actionCreators.set(DrawLayerCntlr.REGION_CREATE_LAYER, regionCreateLayerActionCreator);
actionCreators.set(DrawLayerCntlr.REGION_DELETE_LAYER, regionDeleteLayerActionCreator);
Expand Down
Loading