/** * Retrieves the names of the tie point grids for the given product type * * @param prodType * @return the names of the tie point grids */ public String[] getTiePointNames(final String prodType) { String[] tpNames = null; try { final ModisProductDescription prod = getProductDescription(prodType); tpNames = prod.getTiePointNames(); } catch (IOException e) { logger.severe("Unable to retrieve tie point names for product type '" + prodType + "'."); } return tpNames; }
/** * Retrieves the geolocation information for the given product type * * @param prodType * @return the geolocation information */ public String[] getGeolocationInformation(final String prodType) { String[] strRet = null; try { final ModisProductDescription prod = getProductDescription(prodType); strRet = prod.getGeolocationDatasetNames(); } catch (IOException e) { logger.severe("Unable to retrieve geolocation information for product type '" + prodType + "'."); } return strRet; }
/** * Retrieves the names of the bands for the given product type. * * @param prodType the product type string * @return the names of the bands. */ public String[] getBandNames(final String prodType) { String[] bandNames = null; try { final ModisProductDescription prod = getProductDescription(prodType); bandNames = prod.getBandNames(); } catch (IOException e) { logger.severe("Unable to retrieve the band names for product of type '" + prodType + "'."); } return bandNames; }
/** * Retrieves whether the product must be flipped top down or not * * @param prodType * @return <code>true</code> if the product must be flipped top down, otherwise <code>false</code>. */ public boolean mustFlip(final String prodType) { boolean bRet = false; try { final ModisProductDescription prod = getProductDescription(prodType); bRet = prod.mustFlipTopDown(); } catch (IOException e) { logger.severe("Unable to retrieve flipping information for product type '" + prodType + "'."); } return bRet; }
/** * Retrieves the band description for the given product type and band name * * @param prodType * @param bandName * @return the band description */ public ModisBandDescription getBandDescription(final String prodType, final String bandName) { ModisBandDescription bandDesc = null; try { final ModisProductDescription prod = getProductDescription(prodType); bandDesc = prod.getBandDescription(bandName); } catch (IOException e) { logger.severe( "Unable to retrieve information for band '" + bandName + "' of product type '" + prodType + "'."); } return bandDesc; }
/** * Retrieves the tie point description for the given product type and tie point grid name * * @param prodType the product type * @param tpName the name of the tie point grid * @return the tie point description */ public ModisTiePointDescription getTiePointDescription(final String prodType, final String tpName) { ModisTiePointDescription tpDesc = null; try { final ModisProductDescription prod = getProductDescription(prodType); tpDesc = prod.getTiePointDescription(tpName); } catch (IOException e) { logger.severe( "Unable to retrieve description for tie point grid '" + tpName + "' of product type '" + prodType + "'."); } return tpDesc; }
private void addModisTiePointGeoCoding(Product product, NetCDFVariables netCDFVariables) throws IOException { ModisProductDescription prodDesc = prodDb.getProductDescription(product.getProductType()); final String[] geolocationDatasetNames; if (prodDesc.hasExternalGeolocation()) { // @todo 2 tb/tb this relies on the order of the tie point grids in the *.dd file. // better check the metadata for the lat/lon band names - // but for the test products this works fine. geolocationDatasetNames = loadExternalQCFile(product, prodDesc, netCDFVariables); } else { geolocationDatasetNames = prodDesc.getGeolocationDatasetNames(); } if (geolocationDatasetNames != null) { final TiePointGrid latGrid = product.getTiePointGrid(geolocationDatasetNames[0]); final TiePointGrid lonGrid = product.getTiePointGrid(geolocationDatasetNames[1]); if (latGrid != null && lonGrid != null) { // set cyclic behaviour lonGrid.setDiscontinuity(TiePointGrid.DISCONT_AT_180); // and create geo coding GeoCoding coding = new ModisTiePointGeoCoding(latGrid, lonGrid); product.setGeoCoding(coding); } } }