private void writeFileHeader(PrintWriter out, Band[] bands) { ProductData.UTC utc = ProductData.UTC.create(new Date(), 0); out.printf("# Exported transect on %s%n", utc.format()); if (bands.length >= 0) { Product product = bands[0].getProduct(); out.printf("# Product name: %s%n", product.getName()); if (product.getFileLocation() != null) { out.printf("# Product file location: %s%n", product.getFileLocation().getAbsolutePath()); } } out.println(); }
final int coreg = absRoot.getAttributeInt(AbstractMetadata.coregistered_stack, AbstractMetadata.NO_METADATA); text.append("Date: " + acqTime.format() + '\n'); text.append("Sample: " + sampleType + '\n');
public File retrieveOrbitFile(final String orbitType) throws Exception { final double stateVectorTime = absRoot.getAttributeUTC(AbstractMetadata.STATE_VECTOR_TIME).getMJD(); final Calendar calendar = absRoot.getAttributeUTC(AbstractMetadata.STATE_VECTOR_TIME).getAsCalendar(); int year = calendar.get(Calendar.YEAR); int month = calendar.get(Calendar.MONTH) + 1; // zero based final int day = calendar.get(Calendar.DAY_OF_MONTH); orbitFile = findOrbitFile(orbitType, stateVectorTime, year, month); if (orbitFile == null) { String timeStr = absRoot.getAttributeUTC(AbstractMetadata.STATE_VECTOR_TIME).format(); final File destFolder = getDestFolder(orbitType, year, month); throw new IOException("No valid orbit file found for " + timeStr + "\nOrbit files may be downloaded from " + remoteURL + "\nand placed in " + destFolder.getAbsolutePath()); } // read content of the orbit file osvList = readOrbitFile(orbitFile); return orbitFile; }
public File retrieveOrbitFile(final String orbitType) throws Exception { final double stateVectorTime = absRoot.getAttributeUTC(AbstractMetadata.STATE_VECTOR_TIME).getMJD(); final Calendar calendar = absRoot.getAttributeUTC(AbstractMetadata.STATE_VECTOR_TIME).getAsCalendar(); int year = calendar.get(Calendar.YEAR); int month = calendar.get(Calendar.MONTH) + 1; // zero based final int day = calendar.get(Calendar.DAY_OF_MONTH); final String missionPrefix = getMissionPrefix(absRoot); orbitFile = findOrbitFile(missionPrefix, orbitType, stateVectorTime, year, month); if (orbitFile == null) { //orbitFile = downloadArchive(missionPrefix, orbitType, year, month, day, stateVectorTime); orbitFile = downloadFromStepAuxdata(missionPrefix, orbitType, year, month, day, stateVectorTime); } if (orbitFile == null) { orbitFile = downloadFromQCWebsite(missionPrefix, orbitType, year, month, day, stateVectorTime); } if (orbitFile == null) { String timeStr = absRoot.getAttributeUTC(AbstractMetadata.STATE_VECTOR_TIME).format(); final File destFolder = getDestFolder(missionPrefix, orbitType, year, month); throw new IOException("No valid orbit file found for " + timeStr + "\nOrbit files may be downloaded from https://qc.sentinel1.eo.esa.int/" + "\nand placed in " + destFolder.getAbsolutePath()); } if (!orbitFile.exists()) { throw new IOException("SentinelPODOrbitFile: Unable to find POD orbit file"); } // read content of the orbit file readOrbitFile(); return orbitFile; }
protected void updateData() { if (file != null) { data[0] = file.getName(); } else if (entry != null) { data[0] = entry.getName(); data[1] = entry.getProductType(); data[2] = entry.getFirstLineTime().format(); final MetadataElement meta = entry.getMetadata(); if (meta != null) { data[3] = String.valueOf(meta.getAttributeInt(AbstractMetadata.REL_ORBIT, 0)); data[4] = String.valueOf(meta.getAttributeInt(AbstractMetadata.ABS_ORBIT, 0)); } } }