public class AcmoUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static File |
createCsvFile(String outputCsvPath,
String mode)
Generate an ACMO CSV file object with a non-repeated file name in the
given directory.
|
static File |
createCsvFile(String outputCsvPath,
String model,
String metaFilePath)
Generate an ACMO CSV file object with a non-repeated file name in the
given directory.
|
static String |
escapeCsvStr(String str)
CSV Escape handling for given string.
|
static String |
extractAcmoData(HashMap<String,Object> dataset,
String destModel,
HashMap<String,String> domeIdHashMap,
String... ids)
Extract a CSV-compatable ACMO line from a single experiment
|
protected static HashMap<String,String> |
extractEventData(HashMap<String,Object> dataset,
String destModel) |
static String |
generateAcmoHeader()
Generates the standard ACMO header (with all the variables defined)
|
static void |
writeAcmo(String outputPath,
HashMap<String,Object> datapackage,
String destModel,
HashMap<String,String> domeIdHashMap)
Write an ACMO file to the specified
outputPath which includes
all the experiments in the datapackage. |
public static void writeAcmo(String outputPath, HashMap<String,Object> datapackage, String destModel, HashMap<String,String> domeIdHashMap)
outputPath which includes
all the experiments in the datapackage.outputPath - the directory to write the ACMO_meta.dat file.datapackage - a standard AgMIP packagedestModel - the destination model namedomeIdHashMap - the map hold the data as [DOME ID] : [calculated hash for its content]public static String extractAcmoData(HashMap<String,Object> dataset, String destModel, HashMap<String,String> domeIdHashMap, String... ids)
dataset - a single AgMIP datasetdestModel - the destination model namedomeIdHashMap - the map hold the data as [DOME ID] : [calculated hash for its content]ids - including clime ID, wid and sidpublic static String generateAcmoHeader()
protected static HashMap<String,String> extractEventData(HashMap<String,Object> dataset, String destModel)
public static File createCsvFile(String outputCsvPath, String mode)
outputCsvPath - The output path for CSV filemode - The name of model which provide the model output dataFile for CSV filepublic static File createCsvFile(String outputCsvPath, String model, String metaFilePath)
outputCsvPath - The output path for CSV filemodel - The name of model which provide the model output datametaFilePath - The path of meta data fileFile for CSV fileCopyright © 2015. All Rights Reserved.