It would be simple to modify M3IOConvention.java to look for this information, and pass the radius to the projection:
new LambertAzimuthalEqualArea(lat0, lon0, 0.0, 0.0, 6370000.0);
A Panoply user had a problem with a small shift in the placement of a projected lon-lat grid in a netCDF dataset. The gridding uses the Lambert conformal conic grid, and the dataset was written using the M3IO convention. I got into the netCDF-Java source code for ucar.nc2.dataset.conv.M3IOConvention.java to see if I could get a better grip of what was going on and found that that class is looking for a grid type specified by the dataset's GDTYP global attribute. Further definition of the grid is determined by checking the XCENT, YCENT, P_ALP, and P_BET attributes.
The problem that is arising is that there is apparently no way to pass along the value of the Earth radius used by the projected grid. M3IOConvention.java is not looking for the value and is defaulting to 6,371.229 km, but the grid in the problem dataset is based on a radius of 6370 km. (A very small diference, but the effect is visible in a plot a couple egrees on a side.) The dataset (and perhaps the M3IO format) do not include a single specific attribute for the Earth radius, but does include info about it in a FILEDESC global attribute, a very long string which includes "… EARTH RADIUS ASSUMED IN MCIP: 6370000.000 m …".
Is it possible that in a coming update to the NJ libraries that M3IOConvention.java could be coded to look for this radius information in the FILEDESC attribute? Or do you have any suggestions on how one might otherwise deal with this non-default radius? The user who contacted me about this apparently has hundreds of similar files, so we're looking for a consistent gridding/plotting solution.
-- Robert B. Schmunk Webmaster / Senior Systems Programmer NASA Goddard Institute for Space Studies 2880 Broadway, New York, NY 10025
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.