Skip to content

Commit

Permalink
Merge pull request #435 from NASA-IMPACT/develop
Browse files Browse the repository at this point in the history
Version 1.6.2
  • Loading branch information
olafveerman authored Oct 19, 2020
2 parents 68a28aa + c2d451a commit e87316b
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 37 deletions.
43 changes: 12 additions & 31 deletions app/assets/scripts/components/common/layers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import slowdown from './layer-slowdown';
import waterChlorophyll from './layer-water-chlorophyll';
import waterSpm from './layer-water-spm';
import agriculture from './layer-agriculture';
import waterGlChl from './layer-wq-gl-chl';
import waterGlSpm from './layer-wq-gl-spm';
import detectionPlane from './layer-detection-plane';
import agTogo from './layer-togo-ag';

Expand All @@ -30,6 +32,8 @@ const layers = [
waterChlorophyll,
waterSpm,
agriculture,
waterGlChl,
waterGlSpm,
detectionPlane,
agTogo
];
Expand All @@ -44,7 +48,8 @@ const layersBySpotlight = {
sf: ['no2', 'no2-diff', 'co2', 'co2-diff', 'nightlights-hd', 'nightlights-viirs', 'agriculture', 'slowdown', 'recovery', 'detection-ship', 'detection-plane', 'water-chlorophyll', 'water-spm'],
tk: ['no2', 'no2-diff', 'co2', 'co2-diff', 'nightlights-hd', 'nightlights-viirs', 'recovery', 'detection-plane'],
ny: ['no2', 'no2-diff', 'co2', 'co2-diff', 'nightlights-hd', 'nightlights-viirs', 'slowdown', 'detection-ship', 'detection-plane', 'water-chlorophyll', 'water-spm', 'recovery'],
togo: ['togo-ag']
togo: ['togo-ag'],
wble: ['water-wq-gl-chl', 'water-wq-gl-spm']
};

