NetCDF: Not a valid data type or _FillValue type mismatch - cygwin

I'm using cdo on cygwin to pre-process some CMIP6 simulations, in netcdf format.
I just got the message error for the CESM2 model :
NetCDF: Not a valid data type or _FillValue type mismatch
I never got this message error before, with other models
I am tring to convert into netcdf classic my file :
nccopy -k 'classic' in.nc out.nc
and then apply the cdo command lines remapbil and detrend.
Another option would be to download the OpenDAP file, and then to convert them in netcdf, but I do not now how to do that.
Thanks for your help

As you have said in the question it is probably easier to work with the OpenDAP files. To do this all you need to is search ESGF for what you want. Get the url from "OpenDAP Download", remove the ".dods" from it, so it ends with ".nc". If you then want to use it with CDO you would just do something like the following:
cdo seltimestep,1 http://esgf-data.ucar.edu/thredds/dodsC/esg_dataroot/CMIP6/CMIP/NCAR/CESM2/amip/r2i1p1f1/Amon/tas/gn/v20190220/tas_Amon_CESM2_amip_r2i1p1f1_gn_195001-201412.nc test.nc

Cygwin Netcdf libraries are for NETCDF 4.
$ cygcheck cdo |grep netcdf
D:\cygwin64\bin\cygnetcdf-19.dll
$ cygcheck -f /usr/bin/cygnetcdf-19.dll
libnetcdf19-4.8.1-1
NETCDF Classic is version 3
https://www.earthdata.nasa.gov/esdis/esco/standards-and-references/netcdf-classic
Have you the data available in format 4 ?

Related

openSMILE: Trying to Extract emotion features from emobase.conf results in error

I was going through the openSMILE book and in section 2.5.6, it mentioned that in order to extract emotion features, one needs to run a command of this sort:
SMILExtract_Release -C config/emobase.conf -I input.wav -O angers.arff -instname ANGER -classes {anger,fear,disgust} -classlabel anger
However, running this command gives an error:
(ERROR) [0] in commandlineParser : doParse: unknown option '-instname' on commandline!
Wanted to know how to fix this. Is -instname a deprecated option? If so, what should it be replaced with?
This is happening because config/emobase.conf doesn't have a definition for instname in the arrfsink component.
openSMILE allows to define new command line options for the openSMILE binary directly in the configuration file. If you want to define this parameter your config file must have a line like this:
instanceName=\cm[instname(N){unknown}:instance name]
You can run opensmile-2.3.0/SMILExtract -h to see which CMD options are available regardless of the configuration file. Other CMD parameters such as -instname should be defined in the configfile. Please check "config\shared\standard_data_output.conf.inc" for an example o how to define this command line option for your configuration file.

Custom extension for haskell file

Is it possible to customize the extension that haskell files can have?
That is, to tell GHC that a file with extension .yy.xxx should be accepted as a valid haskell file, and that a file with extension .yy.lxx should be accepted as literate haskell?
GHC has a -x option to override the meaning of file suffixes, see the user guide:
-x ⟨suffix⟩
Causes all files following this option on the command line to be processed as if they had the suffix ⟨suffix⟩. For example, to compile a Haskell module in the file M.my-hs, use ghc -c -x hs M.my-hs.
I've used this to compile .md files as .lhs (instead of storing the files directly as .lhs, which may prevent other tooling from telling the format to render from).

what is the proper syntax of gmic apply_video

