Giter VIP home page Giter VIP logo

fimex's Introduction

Fimex

Fimex is a library and a program to convert gridded geospatial data between different formats and projections.

NcML Changes in version 2.0

In fimex 2.0, there are some major changesd in the behaviour of ncml in fimex.

  1. In fimex before 2.0, the order of the dimensions for the shape of variables in ncml was reversed with respect to the ncml description. In 2.0, the dimension order in fimex and the ncml description should be the same. As both the old and new ncml text are valid, but only one of them yields useful results, this change requires manual review. This is the main reason to increase the major version number of fimex.
  2. There is now support for joinNew. As part of this implementation, the behaviour of union and joinExisting has also changed and should be closer to the ncml description. Again, for the same input ncml this might produce different output compared to fimex before 2.0.
  3. There is now support for writing to ncml, including values. This is probably only useful for small datasets, as output files might become huge for large datasets.

Dependencies

Fimex requires at least the following libraries to be installed for compilation

To configure the different file formats it requires:

  • NetCDF (netcdf > 3.5)
  • Grib_API (grib_api > 1.4) or ecCodes

To build the python interface, it requires:

  • pybind11 (>= 2.2.4)
  • python numpy (for the unit tests)

Installation

Since version 0.64.0~rc1, fimex is built with cmake. The minimum required cmake version is 2.8.12.

These commands illustrate how fimex might be compiled:

SRC=/fimex/source
BLD=/fimex/build
INS=/fimex/install

GENERATOR="Unix Makefiles" # unix
GENERATOR="CodeBlocks - $GENERATOR" # for qtcreator and others
#GENERATOR="Eclipse CDT4 - $GENERATOR" # for eclipse

mkdir $BLD
cd $BLD
cmake -G"$GENERATOR" \
    -DBUILD_SHARED_LIBS=ON \
    -DENABLE_GRIBAPI=YES -Dgrib_api_DIR=/path/to/grib_api \
    -DENABLE_THIS=YES \
    -DENABLE_THAT=NO \
    -DCMAKE_INSTALL_PREFIX="$INS" \
    "$SRC"

make all test install

Of course, ENABLE_THIS and ENABLE_THAT should be replaced with actual config options.

There are several ways to edit available config options

  1. read the top-level CMakeLists.txt and pass values to cmake via -D...
  2. run cmake without options, then use either
    • ccmake, a text-based configuration editor, or
    • cmake-gui a Qt-based configuration editor, or
    • some IDE editor (e.g. qtcreator)

Please note that some packages are searched via pkg-config and that it might be necessary to have PKG_CONFIG_PATH set properly if packages are installed in non-standard locations or if you wrote your own .pc files.

It is recommended to build fimex outside the source directory, ie BLD != SRC in the above example.

Since Fimex makes some floating-point calculations in large loops, it is advisable to switch on SIMD/SSE operations in your compiler. On a Xeon machine with a x386 CPU and gcc, the following flags might help (those are default for x86-64)

CFLAGS='-O2 -mfpmath=sse -msse2' CXXFLAGS='-O2 -mfpmath=sse -msse2' cmake ...

Testing the Installation

Some tests require extra test data which can be downloaded from https://wiki.met.no/fimex/download. The test data archive must be unpacked, and the directory containing the file VERSION should be specified to cmake

cmake  ... -DTEST_EXTRADATA_DIR=/path/to/extra/test/data ...

Usage Example

