35 lines
1.3 KiB
C
35 lines
1.3 KiB
C
|
|
#pragma once
|
|||
|
|
#include <iostream>
|
|||
|
|
#include <fstream>
|
|||
|
|
#include <vector>
|
|||
|
|
#include <string>
|
|||
|
|
#include <netcdf>
|
|||
|
|
#include <cmath>
|
|||
|
|
#include <chrono>
|
|||
|
|
#include <iomanip>
|
|||
|
|
#include "WindDataFileOperator.h"
|
|||
|
|
#include "WindDataOperator_global.h"
|
|||
|
|
|
|||
|
|
LAMPWindDataDLL DataFileInfo get_data_file_info(const std::string& filepath);
|
|||
|
|
LAMPWindDataDLL std::vector<int64_t> get_wind_data_file_time_arr(const std::string& filepath, const DataFileInfo& info);
|
|||
|
|
LAMPWindDataDLL bool read_wind_data_file(const std::string& filepath, const DataFileInfo& info,
|
|||
|
|
int64_t time_id, std::vector<double>& u_arr, std::vector<double>& v_arr);
|
|||
|
|
|
|||
|
|
|
|||
|
|
class LAMPWindDataDLL ERA5NetCDFConverter {
|
|||
|
|
private:
|
|||
|
|
|
|||
|
|
public:
|
|||
|
|
ERA5NetCDFConverter() = default;
|
|||
|
|
~ERA5NetCDFConverter() = default;
|
|||
|
|
// <20><><EFBFBD><EFBFBD>NetCDF<44><46><EFBFBD><EFBFBD>
|
|||
|
|
void handle_netcdf_error(int status, const std::string& operation);
|
|||
|
|
// <20><>Unixʱ<78><CAB1><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>ΪERA5ʹ<35>õ<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ʽ
|
|||
|
|
std::vector<double> convert_to_era5_time(const std::vector<int64_t>& unix_timestamps);
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>γ<EFBFBD><CEB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
std::vector<double> create_coordinate_array(double min, double max, size_t size);
|
|||
|
|
|
|||
|
|
bool convert_to_era5_netcdf(const std::string& input_bin_file, const std::string& output_nc_file);
|
|||
|
|
bool convert_to_era5_netcdf(const std::string& input_bin_file, const std::string& output_nc_file,int64_t tid);
|
|||
|
|
};
|