diff --git a/covid_api/db/static/datasets/co2.json b/covid_api/db/static/datasets/co2.json index 41aeb85..002e373 100644 --- a/covid_api/db/static/datasets/co2.json +++ b/covid_api/db/static/datasets/co2.json @@ -34,7 +34,7 @@ "source": { "type": "raster", "tiles": [ - "{api_url}/{z}/{x}/{y}@1x?url=s3://covid-eo-data/xco2/xco2_16day_base.{date}.tif&resampling_method=bilinear&bidx=1&rescale=0.000408%2C0.000419&color_map=rdylbu_r&color_formula=gamma r {gamma}" + "{api_url}/{z}/{x}/{y}@1x?url=s3://covid-eo-data/xco2-base/xco2_16day_base.{date}.tif&resampling_method=bilinear&bidx=1&rescale=0.000408%2C0.000419&color_map=rdylbu_r&color_formula=gamma r {gamma}" ] } }, diff --git a/covid_api/db/static/datasets/nightlights-viirs.json b/covid_api/db/static/datasets/nightlights-viirs.json index 51e0d67..38c152c 100644 --- a/covid_api/db/static/datasets/nightlights-viirs.json +++ b/covid_api/db/static/datasets/nightlights-viirs.json @@ -34,11 +34,11 @@ "min": "less", "max": "more", "stops": [ - "#08041d", - "#1f0a46", - "#52076c", - "#f57c16", - "#f7cf39" + "#440357", + "#3b508a", + "#208f8c", + "#5fc961", + "#fde725" ] }, "info": "Darker colors indicate fewer night lights and less activity. Lighter colors indicate more night lights and more activity. Check out the HD dataset below to see a light-corrected version of this dataset." diff --git a/covid_api/db/static/datasets/no2-diff.json b/covid_api/db/static/datasets/no2-diff.json index b1691b7..4f71e91 100644 --- a/covid_api/db/static/datasets/no2-diff.json +++ b/covid_api/db/static/datasets/no2-diff.json @@ -11,6 +11,9 @@ "{api_url}/{z}/{x}/{y}@1x?url=s3://covid-eo-data/OMNO2d_HRMDifference/OMI_trno2_0.10x0.10_{date}_Col3_V4.nc.tif&resampling_method=bilinear&bidx=1&rescale=-8000000000000000%2C8000000000000000&color_map=rdbu_r" ] }, + "paint": { + "raster-opacity": 0.9 + }, "exclusive_with": [ "co2", "co2-diff", diff --git a/covid_api/db/static/datasets/no2.json b/covid_api/db/static/datasets/no2.json index 387e8ea..962abd6 100644 --- a/covid_api/db/static/datasets/no2.json +++ b/covid_api/db/static/datasets/no2.json @@ -11,6 +11,9 @@ "{api_url}/{z}/{x}/{y}@1x?url=s3://covid-eo-data/OMNO2d_HRM/OMI_trno2_0.10x0.10_{date}_Col3_V4.nc.tif&resampling_method=bilinear&bidx=1&rescale=0%2C1.5e16&color_map=custom_no2&color_formula=gamma r {gamma}" ] }, + "paint": { + "raster-opacity": 0.9 + }, "exclusive_with": [ "agriculture", "co2", diff --git a/covid_api/db/static/datasets/recovery.json b/covid_api/db/static/datasets/recovery.json index a6a6719..fd4980b 100644 --- a/covid_api/db/static/datasets/recovery.json +++ b/covid_api/db/static/datasets/recovery.json @@ -11,7 +11,7 @@ ] }, "paint": { - "raster_opacity": 0.9 + "raster-opacity": 0.9 }, "exclusiveWith": [ "agriculture", diff --git a/covid_api/db/static/datasets/slowdown.json b/covid_api/db/static/datasets/slowdown.json index 1e4df50..286dbbd 100644 --- a/covid_api/db/static/datasets/slowdown.json +++ b/covid_api/db/static/datasets/slowdown.json @@ -10,7 +10,7 @@ ] }, "paint": { - "raster_opacity": 0.9 + "raster-opacity": 0.9 }, "exclusiveWith": [ "agriculture", diff --git a/covid_api/models/static.py b/covid_api/models/static.py index d1d858d..646fbc1 100644 --- a/covid_api/models/static.py +++ b/covid_api/models/static.py @@ -69,11 +69,22 @@ class DatasetComparison(BaseModel): time_unit: Optional[str] +def snake_case_to_kebab_case(s): + """Util method to convert kebab-case fieldnames to snake_case.""" + return s.replace("_", "-") + + class Paint(BaseModel): """Paint Model.""" raster_opacity: int + class Config: + """Paint Model Config""" + + alias_generator = snake_case_to_kebab_case + allow_population_by_field_name = True + class Dataset(BaseModel): """Dataset Model.""" diff --git a/setup.py b/setup.py index a410946..5a557dd 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ setup( name="covid_api", - version="0.3.1", + version="0.3.2", description=u"", long_description=long_description, long_description_content_type="text/markdown",