Closed Bobfrat closed 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?
Works for me now too. Thanks @rsignell-usgs
@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?
@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.
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?
@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
Which tip specifically got you going?
@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.
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.
Because no further work has been done on this scenario in about a month, I am closing this.
Progress: 1F Temperature
Successes
Figure 1: Time series plot of water temperature
Figure 2: Interactive map of the observation stations (CO-OPS stations are blue, NERACOOS buoys are purple) with WMS Sea Surface Temperature data overlaid.
Figure 3: Map shows all the observation stations within a bounding box along with COAWST model grid points.
Figure 4: Observed and modeled water temperature data.
Easy Challenges: Identified and Fixed
Longer-term Challenges Identified
None