const layerOverridesBySpotlight = {
Expand All @@ -70,7 +75,7 @@ const layerOverridesBySpotlight = {
}),
'detection-ship': (l, spotlightId) =>
handleInferenceTimeseries(l, spotlightId, {
domain: ['2020-01-22', '2020-02-02', '2020-02-03', '2020-02-27', '2020-02-29', '2020-03-03', '2020-03-08', '2020-03-15', '2020-03-21', '2020-03-22', '2020-03-27', '2020-04-23', '2020-04-24']
domain: ['2020-01-01', '2020-01-06', '2020-01-07', '2020-01-09', '2020-01-10', '2020-01-12', '2020-01-13', '2020-01-14', '2020-01-17', '2020-01-18', '2020-01-19', '2020-01-22', '2020-01-23', '2020-01-24', '2020-01-27', '2020-01-28', '2020-01-29', '2020-01-30', '2020-01-31', '2020-02-02', '2020-02-03', '2020-02-27', '2020-02-29', '2020-03-03', '2020-03-08', '2020-03-15', '2020-03-21', '2020-03-22', '2020-03-27', '2020-04-23', '2020-04-24', '2020-05-01', '2020-05-02', '2020-05-03', '2020-05-04', '2020-05-05', '2020-05-06', '2020-05-07', '2020-05-08', '2020-05-09', '2020-05-11', '2020-05-12', '2020-05-13', '2020-05-14', '2020-05-15', '2020-05-16', '2020-05-17', '2020-05-19', '2020-05-20', '2020-05-21']
}),
'detection-plane': (l, spotlightId) =>
handleInferenceTimeseries(l, spotlightId, {
Expand All @@ -81,7 +86,7 @@ const layerOverridesBySpotlight = {
'nightlights-viirs': handleNightlightsViirs,
'detection-ship': (l, spotlightId) =>
handleInferenceTimeseries(l, spotlightId, {
domain: ['2020-01-22', '2020-02-03', '2020-02-27', '2020-02-29', '2020-03-03', '2020-03-08', '2020-03-10', '2020-03-11', '2020-04-21']
domain: ['2020-01-02', '2020-01-03', '2020-01-05', '2020-01-07', '2020-01-10', '2020-01-11', '2020-01-12', '2020-01-13', '2020-01-14', '2020-01-17', '2020-01-18', '2020-01-23', '2020-01-27', '2020-01-30', '2020-01-31', '2020-05-01', '2020-05-03', '2020-05-04', '2020-05-05', '2020-05-06', '2020-05-07', '2020-05-08', '2020-01-02', '2020-01-03', '2020-01-05', '2020-01-07', '2020-01-10', '2020-01-11', '2020-01-12', '2020-01-13', '2020-01-14', '2020-01-17', '2020-01-18', '2020-01-22', '2020-01-23', '2020-01-27', '2020-01-30', '2020-01-31', '2020-02-03', '2020-02-27', '2020-02-29', '2020-03-03', '2020-03-08', '2020-03-10', '2020-03-11', '2020-04-21', '2020-05-01', '2020-05-03', '2020-05-04', '2020-05-05', '2020-05-06', '2020-05-07', '2020-05-08', '2020-05-09', '2020-05-15', '2020-05-16', '2020-05-17', '2020-05-19', '2020-05-20', '2020-05-21']
}),
'water-chlorophyll': (l, spotlightId) => {
return {
Expand Down Expand Up @@ -127,7 +132,7 @@ const layerOverridesBySpotlight = {
},
'detection-ship': (l, spotlightId) =>
handleInferenceTimeseries(l, spotlightId, {
domain: ['2020-01-20', '2020-01-21', '2020-01-22', '2020-02-02', '2020-02-03', '2020-02-29', '2020-03-08', '2020-03-18', '2020-03-22', '2020-03-27']
domain: ['2020-01-02', '2020-01-09', '2020-01-11', '2020-01-16', '2020-01-17', '2020-01-19', '2020-01-23', '2020-01-24', '2020-01-30', '2020-05-02', '2020-05-05', '2020-01-02', '2020-01-09', '2020-01-11', '2020-01-16', '2020-01-17', '2020-01-19', '2020-01-20', '2020-01-21', '2020-01-22', '2020-01-23', '2020-01-24', '2020-01-30', '2020-02-02', '2020-02-03', '2020-02-29', '2020-03-08', '2020-03-18', '2020-03-22', '2020-03-27', '2020-05-02', '2020-05-05', '2020-05-09', '2020-05-10', '2020-05-13', '2020-05-14', '2020-05-16', '2020-05-19', '2020-05-20', '2020-05-21']
}),
'water-spm': (l, spotlightId) => {
return {
Expand Down Expand Up @@ -193,36 +198,12 @@ function handleSpotlightId (l, spotlightId) {
}

function handleNightlightsViirs (l, spotlightId) {
const spotlightName = {
be: 'Beijing',
gh: 'EUPorts',
du: 'EUPorts',
la: 'LosAngeles',
ny: 'NewYork',
sf: 'SanFrancisco',
tk: 'Tokyo'
}[spotlightId];
const spotlightName = spotlightId === 'du' || spotlightId === 'gh'
? 'EUPorts'
: spotlightId;

return {
...l,
domain: l.domain.filter((d) => {
if (spotlightName === 'Beijing') {
const dates = ['2020-03-18'];
return !dates.includes(d);
} else if (spotlightName === 'EUPorts') {
const dates = [
'2020-05-05',
'2020-05-07',
'2020-05-11',
'2020-05-13',
'2020-05-16',
'2020-05-18',
'2020-05-19'
];
return !dates.includes(d);
}
return true;
}),
source: {
...l.source,
tiles: l.source.tiles.map((t) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
type: 'raster-timeseries',
timeUnit: 'day',
domain: [
'2020-01-28', '2020-02-28', '2020-03-28', '2020-04-28', '2020-05-28', '2020-06-28'
'2020-01-28', '2020-02-28', '2020-03-28', '2020-04-28', '2020-05-28', '2020-06-28', '2020-07-28', '2020-08-28', '2020-09-28'
],
source: {
type: 'raster',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ export default {
timeUnit: 'month',
domain: [
'2020-01-01',
'2020-07-01'
'2020-09-01'
],
source: {
type: 'raster',
tiles: [
`${config.api}/{z}/{x}/{y}@1x?url=s3://covid-eo-data/BMHD_30M_MONTHLY/BMHD_VNP46A2_{spotlightId}_{date}_cog.tif&resampling_method=bilinear&bidx=1%2C2%2C3`
`${config.api}/{z}/{x}/{y}@1x?url=s3://covid-eo-data/bmhd_30m_monthly/BMHD_VNP46A2_{spotlightId}_{date}_cog.tif&resampling_method=bilinear&bidx=1%2C2%2C3`
]
},
exclusiveWith: ['agriculture', 'no2', 'no2-diff', 'co2-diff', 'co2', 'gibs-population', 'car-count', 'nightlights-viirs', 'detection-ship', 'detection-multi', 'water-chlorophyll', 'water-spm'],
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions app/assets/scripts/components/common/layers/layer-wq-gl-chl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import config from '../../../config';

import { indicatorGroupColors } from '../../../styles/theme/theme.js';

export default {
id: 'water-wq-gl-chl',
name: 'Chlorophyll',
type: 'raster-timeseries',
domain: ['2020-01-01', '2020-01-08', '2020-01-15', '2020-01-22', '2020-01-29', '2020-02-05', '2020-02-12', '2020-02-19', '2020-02-26', '2020-03-04', '2020-03-11', '2020-03-18', '2020-03-25', '2020-04-01', '2020-04-08', '2020-04-15', '2020-04-22', '2020-04-29', '2020-05-06', '2020-05-13', '2020-05-20', '2020-05-27', '2020-06-03', '2020-06-10', '2020-06-17', '2020-06-24', '2020-07-01', '2020-07-08', '2020-07-15', '2020-07-22', '2020-07-29', '2020-08-05', '2020-08-12', '2020-08-19', '2020-08-26', '2020-09-02', '2020-09-09', '2020-09-16', '2020-09-23'],
timeUnit: 'day',
source: {
type: 'raster',
tiles: [
`${config.api}/{z}/{x}/{y}@1x?url=s3://covid-eo-data/wq-greatlakes-chl/chl_anomaly_greatlakes_{date}.tif&resampling_method=bilinear&bidx=1&rescale=-100%2C100&color_map=rdbu_r`
]
},
exclusiveWith: ['water-wq-gl-spm'],
swatch: indicatorGroupColors['water-quality'],
legend: {
type: 'gradient',
min: 'less',
max: 'more',
stops: [
'#3A88BD',
'#C9E0ED',
'#E4EEF3',
'#FDDCC9',
'#DE725B',
'#67001F'
]
},
info: 'Chlorophyll is an indicator of algae growth. Redder colors indicate increases in chlorophyll-a and worse water quality. Bluer colors indicate decreases in chlorophyll-a and improved water quality. White areas indicate no change.'
};
33 changes: 33 additions & 0 deletions app/assets/scripts/components/common/layers/layer-wq-gl-spm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import config from '../../../config';

import { indicatorGroupColors } from '../../../styles/theme/theme.js';

export default {
id: 'water-wq-gl-spm',
name: 'Turbidity',
type: 'raster-timeseries',
domain: ['2020-01-01', '2020-01-08', '2020-01-15', '2020-01-22', '2020-01-29', '2020-02-05', '2020-02-12', '2020-02-19', '2020-02-26', '2020-03-04', '2020-03-11', '2020-03-18', '2020-03-25', '2020-04-01', '2020-04-08', '2020-04-15', '2020-04-22', '2020-04-29', '2020-05-06', '2020-05-13', '2020-05-20', '2020-05-27', '2020-06-03', '2020-06-10', '2020-06-17', '2020-06-24', '2020-07-01', '2020-07-08', '2020-07-15', '2020-07-22', '2020-07-29', '2020-08-05', '2020-08-12', '2020-08-19', '2020-08-26', '2020-09-02', '2020-09-09', '2020-09-16', '2020-09-23'],
timeUnit: 'day',
source: {
type: 'raster',
tiles: [
`${config.api}/{z}/{x}/{y}@1x?url=s3://covid-eo-data/wq-greatlakes-sm/sm_anomaly_greatlakes_{date}.tif&resampling_method=bilinear&bidx=1&rescale=-100%2C100&color_map=rdbu_r`
]
},
exclusiveWith: ['water-wq-gl-chl'],
swatch: indicatorGroupColors['water-quality'],
legend: {
type: 'gradient',
min: 'less',
max: 'more',
stops: [
'#3A88BD',
'#C9E0ED',
'#E4EEF3',
'#FDDCC9',
'#DE725B',
'#67001F'
]
},
info: 'Turbidity refers to the amount of sediment or particles suspended in water. Darker colors indicate more sediment and murkier water. Lighter colors indicate less sediment and clearer water.'
};
Loading

0 comments on commit e87316b

Please sign in to comment.