/* hdf_utils.h */ /* remap Copyright (C) 2006 Fabrice Ducos, fabrice.ducos@icare.univ-lille1.fr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef HDF_UTILS_H #define HDF_UTILS_H #include "hdfcpp.hpp" /** * creates a new (empty) hdf file * * @param file the name of the file to create * @returns 0 on success, -1 on failure */ extern int hdf_create_empty_file(const char *file); /** * creates a new dataset in an existing hdf file (will fail if a dataset with the same name already exists) * * @param file the hdf file to update * @param sds_name the name of the new dataset (sds: scientific dataset) to add * @param sds_type the hdf type code of the new dataset, e.g. DFNT_UINT16, DFNT_FLOAT32... (see HDF documentation for valid type codes) * @param rank the rank (number of dimensions) of the new dataset to create * @param dimensions a pointer to the array of dimensions of the new dataset * @param cal the calibration factor linked to the new dataset (also named slope); relation between calibrated and uncalibrated data is: cal_data = cal*(uncal_data - offset) * @param offset the offset factor linked to the new dataset; relation between calibrated and uncalibrated data is: cal_data = cal*(uncal_data - offset) * @param cal_err error on the calibration factor (unused for the time being) * @param off_err error on the offset (unused for the time being) * * @returns 0 on success, -1 on failure */ extern int hdf_add_empty_sds(const char *file, const char *sds_name, int32 sds_type, int32 rank, int32 *dimensions, const VOIDP fill_value, const float64 cal = 1., const float64 offset = 0., const float64 cal_err = 0., const float64 off_err = 0.); #endif