Hi,
I am trying to read data from a netcdf file. But I am getting an
"java.lang.IllegalArgumentException: Illegal axis type null" error message.
Our application java code is as follows:
AxisType axisType = axis1D.getAxisType();
if (axisType == AxisType.Lon || axisType == AxisType.Lat ||
axisType == AxisType.GeoX || axisType == AxisType.GeoY)
{
OneDCoordAxis theAxis = null;
if (axis1D.isRegular())
{
theAxis = new Regular1DCoordAxis(axis1D.getStart(),
axis1D.getIncrement(), (int)axis1D.getSize(), axisType);
}
else
{
theAxis = new
Irregular1DCoordAxis(axis1D.getCoordValues(), axisType);
}
return theAxis;
}
else
{
throw new IllegalArgumentException("Illegal axis type " +
axisType);
}
I have attached the dataset metadata. Could you please advise?
Cheers,
Adit
netcdf {
dimensions:
x = 609;
y = 881;
depth = 12;
time = 717;
variables:
int polar_stereographic;
:grid_mapping_name = "polar_stereographic";
:latitude_of_projection_origin = 90.0; // double
:longitude_of_projection_origin = 45.0; // double
:scale_factor_at_projection_origin = 1.0; // double
:false_easting = 0.0; // double
:false_northing = 0.0; // double
float x(x=609);
:axis = "X";
:standard_name = "projection_x_coordinate";
:units = "100 km";
float y(y=881);
:standard_name = "projection_y_coordinate";
:axis = "Y";
float depth(depth=12);
:long_name = "depth";
:units = "m";
:valid_range = 0.0, 3001.0; // double
:standard_name = "depth";
:positive = "down";
:axis = "Z";
int time(time=717);
:units = "secs since 1970-01-01 00:00:00";
:long_name = "forecast time";
:_CoordinateAxisType = "time";
float longitude(y=881, x=609);
:_CoordinateAxes = "y x ";
:units = "degrees";
:valid_range = -180.0, 180.0; // double
:long_name = "longitude";
:missing_value = -1.0E14; // double
float latitude(y=881, x=609);
:_CoordinateAxes = "y x ";
:units = "degrees";
:valid_range = -90.0, 90.0; // double
:standard_name = "latitude";
:long_name = "latitude";
:missing_value = -1.0E14; // double
float model_depth(y=881, x=609);
:_CoordinateAxes = "longitude latitude y x ";
:units = "meters";
:valid_range = 0.0, 9000.0; // double
:long_name = "model_depth";
:missing_value = -1.0E14; // double
:standard_name = "sea_floor_depth_below_sea_level";
:coordinates = "longitude latitude";
double fwflux(y=881, x=609);
:_CoordinateAxes = "longitude latitude y x ";
:missing_value = -32767s; // short
:_FillValue = -32767.0; // double
:long_name = "Freshwater flux into ocean";
:units = "kg m-2 s-1";
:standard_name = "water_flux_into_ocean";
:grid_mapping = "polar_stereographic";
:coordinates = "longitude latitude";
:cell_methods = "lat: lon: time: mean";
double temperature(time=717, depth=12, y=881, x=609);
:_CoordinateAxes = "longitude latitude time depth y x ";
:missing_value = -32767s; // short
:_FillValue = -32767.0; // double
:long_name = "Potential temperature of sea water";
:units = "degrees_celsius";
:standard_name = "sea_water_potential_temperature";
:grid_mapping = "polar_stereographic";
:coordinates = "longitude latitude";
:cell_methods = "lat: lon: time: mean";
double salinity(time=717, depth=12, y=881, x=609);
:_CoordinateAxes = "longitude latitude time depth y x ";
:missing_value = -32767s; // short
:_FillValue = -32767.0; // double
:long_name = "Salinity of sea water";
:units = "psu";
:standard_name = "sea_water_salinity";
:grid_mapping = "polar_stereographic";
:coordinates = "longitude latitude";
:cell_methods = "lat: lon: time: mean";
double u(time=717, depth=12, y=881, x=609);
:_CoordinateAxes = "longitude latitude time depth y x ";
:missing_value = -32767s; // short
:_FillValue = -32767.0; // double
:long_name = "X velocity component of sea water";
:units = "m s-1";
:standard_name = "x_sea_water_velocity";
:grid_mapping = "polar_stereographic";
:coordinates = "longitude latitude";
:cell_methods = "lat: lon: time: mean";
double v(time=717, depth=12, y=881, x=609);
:_CoordinateAxes = "longitude latitude time depth y x ";
:missing_value = -32767s; // short
:_FillValue = -32767.0; // double
:long_name = "Y velocity component of sea water";
:units = "m s-1";
:standard_name = "x_sea_water_velocity";
:grid_mapping = "polar_stereographic";
:coordinates = "longitude latitude";
:cell_methods = "lat: lon: time: mean";
double ssh(time=717, y=881, x=609);
:_CoordinateAxes = "longitude latitude time y x ";
:missing_value = -32767s; // short
:_FillValue = -32767.0; // double
:long_name = "Sea Surface height";
:units = "m";
:standard_name = "sea_surface_elevation";
:grid_mapping = "polar_stereographic";
:coordinates = "longitude latitude";
:cell_methods = "lat: lon: time: mean";
double bsfd(time=717, y=881, x=609);
:_CoordinateAxes = "longitude latitude time y x ";
:missing_value = -32767s; // short
:_FillValue = -32767.0; // double
:long_name = "Barotropic Streamfunction of the ocean";
:units = "m3 s-1";
:standard_name = "ocean_barotropic_streamfunction";
:grid_mapping = "polar_stereographic";
:coordinates = "longitude latitude";
:cell_methods = "lat: lon: time: mean";
double mlp(time=717, y=881, x=609);
:_CoordinateAxes = "longitude latitude time y x ";
:missing_value = -32767s; // short
:_FillValue = -32767.0; // double
:long_name = "Density Defined Mixed Layer Depth";
:units = "m";
:standard_name = "ocean_mixed_layer_thickness";
:grid_mapping = "polar_stereographic";
:coordinates = "longitude latitude";
:cell_methods = "lat: lon: time: mean";
double taux(time=717, y=881, x=609);
:_CoordinateAxes = "longitude latitude time y x ";
:missing_value = -32767s; // short
:_FillValue = -32767.0; // double
:long_name = "Area averaged x-component of atmospheric stress";
:units = "pascal";
:standard_name = "surface_downward_x_stress";
:grid_mapping = "polar_stereographic";
:coordinates = "longitude latitude";
:cell_methods = "lat: lon: time: mean";
double tauy(time=717, y=881, x=609);
:_CoordinateAxes = "longitude latitude time y x ";
:missing_value = -32767s; // short
:_FillValue = -32767.0; // double
:long_name = "Area averaged y-component of atmospheric stress";
:units = "pascal";
:standard_name = "surface_downward_y_stress";
:grid_mapping = "polar_stereographic";
:coordinates = "longitude latitude";
:cell_methods = "lat: lon: time: mean";
double tauxice(time=717, y=881, x=609);
:_CoordinateAxes = "longitude latitude time y x ";
:missing_value = -32767s; // short
:_FillValue = -32767.0; // double
:long_name = "Area averaged x-component of ice stress on ocean";
:units = "pascal";
:standard_name = "downward_x_stress_at_sea_ice_base";
:grid_mapping = "polar_stereographic";
:coordinates = "longitude latitude";
:cell_methods = "lat: lon: time: mean";
double tauyice(time=717, y=881, x=609);
:_CoordinateAxes = "longitude latitude time y x ";
:missing_value = -32767s; // short
:_FillValue = -32767.0; // double
:long_name = "Area averaged y-component of ice stress on ocean";
:units = "pascal";
:standard_name = "downward_y_stress_at_sea_ice_base";
:grid_mapping = "polar_stereographic";
:coordinates = "longitude latitude";
:cell_methods = "lat: lon: time: mean";
double qtot(time=717, y=881, x=609);
:_CoordinateAxes = "longitude latitude time y x ";
:missing_value = -32767s; // short
:_FillValue = -32767.0; // double
:long_name = "Net heat flux into ocean";
:units = "w m-2";
:standard_name = "surface_downward_heat_flux_in_sea_water";
:grid_mapping = "polar_stereographic";
:coordinates = "longitude latitude";
:cell_methods = "lat: lon: time: mean";
double qtotair(time=717, y=881, x=609);
:_CoordinateAxes = "longitude latitude time y x ";
:missing_value = -32767s; // short
:_FillValue = -32767.0; // double
:long_name = "Net surface atmospheric heat flux";
:units = "w m-2";
:standard_name = "surface_downward_heat_flux_in_air";
:grid_mapping = "polar_stereographic";
:coordinates = "longitude latitude";
:cell_methods = "lat: lon: time: mean";
double qsw(time=717, y=881, x=609);
:_CoordinateAxes = "longitude latitude time y x ";
:missing_value = -32767s; // short
:_FillValue = -32767.0; // double
:long_name = "Net surface shortwave heat flux";
:units = "w m-2";
:standard_name = "net_downward_shortwave_flux_in_air";
:grid_mapping = "polar_stereographic";
:coordinates = "longitude latitude";
:cell_methods = "lat: lon: time: mean";
double fice(time=717, y=881, x=609);
:_CoordinateAxes = "longitude latitude time y x ";
:missing_value = -32767s; // short
:_FillValue = -32767.0; // double
:long_name = "Sea Ice Concentration";
:units = "";
:standard_name = "sea_ice_area_fraction";
:grid_mapping = "polar_stereographic";
:coordinates = "longitude latitude";
:cell_methods = "lat: lon: time: mean";
double hice(time=717, y=881, x=609);
:_CoordinateAxes = "longitude latitude time y x ";
:missing_value = -32767s; // short
:_FillValue = -32767.0; // double
:long_name = "Sea Ice Thickness (area average)";
:units = "m";
:standard_name = "sea_ice_thickness";
:grid_mapping = "polar_stereographic";
:coordinates = "longitude latitude";
:cell_methods = "lat: lon: time: mean";
double hsnow(time=717, y=881, x=609);
:_CoordinateAxes = "longitude latitude time y x ";
:missing_value = -32767s; // short
:_FillValue = -32767.0; // double
:long_name = "Thickness of snow on top of sea ice (area average)";
:units = "m";
:standard_name = "surface_snow_thickness";
:grid_mapping = "polar_stereographic";
:coordinates = "longitude latitude";
:cell_methods = "lat: lon: time: mean";
double uice(time=717, y=881, x=609);
:_CoordinateAxes = "longitude latitude time y x ";
:missing_value = -32767s; // short
:_FillValue = -32767.0; // double
:long_name = "X velocity component of sea ice (area average)";
:units = "m s-1";
:standard_name = "x_sea_ice_velocity";
:grid_mapping = "polar_stereographic";
:coordinates = "longitude latitude";
:cell_methods = "lat: lon: time: mean";
double vice(time=717, y=881, x=609);
:_CoordinateAxes = "longitude latitude time y x ";
:missing_value = -32767s; // short
:_FillValue = -32767.0; // double
:long_name = "y velocity component of sea ice (area average)";
:units = "m s-1";
:standard_name = "y_sea_ice_velocity";
:grid_mapping = "polar_stereographic";
:coordinates = "longitude latitude";
:cell_methods = "lat: lon: time: mean";
:field_type = "Daily average fields";
:Conventions = "CF-1.0";
:field_date = "2008-12-15";
:bulletin_date = "2008-12-17";
:bulletin_type = "Hindcast";
:nco_openmp_thread_number = 1; // int
}