public static bool IsCompatible(string fileName, byte[] header1024) { if (header1024 == null) { header1024 = new byte[1024]; using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read)) { fs.Read(header1024, 0, 1024); fs.Close(); } } if (!HDF5Helper.IsHdf5(header1024)) { return(false); } Hdf5Operator oper = new Hdf5Operator(fileName); string[] datasets = oper.GetDatasetNames; string[] alldatasets = new string[16] { "SD_Flags_NorthernDaily_A", "SD_Flags_NorthernDaily_D", "SD_Flags_SouthernDaily_A", "SD_Flags_SouthernDaily_D", "SD_NorthernDaily_A", "SD_NorthernDaily_D", "SD_SouthernDaily_A", "SD_SouthernDaily_D", "SWE_Flags_NorthernDaily_A", "SWE_Flags_NorthernDaily_D", "SWE_Flags_SouthernDaily_A", "SWE_Flags_SouthernDaily_D", "SWE_NorthernDaily_A", "SWE_NorthernDaily_D", "SWE_SouthernDaily_A", "SWE_SouthernDaily_D" }; foreach (object set in alldatasets) { if (!datasets.Contains(set)) { return(false); } } return(false); }
public override bool IsSupport(string fname, byte[] header1024, Dictionary <string, string> datasetNames) { string ext = Path.GetExtension(fname).ToUpper(); if (ext != ".HDF" || !HDF5Helper.IsHdf5(header1024)) { return(false); } using (Hdf5Operator hdf5 = new Hdf5Operator(fname)) { if (hdf5 == null) { return(false); } string[] dss = hdf5.GetDatasetNames; if (dss == null) { return(false); } foreach (string bandname in defaultBandnames) { if (!dss.Contains(bandname)) { return(false); } } } TryGetDef(); return(true); }
public static bool IsCompatible(string fileName, byte[] header1024) { if (header1024 == null) { header1024 = new byte[1024]; using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read)) { fs.Read(header1024, 0, 1024); fs.Close(); } } if (!HDF5Helper.IsHdf5(header1024)) { return(false); } Hdf5Operator hdfic = new Hdf5Operator(fileName); string[] HDFdatasets = hdfic.GetDatasetNames; string[] alldatasets = new string[6] { "icecon_north_asc", "icecon_north_avg", "icecon_north_des", "icecon_south_asc", "icecon_south_avg", "icecon_south_des" }; foreach (object set in alldatasets) { if (!HDFdatasets.Contains(set))//数据集必须完全匹配,才能用此数据集 { return(false); } } return(false); }
protected override bool IsCompatible(string fileName, byte[] header1024, params object[] args) { string ext = Path.GetExtension(fileName).ToUpper(); if (!HDF5Helper.IsHdf5(header1024)) { return(false); } return(SICRasterDataProvider.IsSupport(fileName)); }
public override bool IsSupport(string fname, byte[] header1024, Dictionary <string, string> datasetNames) { string ext = Path.GetExtension(fname).ToUpper(); if (!HDF5Helper.IsHdf5(header1024)) { return(false); } return(HasDatasets(fname)); }
public override bool IsSupport(string fname, byte[] header1024, Dictionary <string, string> datasetNames) { string ext = Path.GetExtension(fname).ToUpper(); if (ext != ".HDF" || !HDF5Helper.IsHdf5(header1024)) { return(false); } TryGetBandProviderDefinition(fname, datasetNames); return(_matchedBandProviderDef != null); }
private IHdfOperator HdfOperatorFactory(string filename) { if (HDF5Helper.IsHdf5(filename)) { return(new Hdf5Operator(filename)); } if (HDF4Helper.IsHdf4(filename)) { return(new Hdf4Operator(filename)); } return(null); }
private bool IsHDF5(string fileName) { byte[] header1024 = new byte[1024]; using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read)) { fs.Read(header1024, 0, 1024); fs.Close(); } if (!HDF5Helper.IsHdf5(header1024)) { return(false); } return(true); }
protected override bool IsCompatible(string fileName, byte[] header1024, params object[] args) { if (args == null || args.Length == 0) { return(false); } string ext = Path.GetExtension(fileName).ToUpper(); if (ext != ".HDF" || !HDF5Helper.IsHdf5(header1024)) { return(false); } return(true); }
protected override bool IsCompatible(string fileName, byte[] header1024, params object[] args) { if (header1024 == null) { header1024 = new byte[1024]; using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read)) { fs.Read(header1024, 0, 1024); fs.Close(); } } if (!HDF5Helper.IsHdf5(header1024)) { return(false); } Hdf5Operator hdfic = new Hdf5Operator(fileName); string[] HDFdatasets = hdfic.GetDatasetNames; bool matched = false; foreach (String[] sets in FY3AASOandASLProvider._datasets) { foreach (string set in sets) { matched = false; for (int i = 0; i < HDFdatasets.Length; i++) { if (HDFdatasets[i] == set) { matched = true; } } if (!matched) { break; } } if (matched) { return(true); } } return(false); }
protected override bool IsCompatible(string fileName, byte[] header1024, params object[] args) { if (header1024 == null) { header1024 = new byte[1024]; using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read)) { fs.Read(header1024, 0, 1024); fs.Close(); } } if (!HDF5Helper.IsHdf5(header1024)) { return(false); } string geoprjstr = "Projection Type".ToUpper(); string geoprj1 = "Geographic Longitude/Latitude".ToUpper(); string geoprj2 = "Geographic Longitude/Latitute".ToUpper(); string geoprj3 = "GLL"; string prjType = null; Hdf5Operator hdfic = new Hdf5Operator(fileName); Dictionary <string, string> fileAttributes = hdfic.GetAttributes(); foreach (KeyValuePair <string, string> fileAttribute in fileAttributes) { if (fileAttribute.Key.ToUpper() == geoprjstr) { prjType = fileAttribute.Value.ToUpper(); break; } } if (prjType == null) { return(false); } if (prjType != null && (prjType != geoprj1 && prjType != geoprj2 && prjType != geoprj3)) { return(false); } return(true); }
public static bool IsCompatible(string fileName, byte[] header1024) { if (header1024 == null) { header1024 = new byte[1024]; using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read)) { fs.Read(header1024, 0, 1024); fs.Close(); } } if (!HDF5Helper.IsHdf5(header1024) && !HDF4Helper.IsHdf4(header1024)) { return(false); } L2ProductDefind[] l2Pros = L2ProductDefindParser.GetL2ProductDefs(fileName); if (l2Pros == null || l2Pros.Length == 0) { return(false); } return(true); }