This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hi Nihat, Ah, sorry for misunderstanding. The answer lies in the Javadoc for GridDataType.readDataSlice(): @param x_index if < 0, get all of x dim; if valid index, fix slice to that value. So you're getting values for all x, not just the x associated with the longitude-of-interest. You can see this in the Array object that the method returns: it is size 126 instead of 1. So yes, that can be a bit of a gotcha. You definely need to assert that both indices are >=0. Cheers, Christian Ticket Details =================== Ticket ID: HCW-753528 Department: Support netCDF Java Priority: Normal Status: Closed =================== 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.