Skip to content

Commit

Permalink
use argovis helper package for feature detection
Browse files Browse the repository at this point in the history
  • Loading branch information
billmills committed Nov 7, 2023
1 parent aaa3a27 commit bae870d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 301 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11
FROM python:3.9

RUN apt-get update -y ; apt-get install -y nano netcdf-bin
RUN pip install xarray netcdf4 numpy scipy pymongo shapely geopy
RUN pip install xarray netcdf4 numpy scipy pymongo shapely geopy argovisHelpers
296 changes: 0 additions & 296 deletions gridtools.py

This file was deleted.

6 changes: 3 additions & 3 deletions populate-AR.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import xarray, numpy, scipy, sys, datetime, copy, random, math
from pymongo import MongoClient
from collections import defaultdict
import gridtools
import argovisHelpers as avh
from functools import partial
from geopy import distance

Expand Down Expand Up @@ -127,7 +127,7 @@ def add_noise(mp):
ivt = ivts[timestep].to_numpy()

# label the ARs and make periodic on longitude boundary
labeled_map = gridtools.label_features(ar)
labeled_map = avh.gridtools.label_features(ar)
labels = numpy.unique(labeled_map)
for label in labels:
#for label in [1]:
Expand All @@ -143,7 +143,7 @@ def add_noise(mp):
vapors = [ [ivt[cells[0][i]][cells[1][i]]] for i in range(len(cells[0])) ]
raster = list(zip(lons, lats, vapors))

geo, flags = gridtools.generate_geojson(labeled_map, label, partial(index2coords, longitudes, latitudes), reverse_winding=True)
geo, flags = avh.gridtools.generate_geojson(labeled_map, label, partial(index2coords, longitudes, latitudes), reverse_winding=True)
flags = list(flags)
flags = ['south_pole' if x=='first_pole' else x for x in flags]
flags = ['north_pole' if x=='last_pole' else x for x in flags]
Expand Down

0 comments on commit bae870d

Please sign in to comment.