Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli_076_add_nrt_script #761

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
29 changes: 29 additions & 0 deletions cli_076_surface_temperature_monthly_avg/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM python:3.6
MAINTAINER Taufiq Rashid <taufiq.rashid@wri.org>
#Note this script was originally developed by Taufiq Rashid <taufiq.rashid@wri.org>

# install core libraries
RUN apt-get update
RUN pip install -U pip

# install application libraries
RUN apt-get install -y gdal-bin libgdal-dev
RUN apt-get -y install python-gdal
RUN pip install oauth2client==4.1.3
RUN pip install -e git+https://github.com/resource-watch/eeUtil/tree/fix/upgrade_version_gee#egg=eeUtil
RUN pip install netCDF4==1.5.3

# set name
ARG NAME=nrt-script
ENV NAME ${NAME}

# copy the application folder inside the container
RUN mkdir -p /opt/$NAME/data
WORKDIR /opt/$NAME/
COPY contents/ .

RUN useradd -r $NAME
RUN chown -R $NAME:$NAME /opt/$NAME
USER $NAME

CMD ["python", "main.py"]
13 changes: 13 additions & 0 deletions cli_076_surface_temperature_monthly_avg/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

## {Resource Watch Public Title} Dataset Near Real-time Script
This file describes the near real-time script that retrieves and processes the [Berkeley Earth Surface Temperature dataset](http://berkeleyearth.lbl.gov/auto/Global/Gridded/Gridded_README.txt) for [display on Resource Watch]({link to dataset's metadata page on Resource Watch}).

This dataset was provided by the source as a netcdf file. The data shown on Resource Watch can be found in the 'temperature' variable of the netcdf file. This variable was converted to a set of tif files so that it could be uploaded to Google Earth Engine. The netcdf file contained all the monthly temperature anomaly data since 1850. We are only interested in data going back to 1950. So, only the temperature data since 1950 were processed. To process this data for display on Resource Watch, all the monthly tif files were combined into yearly files to get an annual average temperature anomaly from 1950 till now.

Please see the [Python script]({link to Python script on Github}) for more details on this processing.

**Schedule**

This script is run monthly. The exact time that the script is run to update the dataset can be found in the the `time.cron` file. This time is in Coordinated Universal Time (UTC), expressed in cron format.

###### Note: This script was originally written by [Taufiq Rashid](https://www.wri.org/profile/taufiq-rashid), and is currently maintained by [Taufiq Rashid](https://www.wri.org/profile/taufiq-rashid).
4 changes: 4 additions & 0 deletions cli_076_surface_temperature_monthly_avg/contents/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env python3
if __name__ == '__main__':
import src
src.main()
Loading