Changeset 561
- Timestamp:
- 09/28/12 15:23:24 (12 years ago)
- Location:
- ether_megapoli/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
ether_megapoli/trunk/service/implementation/com/ether/EtherPlotContentServiceImpl.java
r559 r561 267 267 final SGTMetaData yMeta = new SGTMetaData( bundle.getString( "plot.latitude" ), bundle.getString( "plot.degres" ) ); 268 268 269 // TODO : use layers instead of add real data to simulated data 269 270 if( megapoliPlot.isRealDataToDisplay() && null != megapoliPlot.getRealData() ) 270 271 { … … 285 286 final Double min = Collections.min( parameterValues ); 286 287 final Double max = Collections.max( parameterValues ); 287 final Double delta = ( max - min ) / _numberOfCo lorsFor2D;288 final Double delta = ( max - min ) / _numberOfContoursForSimulation; 288 289 final Range2D datar = new Range2D( min, max, delta ); 289 290 final ContourLevels clevels = ContourLevels.getDefault( datar ); 290 final ColorMap cmap = createColorMap( datar, 200);291 final ColorMap cmap = createColorMap( datar, _numberOfColorsForSimulation ); 291 292 292 293 // Create a gridAttribute for contour data … … 852 853 protected Integer _intervalsNumber = 10; 853 854 protected Integer _numberOfColorsFor2D = 64; 855 protected Integer _numberOfColorsForSimulation = 200; 856 protected Integer _numberOfContoursForSimulation = 15; 854 857 855 858 private EtherService _etherService; -
ether_megapoli/trunk/service/implementation/com/ether/EtherPlotServiceImpl.java
r557 r561 294 294 final BufferedImage jPaneBufferedImage = new BufferedImage( jPane.getWidth(), jPane.getHeight(), BufferedImage.TYPE_INT_ARGB ); 295 295 final Graphics2D graphics2D = jPaneBufferedImage.createGraphics(); 296 final Font font = new Font( "Helvetica", Font.PLAIN, 8 ); 297 graphics2D.setFont( font ); 296 298 jPane.addNotify(); 297 299 jPane.validate(); -
ether_megapoli/trunk/service/implementation/com/ether/EtherServiceImpl.java
r559 r561 1014 1014 1015 1015 /** 1016 * This method reduce the simulated date in the same geographic map of the real data 1016 * This method reduce the geographic map of the simulated data to the geographic map of the real data 1017 * We extract only the simulated data which are in the geographic map of the real data 1017 1018 * 1018 1019 * @param allParameterValues … … 1064 1065 } 1065 1066 1067 /** 1068 * This method flip the list 1069 * We need this operation because the ploting is lon0[lat0,lat1,lat2], lon1[lat0,lat1,lat2]... and the values extract from the file are given as lat0[lon0,lon1], lat1[lon0, lon1], lat2[lon0,lon1]... 1070 * 1071 * @param list 1072 * @param sizeLatitude 1073 * @param sizeLongitude 1074 * @return 1075 */ 1076 @NotNull 1077 public List<Double> flipList( @NotNull final List<Double> list, @NotNull final Integer sizeLatitude, @NotNull final Integer sizeLongitude ) 1078 { 1079 final List<Double> flipedList = new ArrayList<Double>( list.size() ); 1080 for( int lon = 0; lon < sizeLongitude; lon++ ) 1081 for( int lat = 0; lat < sizeLatitude; lat++ ) 1082 { 1083 flipedList.add( list.get( lon + lat * sizeLongitude ) ); 1084 } 1085 return flipedList; 1086 } 1087 1066 1088 @Nullable 1067 1089 private Integer getNearestIndex( @NotNull final List<Double> list, @NotNull final Double value, final boolean isForMinimum ) -
ether_megapoli/trunk/service/implementation/gov/noaa/pmel/sgt/GridCartesianRenderer.java
r560 r561 213 213 else 214 214 { 215 // VMIPSL 216 if( ( (SimpleGrid) grid_ ).isFullGridForRasterContour() ) 215 for( xLon = 0; xLon < xSize; xLon++ ) 217 216 { 218 217 for( yLat = 0; yLat < ySize; yLat++ ) 219 218 { 220 for( xLon = 0; xLon < xSize; xLon++ ) 221 { 222 val = gValues[count]; 223 if( !Double.isNaN( val ) ) 224 { 225 color = attr_.getColorMap().getColor( val ); 226 g.setColor( color ); 227 drawRect( g, xp[xLon], yp[yLat], xp[xLon + 1], yp[yLat + 1] ); 228 } 229 count++; 230 } 231 } 232 } 233 else 234 { 235 for( xLon = 0; xLon < xSize; xLon++ ) 236 { 237 for( yLat = 0; yLat < ySize; yLat++ ) 238 { 239 val = gValues[count]; 240 if( !Double.isNaN( val ) ) 241 { 242 color = attr_.getColorMap().getColor( val ); 243 g.setColor( color ); 244 drawRect( g, xp[xLon], yp[yLat], xp[xLon + 1], yp[yLat + 1] ); 245 } 246 count++; 247 } 219 val = gValues[count]; 220 if( !Double.isNaN( val ) ) 221 { 222 color = attr_.getColorMap().getColor( val ); 223 g.setColor( color ); 224 drawRect( g, xp[xLon], yp[yLat], xp[xLon + 1], yp[yLat + 1] ); 225 } 226 count++; 248 227 } 249 228 } -
ether_megapoli/trunk/service/implementation/gov/noaa/pmel/sgt/contour/ContourLine.java
r192 r561 13 13 package gov.noaa.pmel.sgt.contour; 14 14 15 import java.util.Vector; 16 import java.util.Enumeration; 17 18 import java.awt.Graphics; 19 import java.awt.Color; 20 15 import gov.noaa.pmel.sgt.CartesianGraph; 21 16 import gov.noaa.pmel.sgt.ContourLineAttribute; 22 17 import gov.noaa.pmel.sgt.DefaultContourLineAttribute; 18 import gov.noaa.pmel.sgt.JPane; 19 import gov.noaa.pmel.sgt.LayerNotFoundException; 20 import gov.noaa.pmel.sgt.LineAttribute; 23 21 import gov.noaa.pmel.sgt.SGLabel; 24 import gov.noaa.pmel.sgt.LayerNotFoundException;25 import gov.noaa.pmel.sgt.CartesianGraph;26 import gov.noaa.pmel.sgt.JPane;27 import gov.noaa.pmel.sgt.LineAttribute;28 22 import gov.noaa.pmel.sgt.StrokeDrawer; 29 23 import gov.noaa.pmel.util.GeoDate; 30 24 import gov.noaa.pmel.util.Point2D; 31 import gov.noaa.pmel.util.GeoDate; 25 26 import java.awt.*; 27 import java.util.Enumeration; 28 import java.util.Vector; 32 29 33 30 /** … … 314 311 label.setAngle(angle); 315 312 label.setLocationP(new Point2D.Double(xlab, ylab)); 313 // VMIPSL 314 label.setFont( g.getFont() ); 316 315 try { 317 316 label.draw(g); -
ether_megapoli/trunk/service/interface/com/ether/EtherService.java
r559 r561 238 238 @NotNull 239 239 Data makeZoom( @NotNull final List<Double> allParameterValues, @NotNull final List<Double> allLatitudeValues, @NotNull final List<Double> allLongitudeValues, @Nullable final Data realData ); 240 241 @NotNull 242 List<Double> flipList( @NotNull final List<Double> list, @NotNull final Integer sizeLatitude, @NotNull final Integer sizeLongitude ); 240 243 } -
ether_megapoli/trunk/web/src/com/ether/ControllerSimulationPlot.java
r559 r561 85 85 megapoliPlot.setRealDataToDisplay( displayRealData ); 86 86 87 if( displayRealData && null != plateformId ) 87 // Extract simulated values from file 88 final List<Double> allParameterValues = _etherService.extractValuesByModelByVariableByDateByLevelFromFile( megapoliPlot.getModelId(), megapoliPlot.getVariableName(), dateNumber, level, true ); 89 final List<Double> allLatitudeValues = _etherService.extractValuesByModelByVariableByDateByLevelFromFile( megapoliPlot.getModelId(), "lat", dateNumber, level, true ); 90 final List<Double> allLongitudeValues = _etherService.extractValuesByModelByVariableByDateByLevelFromFile( megapoliPlot.getModelId(), "lon", dateNumber, level, true ); 91 92 // Extract real data from database 93 if( megapoliPlot.isRealDataToDisplay() && null != plateformId ) 88 94 { 89 95 final Integer parameterId = _etherService.getParameterByCode( variableName ); … … 100 106 } 101 107 102 final List<Double> allParameterValues = _etherService.extractValuesByModelByVariableByDateByLevelFromFile( megapoliPlot.getModelId(), megapoliPlot.getVariableName(), dateNumber, level, true ); 103 final List<Double> allLatitudeValues = _etherService.extractValuesByModelByVariableByDateByLevelFromFile( megapoliPlot.getModelId(), "lat", dateNumber, level, true ); 104 final List<Double> allLongitudeValues = _etherService.extractValuesByModelByVariableByDateByLevelFromFile( megapoliPlot.getModelId(), "lon", dateNumber, level, true ); 105 106 // If we have to display the real data, we need probably to zoom all the data on the same geographic map 108 // If we have to display the real data, we need probably to zoom all the data on the same geographic map, otherwise we keep all values 107 109 final Data allZoomedData = _etherService.makeZoom( allParameterValues, allLatitudeValues, allLongitudeValues, megapoliPlot.getRealData() ); 108 109 110 final List<Double> parameterValues = (List<Double>) allZoomedData.getFirstArray(); 110 111 final List<Double> latitudeValues = (List<Double>) allZoomedData.getSecondArray(); … … 112 113 113 114 final Data valuesLists; 115 // If we display the contours, the latitudes and longitudes must contain only unique value, we remove the duplicated values 114 116 if( isRasterContour ) 115 117 { 116 118 final Set<Double> latitudeValuesSet = new LinkedHashSet<Double>( latitudeValues ); 117 119 final Set<Double> longitudeValuesSet = new LinkedHashSet<Double>( longitudeValues ); 118 valuesLists = new Data( parameterValues, new ArrayList<Double>( latitudeValuesSet ), new ArrayList<Double>( longitudeValuesSet ) ); 120 // We have to flip the parameter values 121 final List<Double> flipedParameterValues = _etherService.flipList( parameterValues, latitudeValuesSet.size(), longitudeValuesSet.size() ); 122 valuesLists = new Data( flipedParameterValues, new ArrayList<Double>( latitudeValuesSet ), new ArrayList<Double>( longitudeValuesSet ) ); 119 123 } 120 124 else 121 125 valuesLists = new Data( parameterValues, new ArrayList<Double>( latitudeValues ), new ArrayList<Double>( longitudeValues ) ); 126 122 127 megapoliPlot.setData( valuesLists ); 123 128 megapoliPlot.setValuesNumber( parameterValues.size() ); -
ether_megapoli/trunk/web/visualization/visu_simulation-script.jsp
r557 r561 190 190 this.selectedVariable = false; 191 191 192 // Unselect old plateform 193 this.selectPlateforms = false; 194 192 195 // Change title 193 196 $( "#textareaTitle" ).html( this.selectedModel.getName() + " _ " + this.selectedModel.jsonElement.version ); … … 210 213 this.selectedVariable = objVariable; 211 214 this.selectedVariable.select(); 215 216 // Unselect old plateform 217 this.selectPlateforms = false; 212 218 213 219 // Change title
Note: See TracChangeset
for help on using the changeset viewer.