Converting a model output from felt to NetCDF:

  1. Get an overview of times, layers and grid used in the felt-file.

  2. Group the parameters so that all parameters within an group use the same grid, times and the same layers (its possible to have a file with both sigma and pressure layers, but then all sigma-variables should have the same number of sigma layers and all pressure-variables should have the same number of pressure layers. Surface only variables, usually sigma=1000 felt variables, are a layer-group of their own).

  3. Create a felt2nc_variables.xml file for each variable group. Copy parameters from existing examples, or lookup variable and parameter names in the CF standard name documentation. If you have to generate several groups, it might be useful to split the file into axes, global attributes and variables, see, e.g., damocles_felt2nc_variables.xml. If you have two parameters which map to the same standard_name, make sure to give them different variable names if they are in the same group Adjust the datatype according to your data. float will always work fine, use short if you know that the variable even fits as 4-dimensional data into shorts. Use eventually a cdmWriterConfig.xml to process data as float and write the data as short.

  4. Validate the felt2nc_variables.xml file with, e.g.,

    xmllint --xinclude --postvalid --noout ../../share/etc/felt2nc_variables.xml
    
  5. Adjust the projection and area you want to extract in fimex_example.cfg (or use command line arguments to fimex)

  6. Run

    fimex -c fimex_example.cfg
    

Library usage

To use the fimex >= 1.2 from CMake projects, please use

-Dfimex_DIR=.../lib/cmake/fimex

and

find_package(fimex "1.2" REQUIRED)

or, if you want a specific version

-Dfimex-1.0_DIR=.../lib/cmake/fimex-1.0
find_package(fimex-1.0 REQUIRED)

In both cases, include paths etc are set implicitly when using

target_link_libraries(libfimex)

This functionality is not yet supported for static fimex libraries.

fimex's People

Contributors

albert-github avatar alexander-buerger-met-no avatar epifanio avatar heikoklein avatar magnusumet avatar meteorologist avatar mraspaud avatar trygveasp avatar tuhtah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fimex's Issues

`reference_ellipsoid_name` not used in netcdf grid mappings

Hi,

It looks like fimex doesn't load the reference_ellipsoid_name item from netcdf/cf, so that we could directly specify eg: reference_ellipsoid_name: WGS84. Instead, one has to provide the semi_major_axis and one of semi_minor_axis or inverse_flattening iiuc. Since these names are for supported in proj4, it would be nice if we could pass this information directly.

--verticalInterpolate should be independently configurable and remove templateVariable

verticalInterpolation to a new set of i.e. atmospheric_sigma_hybrid pressure variables needs as configuration the ap, b and hybrid variables. Currently, these variables need to be added to the input-stream together with a templateVariable rather than to the verticalInterpolation configuration. This leads to some problems, since these configuration needs to get transported through the complete processing chain.

If --extract.selectVariables is used, the templateVariable needs to be extracted, too.
If --interpolate is used, the templateVariable, even if just a dummy, will be processed

The templateVariable for the vertical-interpolation will also be written to the output-file, though it is just a dummy.

Ideally, only the ap, b and hybrid variables should be needed and given directly to vertical-interpolation (i.e. by a --verticalInterpolation.ncml=file.ncml). The templateVariable is not necessary, only the vertical axes are needed. The horizontal axes of the templateVariable are not needed, but are difficult to figure out for vertticalInterpolation. There, I think it would be best if the templateVariable could be dropped and be replace by a vertical-coordinate-axis (i.e. hybrid).

printNcML create 0-size variables with undefined type

Hi,

printNcML on 0-size variables, i.e. projections give type="NAT" when read from grib-files. NAT is a undefined type in the ncml-schema: https://www.unidata.ucar.edu/schemas/netcdf/ncml-2.2.xsd

<variable name="projection_regular_ll" type="NAT" >
  <attribute name="grid_mapping_name" type="string" value="latitude_longitude" />
  <attribute name="earth_radius" type="double" value="6367470" />
  <attribute name="proj4" type="string" value="+proj=longlat +a=6367470 +e=0 +no_defs" />
</variable>

