Skip to content

Commit

Permalink
Merge pull request #86 from NASA-IMPACT/develop
Browse files Browse the repository at this point in the history
Release v0.3.2
  • Loading branch information
olafveerman authored Nov 30, 2020
2 parents a2e256b + c391bef commit 44a6d5a
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 9 deletions.
2 changes: 1 addition & 1 deletion covid_api/db/static/datasets/co2.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
]
}
},
Expand Down
10 changes: 5 additions & 5 deletions covid_api/db/static/datasets/nightlights-viirs.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
3 changes: 3 additions & 0 deletions covid_api/db/static/datasets/no2-diff.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions covid_api/db/static/datasets/no2.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion covid_api/db/static/datasets/recovery.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
]
},
"paint": {
"raster_opacity": 0.9
"raster-opacity": 0.9
},
"exclusiveWith": [
"agriculture",
Expand Down
2 changes: 1 addition & 1 deletion covid_api/db/static/datasets/slowdown.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
]
},
"paint": {
"raster_opacity": 0.9
"raster-opacity": 0.9
},
"exclusiveWith": [
"agriculture",
Expand Down
11 changes: 11 additions & 0 deletions covid_api/models/static.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 44a6d5a

Please sign in to comment.