I am trying to apply a gmic filters using apply_video option of gmic utility for linux .
./gmic --apply_video 'small.mp4','-denoise 30,10' -o convert.avi
but the output is an error in terminal
[gmic]-0./ Start G'MIC interpreter.
[gmic]-0./ Apply command 'small.mp4,-denoise 30,10' on video stream '', with output filename '', first frame 0, last frame -1 and frame step 1.
[gmic] *** Error in ./apply_video/*local/*substitute/ *** Command '-basename': Undefined argument '$1', in expression '$1' (for 2 arguments specified).
[gmic] Command '-basename' has the following description:
-basename:
file_path,_variable_name_for_folder
Return the basename of a file path, and opt. its folder location.
When specified 'variable_name_for_folder' must starts by an underscore
(global variable accessible from calling function).
so what is the correct syntax for gmic --apply_video ?
I am using version 1.7.3
I'm using latest available version 1.7.5_pre, and I use it like this :
$ gmic -w -apply_video input.avi,\"-denoise 30,10\",0,-1,1,output.avi
For G'MIC options, you can use the excellent offline help
gmic -h
or
gmic -h -apply_video
Which as of version 1.7.8 gives
gmic: GREYC's Magic for Image Computing.
Version 1.7.8, Copyright (c) 2008-2016, David Tschumperle.
(http://gmic.eu)
-apply_video:
video_filename,_"command",_first_frame>=0,_last_frame={ >=0 | -1=last },
_frame_step>=1,_output_filename
Apply a G'MIC command on all frames of the specified input video file, in a streamed way.
If a display window is opened, rendered frames are displayed in it during processing.
The output filename may have extension '.avi' (saved as a video), or any other usual image file
extension (saved as a sequence of images).
Default values: 'first_frame=0', 'last_frame=-1', 'frame_step=1' and
'output_filename=(undefined)'.

add a permitted path to ghostscipt running configuration

I use a program which create me postscript file before using ps2pdf to make it a readable pdf, i've made a program which add some string to overwrite the company new logo. (The first program can't import image file itself).
I add the string before the before-last line of the file (" showpage").
While running my program to add the logo there is no error.
With the option -dNOSAFER everything is fine, but by default it's set to -dSAFER, and an invalidfileaccess error pop, the files are 6 jpg images alone in their directory.
I don't want to make it run with the -dNOSAFER option on. As it will fully open the file system.
In the documentation I've seen that there is a "permitted path" setting, but i can't find nowhere to set this up. Is it just a command line option to set in the command launching the program ? Or is there a config file for GhostScript / ps2pdf where i can put the path to this directory as permitted path.
in this documentation :
http://www.ghostscript.com/doc/current/Use.htm
I only find
-dTTYPAUSE
Causes Ghostscript to read a character from /dev/tty, rather than
standard input, at the end of each page. This may be useful if input
is coming from a pipe. Note that -dTTYPAUSE overrides -dNOPAUSE. Also
note that -dTTYPAUSE requires opening the terminal device directly,
and may cause problems in combination with -dSAFER. Permission errors
can be avoided by adding the device to the permitted reading list
before invoking safer mode
gs -dTTYPAUSE -dDELAYSAFER -c '<< /PermitFileReading [ (/dev/tty)] >> setuserparams .locksafe' -dSAFER
The quote is just for the context but is this a way to put the permitted path ?
As gs automatically launch with the full system as readOnly there will be no difference ? There is no other find result for PermitFile in this page.
Try adding the required path to the search path with -I (Include) See Use.htm, section 8 How Ghostscript finds files. This should only be a problem if you are using 'run' or similar to read files from another location.
The section on TTYPAUSE is not relevant.

"Unable to open image" error when using ImageMagick's Filename References

I'm using ImageMagick to do some image processing from the commandline, and would like to operate on a list of files as specified in foo.txt. From the instructions here: http://www.imagemagick.org/script/command-line-processing.php I see that I can use Filename References from a file prefixed with #. When I run something like:
montage #foo.txt output.jpg
everything works as expected, as long as foo.txt is in the current directory. However, when I try to access bar.txt in a different directory by running:
montage /some_directory/#bar.txt
output2.jpg
I get:
montage: unable to open image
/some_directory/#bar.txt: No such file
or directory # blob.c/OpenBlob/2480.
I believe the issue is my syntax, but I'm not sure what to change it to. Any help would be appreciated.
Quite an old entry but it seems relatively obvious that you need to put the # before the full path:
montage #/some_directory/bar.txt output2.jpg
As of ImageMagick 6.5.4-7 2014-02-10, paths are not supported with # syntax. The # file must be in the current directory and identified by name only.
I haven't tried directing IM to pull the list of files from a file, but I do specify multiple files on the command line like this:
gm -sOutputFile=dest.ext -f file1.ppm file2.ppm file3.ppm
Can you pull the contents of that file into a variable, and then let the shell expand that variable?

Resources