Skip to content

Commit

Permalink
drought process is starting
Browse files Browse the repository at this point in the history
  • Loading branch information
nilshempelmann committed Jun 18, 2024
1 parent 1d98241 commit b625c0c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 24 deletions.
6 changes: 6 additions & 0 deletions .eggs/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
This directory contains eggs that were downloaded by setuptools to build, test, and run plug-ins.

This directory caches those eggs to prevent repeated downloads.

However, it is safe to delete this directory.

2 changes: 1 addition & 1 deletion albatross/climdiv_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""

import os
from atmos_ocean_data import *
from albatross.atmos_ocean_data import *
from os import environ as EV

def get_data(kwgroups):
Expand Down
54 changes: 31 additions & 23 deletions albatross/processes/wps_drought.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
from pywps import Process, LiteralInput, LiteralOutput
from pywps import Process, LiteralInput, LiteralOutput, ComplexOutput
from pywps import FORMATS, Format
from pywps.app.Common import Metadata

# general
import pandas as pd
from matplotlib import cm, pyplot as plt
import matplotlib as mpl
import numpy as np
import pydap.client
import mpl_toolkits
import csv
import math

# drought specific functions
from albatross.climdiv_data import *
from albatross.simpleNIPA import *
import albatross.atmos_ocean_data
# from albatross.atmos_ocean_data import *
from albatross.utils import sstMap
from albatross.utils import *


import logging
LOGGER = logging.getLogger("PYWPS")

FORMAT_PNG = Format("image/png", extension=".png", encoding="base64")


class Drought(Process):
"""A process to forecast precipitation."""
Expand All @@ -14,10 +36,10 @@ def __init__(self):
# keywords=['name', 'firstname'],
default = 'https://raw.githubusercontent.com/mxgiuliani00/CSI/master/NIPA/DATA/APGD_prcpComo.txt',
data_type='string'),
LiteralInput('sst', 'Monthly global sea surface temperature file',
abstract='??? netcdf file',
# keywords=['name', 'firstname'],
data_type='string'),
# LiteralInput('sst', 'Monthly global sea surface temperature file',
# abstract='text file of Sea surface temperature',
# # keywords=['name', 'firstname'],
# data_type='string'),
# LiteralInput('gph', 'Monthly global geopotential height file',
# abstract='??? netcdf file',
# # keywords=['name', 'firstname'],
Expand All @@ -34,15 +56,18 @@ def __init__(self):
LiteralInput('start_year', 'Start Year',
abstract='2020',
# keywords=['name', 'firstname'],
default = '2020',
data_type='string'),
LiteralInput('end_year', 'End Year',
abstract='2022',
default = '2022',
# keywords=['name', 'firstname'],
data_type='string'),
LiteralInput('bbox', 'Bounding Box',
abstract='bbox or other geometries',
# keywords=['name', 'firstname'],
data_type='string')
data_type='string',
default = '20,30,40,50',)
]
outputs = [
# LiteralOutput('negative_list', 'Negative List ...',
Expand Down Expand Up @@ -91,23 +116,6 @@ def _handler(request, response):
### original code https://github.com/mxgiuliani00/CSI/blob/master/NIPA/run_nipa.py
LOGGER.info("start processing")

# general
import pandas as pd
from matplotlib import cm, pyplot as plt
import matplotlib as mpl
import numpy as np
import pydap.client
import mpl_toolkits
import csv
import math

# drought specific functions
from climdiv_data import *
from simpleNIPA import *
from atmos_ocean_data import *
from utils import sstMap
from utils import *

###########################
LOGGER.info("Select the input-output files")

Expand Down
2 changes: 2 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ dependencies:
- jinja2
- click
- psutil
- pandas
- matplotlib
# tests
- pytest

0 comments on commit b625c0c

Please sign in to comment.