ioos / system-test

IOOS DMAC System Integration Test project
github.com/ioos/system-test/wiki
The Unlicense
7 stars 14 forks source link

Scenario 1F Water Temperature Progress #181

Closed Bobfrat closed 9 years ago

Bobfrat commented 9 years ago

Progress: 1F Temperature

Successes

screen shot 2014-09-29 at 11 14 20 am

Figure 1: Time series plot of water temperature

screen shot 2014-09-29 at 11 14 05 am

Figure 2: Interactive map of the observation stations (CO-OPS stations are blue, NERACOOS buoys are purple) with WMS Sea Surface Temperature data overlaid.

screen shot 2014-09-29 at 11 20 17 am

Figure 3: Map shows all the observation stations within a bounding box along with COAWST model grid points.

screen shot 2014-10-02 at 3 23 46 pm

Figure 4: Observed and modeled water temperature data.

Easy Challenges: Identified and Fixed

None

rsignell-usgs commented 9 years ago

@bobfrat, in regard to the longer-term challenge of USEAST not working, this works for me:

import iris
url='http://omgsrv1.meas.ncsu.edu:8080/thredds/dodsC/fmrc/us_east/US_East_Forecast_Model_Run_Collection_best.ncd'
var='sea_water_potential_temperature'
cube = iris.load_cube(url,var)

does that work for you, or is there another problem?

Bobfrat commented 9 years ago

Works for me now too. Thanks @rsignell-usgs

rsignell-usgs commented 9 years ago

@Bobfrat , the issue with Iris loading elevation values from FVCOM should have been fixed here: https://github.com/SciTools/iris/issues/1084, https://github.com/SciTools/iris/pull/1159

I notice that you have

iris.FUTURE.netcdf_promote = True

commented out in the code. Does it work if you uncomment it?

ocefpaf commented 9 years ago

@rsignell-usgs I think @Bobfrat meant 2D sigma_coordinates and not 2 sigma coordinates, right? If that is the case it is not solved by iris.FUTURE.netcdf_promote = True. But maybe this can help:

def z_coord(cube):
    """Heuristic way to return the dimensionless vertical coordinate."""
    try:
        z = cube.coord(axis='Z')
    except CoordinateNotFoundError:
        z = cube.coords(axis='Z')
        for coord in cube.coords(axis='Z'):
            if coord.ndim == 1:
                z = coord
    return z

z = z_coord(cube)
if z:
    positive = z.attributes.get('positive', None)
    if positive == 'up':
        idx = np.unique(z.points.argmax(axis=0))[0]
    else:
        idx = np.unique(z.points.argmin(axis=0))[0]
    c = cube[idx, ...].copy()
else:
    idx = None

Let me know if that works for you, I have not test it extensively yet.

Bobfrat commented 9 years ago

iris.FUTURE.netcdf_promote = True does not work for me because I am currently using iris 1.6.0. I can install iris 1.7.0 (on Mac OSX 10.7.5) but I get an import error: ImportError: No module named iris. I thought it might be tied to UDUNITS but i made sure to set the environmental variable. Any advice?

Bobfrat commented 9 years ago

@rsignell-usgs, @ocefpaf thanks for the tips. I upgraded Iris and now FVCOM can be extracted. http://nbviewer.ipython.org/github/Bobfrat/system-test/blob/temp_nb/Theme_1_Baseline/Scenario_1F_Temperature/Temperature.ipynb

rsignell-usgs commented 9 years ago

Which tip specifically got you going?

rsignell-usgs commented 9 years ago

@Bobfrat , I just noticed that it appears that this notebook pulls observational temperatures from various depths, but does not use those depths to extract data from the model. The data from the model seems always to be the surface temperature.

If this is correct, then it's no wonder some of the comparisons are poor. We should be interpolating the vertical temperature profile at the [i,j] grid cell, or at least picking the closest layer.

Bobfrat commented 9 years ago

Adding @ocefpaf 's method seemed to do the trick.

Great point about the depths... I suppose I'll need to do a DescribeSensor request for each of the stations to get the depth.

jkupiec commented 9 years ago

Because no further work has been done on this scenario in about a month, I am closing this.