type should be omitted here, or set to something valid (it doesn't matter since size=0). When converting to netcdf-files, the NAT-type is translated to 'int':

<variable name="projection_regular_ll" type="int" >
  <attribute name="grid_mapping_name" type="string" value="latitude_longitude" />
  <attribute name="earth_radius" type="double" value="6367470" />
  <attribute name="proj4" type="string" value="+proj=longlat +a=6367470 +e=0 +no_defs" />
</variable>

GribCDMWriter drops fields when all values are missing

The GribCDMWriter drops fields where all data are missing. While this might be a useful strategy for some cases it is not for cases where i.e. sparse fields are written out and compressed using i.e. bitmap-compression.

GRIB_api

Hei.
I get this error when I try to build fimex.

CMake Error at cmake/FimexUtils.cmake:245 (MESSAGE):
Required grib_api include/library not found

I see they replaced grib_api with ecCodes
I wonder how this can be fixed to keep all the functionality in place?

Error building with gcc 10

gcc version 10.2.0

github.com/metno/fimex/include/felt/FeltFile.h:108:23: error: field ‘fileName_’ has incomplete type ‘const string’ {aka ‘const std::__cxx11::basic_string<char>’}
  108 |     const std::string fileName_;

Time not recognized in NetCDF4 file

Hi,

I'm trying to generate a netcdf4 file that Diana can read, but it seems it can't find the time variable in the file.
The relevant part in ncdump says the following:

	float time(time) ;
		time:_FillValue = NaNf ;
		string time:long_name = "time" ;
		string time:standard_name = "time" ;
		string time:units = "seconds since 1970-01-01T00:00:00+00:00" ;
		string time:calendar = "proleptic_gregorian" ;

Is there something wrong with this ?
By the way, is there a specification for the netcdf4 file conventions that Diana accepts ? Because if feels right now like I'm in the dark, so it's very time consuming to generate Diana-compatible files.

Here comes the complete `ncdump -h` output:
netcdf S_NWC_CT_noaa18_57836_20160810T0639362Z_20160810T0655107Z_diana_time_fixed {
dimensions:
	y = 2252 ;
	x = 6168 ;
	time = 1 ;
	pal_colors_256 = 256 ;
	pal_rgb = 3 ;
variables:
	ubyte ct(time, y, x) ;
		ct:_FillValue = 255UB ;
		string ct:flag_meanings = "Cloud-free_land Cloud-free_sea Snow_over_land Sea_ice Very_low_clouds Low_clouds Mid-level_clouds High_opaque_clouds Very_high_opaque_clouds Fractional_clouds High_semistransparent_very_thin_clouds High_semistransparent_thin_clouds High_semistransparent_thick_clouds High_semistransparent_above_low_or_medium_clouds High_semistransparent_above_snow_or_ice no_data" ;
		string ct:ancillary_variables = "ct_conditions ct_quality ct_status_flag ct_pal" ;
		ct:valid_range = 1UB, 15UB ;
		string ct:platform_name = "NOAA-18" ;
		string ct:long_name = "SAFNWC PPS CT Cloud Type" ;
		string ct:standard_name = "cloudtype" ;
		ct:flag_values = 1UB, 2UB, 3UB, 4UB, 5UB, 6UB, 7UB, 8UB, 9UB, 10UB, 11UB, 12UB, 13UB, 14UB, 15UB, 255UB ;
		string ct:units = "1" ;
		string ct:sensor = "avhrr/3" ;
		ct:modifiers = "" ;
		string ct:grid_mapping = "omerc" ;
	ushort ct_conditions(time, y, x) ;
		ct_conditions:_FillValue = 0US ;
		string ct_conditions:comment = "Common geophysical and processing conditions flag" ;
		string ct_conditions:flag_meanings = "outside_swath night day twilight sunglint land sea coast high_terrain rough_terrain all_satellite_channels_available useful_satellite_channels_missing mandatory_satellite_channels_missing all_NWP_fields_available useful_NWP_fields_missing mandatory_NWP_fields_missing all_product_data_available useful_product_data_missing mandatory_product_data_missing all_auxiliary_data_available useful_auxiliary_data_missing mandatory_auxiliary_data_missing" ;
		ct_conditions:flag_masks = 1US, 6US, 6US, 6US, 8US, 48US, 48US, 48US, 64US, 128US, 768US, 768US, 768US, 3072US, 3072US, 3072US, 12288US, 12288US, 12288US, 49152US, 49152US, 49152US ;
		ct_conditions:ancillary_variables = "" ;
		ct_conditions:valid_range = 1US, 65535US ;
		string ct_conditions:platform_name = "NOAA-18" ;
		string ct_conditions:long_name = "Common geophysical and processing conditions flag" ;
		string ct_conditions:standard_name = "ct status_flag" ;
		ct_conditions:flag_values = 1US, 2US, 4US, 6US, 8US, 16US, 32US, 48US, 64US, 128US, 256US, 512US, 768US, 1024US, 2048US, 3072US, 4096US, 8192US, 12288US, 16384US, 32768US, 49152US ;
		string ct_conditions:units = "1" ;
		string ct_conditions:sensor = "avhrr/3" ;
		ct_conditions:modifiers = "" ;
		string ct_conditions:grid_mapping = "omerc" ;
	ubyte ct_pal(pal_colors_256, pal_rgb) ;
		string ct_pal:comment = "Palette applicable to field ct" ;
		string ct_pal:colormodel = "RGB" ;
		ct_pal:ancillary_variables = "" ;
		ct_pal:valid_range = 0L, 255L ;
		string ct_pal:platform_name = "NOAA-18" ;
		string ct_pal:long_name = "RGB Palette for ct" ;
		string ct_pal:standard_name = "palette" ;
		string ct_pal:units = "1" ;
		string ct_pal:sensor = "avhrr/3" ;
		ct_pal:modifiers = "" ;
	ushort ct_quality(time, y, x) ;
		ct_quality:_FillValue = 0US ;
		string ct_quality:comment = "Common quality indicators flag" ;
		string ct_quality:flag_meanings = "no_data spare_bit spare_bit good questionable bad interpolated_reclassified" ;
		ct_quality:flag_masks = 1US, 2US, 4US, 56US, 56US, 56US, 56US ;
		ct_quality:ancillary_variables = "" ;
		ct_quality:valid_range = 1US, 64US ;
		string ct_quality:platform_name = "NOAA-18" ;
		string ct_quality:long_name = "Common quality indicators flag" ;
		string ct_quality:standard_name = "ct status_flag" ;
		ct_quality:flag_values = 1US, 2US, 4US, 8US, 16US, 24US, 32US ;
		string ct_quality:units = "1" ;
		string ct_quality:sensor = "avhrr/3" ;
		ct_quality:modifiers = "" ;
		string ct_quality:grid_mapping = "omerc" ;
	ushort ct_status_flag(time, y, x) ;
		ct_status_flag:_FillValue = 65535US ;
		string ct_status_flag:flag_meanings = "Low_level_thermal_inversion_in_NWP_field NWP_low_quality Sea_ice_map_available Sea_ice_according_to_external_map" ;
		ct_status_flag:flag_masks = 1US, 2US, 4US, 8US ;
		ct_status_flag:ancillary_variables = "" ;
		ct_status_flag:valid_range = 0US, 16US ;
		string ct_status_flag:platform_name = "NOAA-18" ;
		string ct_status_flag:long_name = "Information of specific SAFNWC PPS CT processing" ;
		string ct_status_flag:standard_name = "ct status_flag" ;
		string ct_status_flag:units = "1" ;
		string ct_status_flag:sensor = "avhrr/3" ;
		ct_status_flag:modifiers = "" ;
		string ct_status_flag:grid_mapping = "omerc" ;
	int64 omerc ;
		omerc:azimuth_of_central_line = 19.0224474963892 ;
		omerc:latitude_of_projection_origin = 60.7419999999989 ;
		string omerc:no_rotation = " " ;
		omerc:semi_major_axis = 6378137. ;
		omerc:longitude_of_projection_origin = 5.34064836694889 ;
		omerc:false_northing = 0. ;
		omerc:semi_minor_axis = 6356752.3142 ;
		omerc:false_easting = 0. ;
		string omerc:long_name = "omerc" ;
	float time(time) ;
		time:_FillValue = NaNf ;
		string time:long_name = "time" ;
		string time:standard_name = "time" ;
		string time:units = "seconds since 1970-01-01T00:00:00+00:00" ;
		string time:calendar = "proleptic_gregorian" ;
	double x(x) ;
		x:_FillValue = NaN ;
	double y(y) ;
		y:_FillValue = NaN ;

// global attributes:
		string :history = "Created by pytroll/satpy on 2018-01-12 11:38:44.952540" ;
		string :conventions = "CF-1.7" ;
}

Wrong --libs in pkg-config for fimex in conda

Hi,
the pkg-config for fimex in conda gives

$ pkg-config --libs fimex
-L/modules/rhel8/user-apps/fou-modules/conda/atom-fimex/2022-10-21/modules/rhel8/user-apps/fou-modules/conda/atom-fimex/2022-10-21/lib -lfimex 

i.e. the -L/path is written twice giving -L/path/path
which follows from the libdir in fimex.pc file

prefix=/modules/rhel8/user-apps/fou-modules/SnapPy/TEST_HK
libdir=${prefix}//modules/rhel8/user-apps/fou-modules/SnapPy/TEST_HK/lib
includedir=${prefix}/include

Tested with both fimex-1.8.1 and 1.9.4.

+no_rot not supported ?

We have implemented the support of the omerc projection a while ago, but are now realising that the +no_rot parameter doesn't seem do be supported in fimex.
The way we implemented it is here:

if (boost::regex_search(proj4Str, what, boost::regex("\\+no_rot"))) {
attrs.push_back(CDMAttribute("no_rotation", ""));

I couldn't find any other example of proj4 parameters without a value in fimex, so I'm wondering if what we implemented is actually supported, or if we implemented wrong ?

Missing pkg_config for fortran libfimexf

Hi,
I'm using the fortran module of fimex in https://github.com/metno/snap . It works well, but building requires manually setting the fimex-fortran library. The c-library works nicely with pkg-config, but I need to add the fortran library manually, i.e.

INC=`pkg-config --cflags fimex`
LIBS=`pkg-config --libs fimex` -lfimexf-1.4

It would be nice to have the a pkg-config file for fimexf, in particularly for the versionized libraries.

Strange INFO in fortran fimex

Hi,
while using the fimex fortran module, I get a strange log-message:

INFO fimex.CF1_xCoordSysBuilder : formula_term surface_air_pressure missing time in cs CF-1.X:hybrid in /build/fimex-1.4-1.4.1/src/coordSys/CF1_xCoordSysBuilder.cc at line 256

The input-data is a meps_det_2_5km_20200318T06Z.ncml (varying date) from https://thredds.met.no/thredds/catalog/mepslatest/catalog.html. The input coordinate systems are:

input CoordinateSystems: 5: CF-1.X=height0:Height,time:Time,x:GeoX,y:GeoY,latitude:Lat,longitude:Lon;lambert_conformal_conic:proj4=+proj=lcc +lat_0=63.3 +lon_0=15 +lat_1=63.3 +lat_2=63.3 +no_defs +R=6.371e+06;latitude_of_projection_origin=63.3;longitude_of_central_meridian=15;standard_parallel=63.3 63.3;grid_mapping_name=lambert_conformal_conic;earth_radius=6371000;;simpleSpatialGrid;height(h=height0) 
 CF-1.X=height7:Height,time:Time,x:GeoX,y:GeoY,latitude:Lat,longitude:Lon;lambert_conformal_conic:proj4=+proj=lcc +lat_0=63.3 +lon_0=15 +lat_1=63.3 +lat_2=63.3 +no_defs +R=6.371e+06;latitude_of_projection_origin=63.3;longitude_of_central_meridian=15;standard_parallel=63.3 63.3;grid_mapping_name=lambert_conformal_conic;earth_radius=6371000;;simpleSpatialGrid;height(h=height7) 
 CF-1.X=height_above_msl:Height,time:Time,x:GeoX,y:GeoY,latitude:Lat,longitude:Lon;lambert_conformal_conic:proj4=+proj=lcc +lat_0=63.3 +lon_0=15 +lat_1=63.3 +lat_2=63.3 +no_defs +R=6.371e+06;latitude_of_projection_origin=63.3;longitude_of_central_meridian=15;standard_parallel=63.3 63.3;grid_mapping_name=lambert_conformal_conic;earth_radius=6371000;;simpleSpatialGrid;height(h=height_above_msl) 
 CF-1.X=hybrid:GeoZ 
 CF-1.X=hybrid:GeoZ,time:Time,x:GeoX,y:GeoY,latitude:Lat,longitude:Lon;lambert_conformal_conic:proj4=+proj=lcc +lat_0=63.3 +lon_0=15 +lat_1=63.3 +lat_2=63.3 +no_defs +R=6.371e+06;latitude_of_projection_origin=63.3;longitude_of_central_meridian=15;standard_parallel=63.3 63.3;grid_mapping_name=lambert_conformal_conic;earth_radius=6371000;;simpleSpatialGrid;atmosphere_hybrid_sigma_pressure_coordinate_1(ap=ap,b=b,ps=surface_air_pressure,p0=p0)

The hybrid-axis is a coordinate-axis and is properly defined as far as I can see:

        double hybrid(hybrid) ;
                hybrid:standard_name = "atmosphere_hybrid_sigma_pressure_coordinate" ;
                hybrid:formula = "p(n,k,j,i) = ap(k) + b(k)*ps(n,j,i)" ;
                hybrid:formula_terms = "ap: ap b: b ps: surface_air_pressure p0: p0" ;
                hybrid:long_name = "atmosphere_hybrid_sigma_pressure_coordinate" ;
                hybrid:positive = "down" ;
        double p0 ;
                p0:units = "Pa" ;
        double ap(hybrid) ;
                ap:units = "Pa" ;
        double b(hybrid) ;
                b:units = "1" ;

The INFO line should not appear, or it should be possible to disable the INFO-log messages from fortran.

fimex creates files with corrupt data without error code

Hi,
the newest fimex version create netcdf-files with corrupt data without error-code:

e.g.
fimex --extract.selectVariables WDEP_SOX 'https://thredds.met.no/thredds/dodsC/data/EMEP/2019_trends_EEA/EMEP01_L20EC_rv4_33_day.met2016_emis2017.nc' out.nc4
WARN: formula term 'ps' specifies unknown variable 'PS' in /build/fimex-1.5-1.5.0/src/coordSys/CF1_xCoordSysBuilder.cc at line 472
WARN: formula term 'ps' specifies unknown variable 'PS' in /build/fimex-1.5-1.5.0/src/coordSys/CF1_xCoordSysBuilder.cc at line 472
curl error details:
ERROR: exception while reading variable 'WDEP_SOX' at unlimited dim position 75; using _FillValue; message: CDMException: NetCDF: I/O failure in /build/fimex-1.5-1.5.0/src/NetCDF_CDMWriter.cc at line 718

In this case, a network error lead to an undelivered data request. fimex just writes the output and exits with code 0.

In an operational context, error output is not read unless the program fails, e.g. has a non-zero exit code.

This problem was introduced in 2ce00fb.

Fimex should give a non-zero exit code when errors occur. Fimex should not continue operations (unless explicitly requested) after an error occured.

mifi_set_default_loglevel has no effect

Calling mifi_set_default_loglevel has no effect when used from the fortran interface.

mifi_set_default_loglevel in c_fimex.cc sets a variable which, when having log4cpp, is only used on the first initialization and not when the log-level is changed. I guess that adding Logger::setClass(Logger::LOG4CPP); should be called after setting defaultLogLevel, i.e.

void mifi_set_default_log_level(int loglevel)
{
    defaultLogLevel(static_cast<Logger::LogLevel>(loglevel));
    Logger::setClass(Logger::LOG4CPP);
}

All fimex operations fail when coordinate-system is unknown

Using the file at https://drive.google.com/open?id=1_bX1sba0gZiYsWYl3J89RlICiQzEL53u a simple

fimex --input.file=omerc_proj_string.nc --input.printNcML

fails with a CDMException: unsupported projection: oblique_mercator

All other operations like extraction or writing, which are CoordinateSystem independent, fail too.

I guess the problem lies in fimex.cc always creating a CDMInterpolator object, even if that one is not needed. CDMInterpolator always needs CoordinateSystem information, so that is ok, but it should not be initialized n fimex.cc.

missing whitespace in ncml-output

fimex-1.5.0 is omitting all whitespace in the ncml-output for the shape and is then unable to read the ncml-files back.

From fimex --input.file=snap.nc --input.printNcML

<variable name="time_of_arrival" type="float" shape="xytime" >

should be

<variable name="time_of_arrival" type="float" shape="x y time" >

How to use metgm with 1.9.4?

Hello!

Im trying to convert grib2 to metgm and don't understand how to add METGM_API as a plugin to fimex.
I managed to install fimex-1.8.1 with metgm enable but had to change some arguments of functions to make it happen (didn't quite manage to make conversion work tho) so when I noticed that now fimex uses plugins maybe its better to use this route.

Thanks in advance!

build on debian-sid

Hi, I am having troubles building fimex on a Debian machine - the error I get is:

Step 10/14 : RUN /bin/bash /tmp/install_fimex.sh
 ---> Running in f3c675aa4198
Cloning into 'fimex'...
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
-- Found libxml2: pkg-config 'libxml-2.0>=2.6.0'
-- Found udunits2: pkg-config 'udunits>=2'
-- Found proj: pkg-config 'proj'
-- Found netcdf: pkg-config 'netcdf'
-- Checking for modules 'libxml-2.0>=2.6.0;udunits>=2;proj;netcdf'
--   Found libxml-2.0, version 2.9.10
--   Found udunits, version 2.2.26
--   Found proj, version 7.1.1
--   Found netcdf, version 4.7.4
-- Looking for nc_def_var_deflate
-- Looking for nc_def_var_deflate - found
-- Found PythonInterp: /usr/bin/python3.8 (found version "3.8.6") 
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.8.so
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- Found pybind11: /usr/include (found version "2.6.0" )
-- Python library install directory=/usr/local/lib/python3/dist-packages
-- Tests will try to find extra data in '/tmp/buildfimex/fimex/test'
-- No extra data for tests in '/tmp/buildfimex/fimex/test', please consider downloading from https://wiki.met.no/fimex/download
-- Found ncdump: /usr/bin/ncdump
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/buildfimex/fimex/build
Scanning dependencies of target libfelt
[  1%] Building CXX object src/felt/CMakeFiles/libfelt.dir/FeltField.cpp.o
[  1%] Building CXX object src/felt/CMakeFiles/libfelt.dir/FeltFile.cpp.o
In file included from /tmp/buildfimex/fimex/src/felt/FeltFile.cpp:29:
/tmp/buildfimex/fimex/include/felt/FeltFile.h:108:23: error: field 'fileName_' has incomplete type 'const string' {aka 'const std::__cxx11::basic_string<char>'}
  108 |     const std::string fileName_;
      |                       ^~~~~~~~~
In file included from /usr/include/c++/10/iosfwd:39,
                 from /usr/include/c++/10/memory:74,
                 from /tmp/buildfimex/fimex/include/felt/FeltFile.h:36,
                 from /tmp/buildfimex/fimex/src/felt/FeltFile.cpp:29:
/usr/include/c++/10/bits/stringfwd.h:74:11: note: declaration of 'std::string' {aka 'class std::__cxx11::basic_string<char>'}
   74 |     class basic_string;
      |           ^~~~~~~~~~~~
make[2]: *** [src/felt/CMakeFiles/libfelt.dir/build.make:95: src/felt/CMakeFiles/libfelt.dir/FeltFile.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:388: src/felt/CMakeFiles/libfelt.dir/all] Error 2
make: *** [Makefile:160: all] Error 2
[  0%] Building CXX object src/felt/CMakeFiles/libfelt.dir/FeltFile.cpp.o
In file included from /tmp/buildfimex/fimex/src/felt/FeltFile.cpp:29:
/tmp/buildfimex/fimex/include/felt/FeltFile.h:108:23: error: field 'fileName_' has incomplete type 'const string' {aka 'const std::__cxx11::basic_string<char>'}
  108 |     const std::string fileName_;
      |                       ^~~~~~~~~
In file included from /usr/include/c++/10/iosfwd:39,
                 from /usr/include/c++/10/memory:74,
                 from /tmp/buildfimex/fimex/include/felt/FeltFile.h:36,
                 from /tmp/buildfimex/fimex/src/felt/FeltFile.cpp:29:
/usr/include/c++/10/bits/stringfwd.h:74:11: note: declaration of 'std::string' {aka 'class std::__cxx11::basic_string<char>'}
   74 |     class basic_string;
      |           ^~~~~~~~~~~~
make[2]: *** [src/felt/CMakeFiles/libfelt.dir/build.make:95: src/felt/CMakeFiles/libfelt.dir/FeltFile.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:388: src/felt/CMakeFiles/libfelt.dir/all] Error 2
make: *** [Makefile:160: all] Error 2
The command '/bin/sh -c /bin/bash /tmp/install_fimex.sh' returned a non-zero code: 2

The build is from inside a docker environment, for which I am using the following Dockerfile:

FROM debian:sid

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get -y dist-upgrade

ARG ROOTDIR=/usr/local/ 
WORKDIR $ROOTDIR/

RUN apt-get update -y && apt-get install -y  \
	software-properties-common \
	build-essential \
	python3-dev \
	python3-numpy \
	python3-lxml \
	python3-pip \
	python3-wheel \
	python3-setuptools \
	sqlite3 \
	git \
	cmake \
        libudunits2-dev \
        libxml2-dev \
        libproj-dev \
        libnetcdf-dev \
        libcurl4-gnutls-dev \
        pkg-config \
        netcdf-bin \
        pybind11-dev \
        python3-pybind11 \
        -o APT::Install-Suggests=0 \
        -o APT::Install-Recommends=0

ADD install_fimex_dependencies.sh /tmp/install_fimex_dependencies.sh
RUN /bin/bash /tmp/install_fimex_dependencies.sh

ADD install_fimex.sh /tmp/install_fimex.sh
RUN /bin/bash /tmp/install_fimex.sh

Attaching as gist the script I use in the dockerfile:

Note: I can successfully build fimex on ubuntu, using the exact same Dockerfile - the build succeeds, by simply replacing the first line to:

FROM ubuntu:focal

I see Debian:sid ships with GCC-10 - so I tried to GCC-9 instead but I got the same error - I also tried to use GCC-10 on ubuntu and it worked ... so I guess it is not a compiler issue.c

Do you have any clue about what could be?

fimex output.type=grib2 does not write level-data for sigma or hybrid levels

The fimex grib-reader reads level-data "pv" at

size_t GribFileMessage::readLevelData(std::vector<double>& levelData, double missingValue, bool asimofHeader) const
.
When writing back to a grib file with the fimex grib-writer, this information is not written at
void GribApiCDMWriter_Impl2::setLevel(const std::string& varName, double levelValue)

The grib-file output has therefore no "pv" array attached to the vertical levels.

fiGrbmlCat fails to generate correct grbml from multiple inputs

Hi,

I'm trying to use fiGrbmlCat to merge a few *.grbml index files and produce a single GRIB index file. But it seems that fiGrbmlCat does not correctly handle such a case and produces a corrupted index file with multiple unbalanced </gribFileIndex> tags.

This problem is caused by fiGrbmlCat.cc#L130 of the grbmlExtract function, where the end tag is added after processing an input file. This function is called in a loop for each input, thus producing multiple </gribFileIndex>.

Feature request: xml-stdout option to the fimex binary

An option for fimex to output data as XML to STDOUT instead of always writing output data to a file, would be very useful in an operational environment where fimex was used to interpolate model data to a limited set of latlon locations.

This would save on cloud IO, shell startup overhead and code complexity handling parallell processes. :-)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.