Closed Casthardi closed 4 years ago
Hey @Casthardi! This is because the variables I cannot find the bounds for these variables and therefore it does not recognize this as a variable that can be displayed in a 2D plot. Look at FR_LAND
for instance, it's
float FR_LAND(cell) ;
FR_LAND:standard_name = "land_area_fraction" ;
FR_LAND:long_name = "Land Use Class Fraction" ;
where it should be
float FR_LAND(cell) ;
FR_LAND:standard_name = "land_area_fraction" ;
FR_LAND:long_name = "Land Use Class Fraction" ;
FR_LAND:coordinates = "clon clat" ;
Additionally, there are no bounds
specified for clon
and clat
. They should look like
float clat(cell) ;
clat:standard_name = "grid latitude" ;
clat:long_name = "latitude of icon grid cell centre" ;
clat:units = "radians" ;
clat:bounds = "clat_bnds" ;
where clat_bnds
is a 2D variable with
double clat_bnds(cell, nv) ;
Without this variable, the data cannot be displayed correctly
Does this solve your issue?
Half. The plot2d option works, however, the mapplot option gives the following error message:
'Gridliner' object has no attribute 'xlabel_artists'
Traceback (most recent call last):
File "/Users/rockel/opt/miniconda3/envs/psy-view/lib/python3.8/site-packages/psy_view/ds_widget.py", line 577, in func
self.make_plot()
File "/Users/rockel/opt/miniconda3/envs/psy-view/lib/python3.8/site-packages/psy_view/ds_widget.py", line 779, in make_plot
self.sp = sp = self.plot(name=self.variable, **self.plot_options)
File "/Users/rockel/opt/miniconda3/envs/psy-view/lib/python3.8/site-packages/psyplot/project.py", line 1960, in __call__
return super(DatasetPlotterInterface, self).__call__(*args, **kwargs)
File "/Users/rockel/opt/miniconda3/envs/psy-view/lib/python3.8/site-packages/psyplot/project.py", line 1763, in __call__
return self._project_plotter._add_data(
File "/Users/rockel/opt/miniconda3/envs/psy-view/lib/python3.8/site-packages/psyplot/project.py", line 2002, in _add_data
return super(DatasetPlotter, self)._add_data(plotter_cls, self._ds,
File "/Users/rockel/opt/miniconda3/envs/psy-view/lib/python3.8/site-packages/psyplot/project.py", line 1572, in _add_data
return self.project._add_data(*args, **kwargs)
File "/Users/rockel/opt/miniconda3/envs/psy-view/lib/python3.8/site-packages/psyplot/project.py", line 153, in wrapper
return func(self, *args, **kwargs)
File "/Users/rockel/opt/miniconda3/envs/psy-view/lib/python3.8/site-packages/psyplot/project.py", line 602, in _add_data
plotter_cls(arr, make_plot=(not bool(share) and make_plot),
File "/Users/rockel/opt/miniconda3/envs/psy-view/lib/python3.8/site-packages/psyplot/plotter.py", line 1201, in __init__
self.initialize_plot(data, ax=ax, draw=draw, clear=clear,
File "/Users/rockel/opt/miniconda3/envs/psy-view/lib/python3.8/site-packages/psyplot/plotter.py", line 1359, in initialize_plot
self._plot_by_priority(fmto_priority, grouper,
File "/Users/rockel/opt/miniconda3/envs/psy-view/lib/python3.8/site-packages/psyplot/plotter.py", line 1560, in _plot_by_priority
update(fmto)
File "/Users/rockel/opt/miniconda3/envs/psy-view/lib/python3.8/site-packages/psyplot/plotter.py", line 1543, in update
fmto.initialize_plot(fmto.value)
File "/Users/rockel/opt/miniconda3/envs/psy-view/lib/python3.8/site-packages/psyplot/plotter.py", line 636, in initialize_plot
self.update(value, *args, **kwargs)
File "/Users/rockel/opt/miniconda3/envs/psy-view/lib/python3.8/site-packages/psy_maps/plotters.py", line 1302, in update
for text in chain(gl.xlabel_artists, gl.ylabel_artists):
AttributeError: 'Gridliner' object has no attribute 'xlabel_artists'
The ncdump of the file is
dimensions:
time = UNLIMITED ; // (12 currently)
cell = 28192 ;
nv = 3 ;
variables:
float ALB(time, cell) ;
ALB:standard_name = "Albedo" ;
ALB:long_name = "Albedo" ;
ALB:units = "%" ;
ALB:coordinates = "clon clat" ;
float FR_LAND(cell) ;
FR_LAND:standard_name = "land_area_fraction" ;
FR_LAND:long_name = "Land Use Class Fraction" ;
FR_LAND:coordinates = "clon clat" ;
float clat(cell) ;
clat:standard_name = "grid latitude" ;
clat:long_name = "latitude of icon grid cell centre" ;
clat:units = "radians" ;
clat:bounds = "clat_vertices" ;
float clon(cell) ;
clon:standard_name = "grid longitude" ;
clon:long_name = "longitude of icon grid cell centre" ;
clon:units = "radians" ;
clon:bounds = "clon_vertices" ;
float time(time) ;
double clat_vertices(cell, nv) ;
clat_vertices:units = "radian" ;
double clon_vertices(cell, nv) ;
clon_vertices:units = "radian" ;
Still anything missing?
Hmm, no, this is something different. Could you paste the output of psyplot -aV
please?
psyplot -aV
psy_maps.plugin:
requirements:
cartopy: 0.18.0
version: 1.2.1.dev0
psy_simple.plugin:
version: 1.2.1.dev0
psyplot:
requirements:
matplotlib: 3.2.1
numpy: 1.18.1
pandas: 1.0.3
python: 3.8.2 | packaged by conda-forge | (default, Apr 24 2020, 07:56:27) [Clang
9.0.1 ]
xarray: 0.15.1
version: 1.2.2.dev0
psyplot_gui:
requirements:
pyqt: 5.12.3
qt: 5.12.5
qtconsole: 4.7.3
version: 1.2.5.dev0
Alright, there has just been a new release of cartopy with some larger changes to the gridliner API (https://github.com/SciTools/cartopy/pull/1117). I'll fix this is psy-maps and transfer this issue
The following file works:
netcdf icon_ocean_area {
dimensions:
cell = 28192 ;
nv = 3 ;
variables:
float FR_LAND(cell) ;
FR_LAND:standard_name = "land_area_fraction" ;
FR_LAND:long_name = "Land area fraction" ;
FR_LAND:CDI_grid_type = "unstructured" ;
FR_LAND:_FillValue = -9.e+33f ;
FR_LAND:missing_value = -9.e+33f ;
FR_LAND:coordinates = "clon clat" ;
float clat(cell) ;
clat:bounds = "clat_bnds" ;
clat:long_name = "center latitude" ;
clat:standard_name = "grid_latitude" ;
clat:units = "radian" ;
float clat_bnds(cell, nv) ;
clat_bnds:units = "radian" ;
float clon(cell) ;
clon:bounds = "clon_bnds" ;
clon:long_name = "center longitude" ;
clon:standard_name = "grid_longitude" ;
clon:units = "radian" ;
float clon_bnds(cell, nv) ;
clon_bnds:units = "radian" ;
// global attributes:
:CDI = "Climate Data Interface version 1.9.5 (http://mpimet.mpg.de/cdi)" ;
:Conventions = "CF-1.6" ;
:history = "Tue May 05 15:08:07 2020: cdo -s setrtoc,0,0.5,1 -setrtomiss,0.5,1 -selvar,FR_LAND /Users/rockel/work/iclm-sp/post/input/extpar_EU-R02B06_DOM01.nc /Users/rockel/work/iclm-sp/post/output/icon_ocean_area.nc" ;
:number_of_grid_used = 80 ;
:uuidOfHGrid = "36fc23a6-a93f-0390-6ece-da4a05942620" ;
:institution = "Deutscher Wetterdienst" ;
:title = "external parameter" ;
:rawdata = "GLOBCOVER2009, FAO DSMW, GLOBE, Lake Database" ;
:note = "Landuse data look-up table: Asensio_2011" ;
:NCO = "4.4.2" ;
:library_name = " extpar" ;
:tag_name = " V2_7" ;
:bin_dir = "/usr/local/pkg/for0adm/abs/" ;
:revision_number = " 49" ;
:checkin_date = " 2017-07-06 10" ;
:code_modified = " .false." ;
:compile_date = " 2017-11-29 09" ;
:compiled_by = " for0adm" ;
:compiled_on = " Linux lce01 3.0.101-0.47.102-default #1 SMP Tue Jun 6 10" ;
:start_time = " 2018-02-07 15" ;
:tile_mode = "1" ;
:grib_md5sum = "49c8f287ed64214052dd6da5be52098b */lustre2/gtmp/for0exp/.jtmp.lce20.20180207.151242.2436/extparicon_workdir/EU-R02B06_DOM01.extpar.g2" ;
:CDO = "Climate Data Operators version 1.9.5 (http://mpimet.mpg.de/cdo)" ;
}
and the old one is still not working?
Hmm, the old one works now, too. I have no idea why.
Hmm, alright :smile_cat:
Using ICON netCDF files where some variables have no time dimension, these variables are greyed out and cannot be displayed. See screenshot and attached nbetCDF file
extpar_EU-R02B06_DOM01.nc.zip