Bug#1069269: Enable OpenGL support to Gwyddion

2024-04-18 Thread Nicola Ferralis

Package: gwyddion
Version: 2.64-1.1

By default the debian package of gwyddion is built without OpenGL support. This 
prevents gwyddion to render 3D display of the data, which is often needed for 
publication of SPM data.
The attached patch (which changes debian/rules and debian/control only, enable 
OpenGL. This has been tested and correctly working.

I am using Ubuntu 22.04 and Debian Unstable.
diff -Nru gwyddion-2.64.orig/debian/control gwyddion-2.64/debian/control
--- gwyddion-2.64.orig/debian/control   2024-02-28 04:26:43
+++ gwyddion-2.64/debian/control2024-04-18 22:03:07
@@ -6,6 +6,7 @@
 Build-Depends: dpkg-dev (>= 1.22.5), debhelper-compat (= 13),
pkg-config,
libgtk2.0-dev,
+   libgtkglext1-dev,
libfftw3-dev,
libminizip-dev,
libxmu6,
diff -Nru gwyddion-2.64.orig/debian/rules gwyddion-2.64/debian/rules
--- gwyddion-2.64.orig/debian/rules 2023-11-27 14:30:09
+++ gwyddion-2.64/debian/rules  2024-04-18 22:02:30
@@ -2,7 +2,7 @@
 
 export DEB_BUILD_MAINT_OPTIONS=hardening=+bindnow
 
-DEB_CONFIGURE_EXTRA_FLAGS := --libexecdir=\$${libdir} --disable-pygwy
+DEB_CONFIGURE_EXTRA_FLAGS := --libexecdir=\$${libdir} --disable-pygwy --with-gl
 
 include /usr/share/dpkg/default.mk
 


Bug#1043014: (no subject)

2023-08-05 Thread Nicola Ferralis

Patches for Ubuntu Mantic have been discussed and approved:

https://bugs.launchpad.net/ubuntu/+source/blender/+bug/2029503

Patch available:

https://git.launchpad.net/~ahasenack/ubuntu/+source/blender/tree/debian/patches/0004-fix-support-ffmpeg6.patch?h=mantic-blender-ftbfs-ffmpeg6



Bug#1043015: Add support for ffmpeg 6.0 for python-av

2023-08-04 Thread Nicola Ferralis

Package: python-av
Version: 10.0.0-1+b1

Python-av currently does not compile against ffmpeg 6.0.


Upstream has released a patch that adds support for ffmpeg 6.0:
https://github.com/PyAV-Org/PyAV/pull/1110 


or from freebsd:
https://github.com/freebsd/freebsd-ports/commit/390ed23a4df4b6075f7ae83a6b85f589a5d4b770 



The patch is attached below. When applied, compilation completes normally.

I am using Ubuntu Mantic 23.10 (testing).diff -Nru PyAV-10.0.0.orig/av/codec/codec.pyx PyAV-10.0.0/av/codec/codec.pyx
--- PyAV-10.0.0.orig/av/codec/codec.pyx 2022-10-17 22:02:46
+++ PyAV-10.0.0/av/codec/codec.pyx  2023-08-03 17:45:30
@@ -52,7 +52,6 @@
 """Codec uses get_buffer() for allocating buffers and supports custom 
allocators.
 If not set, it might not use get_buffer() at all or use operations that
 assume the buffer was allocated by avcodec_default_get_buffer."""),
-('TRUNCATED', lib.AV_CODEC_CAP_TRUNCATED),
 ('HWACCEL', 1 << 4),
 ('DELAY', lib.AV_CODEC_CAP_DELAY,
 """Encoder or decoder requires flushing with NULL input at the end in 
order to
@@ -102,8 +101,10 @@
 """Codec supports slice-based (or partition-based) multithreading."""),
 ('PARAM_CHANGE', lib.AV_CODEC_CAP_PARAM_CHANGE,
 """Codec supports changed parameters at any point."""),
-('AUTO_THREADS', lib.AV_CODEC_CAP_AUTO_THREADS,
-"""Codec supports avctx->thread_count == 0 (auto)."""),
+('AUTO_THREADS', lib.AV_CODEC_CAP_OTHER_THREADS,
+"""Codec supports multithreading through a method other than slice- or
+frame-level multithreading. Typically this marks wrappers around
+multithreading-capable external libraries."""),
 ('VARIABLE_FRAME_SIZE', lib.AV_CODEC_CAP_VARIABLE_FRAME_SIZE,
 """Audio encoder supports receiving a different number of samples in 
each call."""),
 ('AVOID_PROBING', lib.AV_CODEC_CAP_AVOID_PROBING,
@@ -114,10 +115,6 @@
 the stream.
 A decoder marked with this flag should only be used as last resort
 choice for probing."""),
-('INTRA_ONLY', lib.AV_CODEC_CAP_INTRA_ONLY,
-"""Codec is intra only."""),
-('LOSSLESS', lib.AV_CODEC_CAP_LOSSLESS,
-"""Codec is lossless."""),
 ('HARDWARE', lib.AV_CODEC_CAP_HARDWARE,
 """Codec is backed by a hardware implementation. Typically used to
 identify a non-hwaccel hardware decoder. For information about 
hwaccels, use
@@ -308,7 +305,6 @@
 
 draw_horiz_band = capabilities.flag_property('DRAW_HORIZ_BAND')
 dr1 = capabilities.flag_property('DR1')
-truncated = capabilities.flag_property('TRUNCATED')
 hwaccel = capabilities.flag_property('HWACCEL')
 delay = capabilities.flag_property('DELAY')
 small_last_frame = capabilities.flag_property('SMALL_LAST_FRAME')
diff -Nru PyAV-10.0.0.orig/av/codec/context.pyx PyAV-10.0.0/av/codec/context.pyx
--- PyAV-10.0.0.orig/av/codec/context.pyx   2022-10-17 22:02:46
+++ PyAV-10.0.0/av/codec/context.pyx2023-08-03 17:46:57
@@ -96,9 +96,6 @@
 """Only decode/encode grayscale."""),
 ('PSNR', lib.AV_CODEC_FLAG_PSNR,
 """error[?] variables will be set during encoding."""),
-('TRUNCATED', lib.AV_CODEC_FLAG_TRUNCATED,
-"""Input bitstream might be truncated at a random location
-instead of only at frame boundaries."""),
 ('INTERLACED_DCT', lib.AV_CODEC_FLAG_INTERLACED_DCT,
 """Use interlaced DCT."""),
 ('LOW_DELAY', lib.AV_CODEC_FLAG_LOW_DELAY,
@@ -122,8 +119,6 @@
 """Skip bitstream encoding."""),
 ('LOCAL_HEADER', lib.AV_CODEC_FLAG2_LOCAL_HEADER,
 """Place global headers at every keyframe instead of in extradata."""),
-('DROP_FRAME_TIMECODE', lib.AV_CODEC_FLAG2_DROP_FRAME_TIMECODE,
-"""Timecode is in drop frame format. DEPRECATED"""),
 ('CHUNKS', lib.AV_CODEC_FLAG2_CHUNKS,
 """Input bitstream might be truncated at a packet boundaries
 instead of only at frame boundaries."""),
@@ -168,10 +163,6 @@
 self.ptr.thread_count = 0
 self.ptr.thread_type = 2
 
-# Use "ass" format for subtitles (default as of FFmpeg 5.0), not the
-# deprecated "ass_with_timings" formats.
-self.ptr.sub_text_format = 0
-
 def _get_flags(self):
 return self.ptr.flags
 
@@ -195,7 +186,6 @@
 loop_filter = flags.flag_property('LOOP_FILTER')
 gray = flags.flag_property('GRAY')
 psnr = flags.flag_property('PSNR')
-truncated = flags.flag_property('TRUNCATED')
 interlaced_dct = flags.flag_property('INTERLACED_DCT')
 low_delay = flags.flag_property('LOW_DELAY')
 global_header = flags.flag_property('GLOBAL_HEADER')
@@ -219,7 +209,6 @@
 fast = flags2.flag_property('FAST')
 no_output = flags2.flag_property('NO_OUTPUT')
 local_header = flags2.flag_property('LOCAL_HEADER')

Bug#1043014: Add support for ffmpeg 6.0 for blender

2023-08-04 Thread Nicola Ferralis

Package: blender
Version: 3.4.1+dfsg-2+b1

Blender currently does not compile against ffmpeg 6.0. Support for 
ffmpeg 6 can be added by applying the attached patch developed for freebsd:


https://cgit.freebsd.org/ports/commit/?id=0ed9c88a8c2de8744cb63163bdff9f9e4a71693e 



Compilation is successful with the patch, which is provided with this 
bug report.


I am using Ubuntu Mantic 23.10 (testing).

diff -Nru blender-3.4.1.orig/source/blender/blenkernel/intern/writeffmpeg.c 
blender-3.4.1/source/blender/blenkernel/intern/writeffmpeg.c
--- blender-3.4.1.orig/source/blender/blenkernel/intern/writeffmpeg.c   
2022-11-08 14:50:16
+++ blender-3.4.1/source/blender/blenkernel/intern/writeffmpeg.c
2023-08-03 16:09:41
@@ -855,7 +855,7 @@
 255);
   st->avg_frame_rate = av_inv_q(c->time_base);
 
-  if (codec->capabilities & AV_CODEC_CAP_AUTO_THREADS) {
+  if (codec->capabilities & AV_CODEC_CAP_OTHER_THREADS) {
 c->thread_count = 0;
   }
   else {
diff -Nru blender-3.4.1.orig/source/blender/imbuf/intern/anim_movie.c 
blender-3.4.1/source/blender/imbuf/intern/anim_movie.c
--- blender-3.4.1.orig/source/blender/imbuf/intern/anim_movie.c 2022-11-04 
01:33:07
+++ blender-3.4.1/source/blender/imbuf/intern/anim_movie.c  2023-08-03 
16:10:39
@@ -554,7 +554,7 @@
   avcodec_parameters_to_context(pCodecCtx, video_stream->codecpar);
   pCodecCtx->workaround_bugs = FF_BUG_AUTODETECT;
 
-  if (pCodec->capabilities & AV_CODEC_CAP_AUTO_THREADS) {
+  if (pCodec->capabilities & AV_CODEC_CAP_OTHER_THREADS) {
 pCodecCtx->thread_count = 0;
   }
   else {
diff -Nru blender-3.4.1.orig/source/blender/imbuf/intern/indexer.c 
blender-3.4.1/source/blender/imbuf/intern/indexer.c
--- blender-3.4.1.orig/source/blender/imbuf/intern/indexer.c2022-11-04 
01:33:07
+++ blender-3.4.1/source/blender/imbuf/intern/indexer.c 2023-08-03 16:11:19
@@ -559,7 +559,7 @@
   av_dict_set(_opts, "preset", "veryfast", 0);
   av_dict_set(_opts, "tune", "fastdecode", 0);
 
-  if (rv->codec->capabilities & AV_CODEC_CAP_AUTO_THREADS) {
+  if (rv->codec->capabilities & AV_CODEC_CAP_OTHER_THREADS) {
 rv->c->thread_count = 0;
   }
   else {
@@ -872,7 +872,7 @@
   avcodec_parameters_to_context(context->iCodecCtx, 
context->iStream->codecpar);
   context->iCodecCtx->workaround_bugs = FF_BUG_AUTODETECT;
 
-  if (context->iCodec->capabilities & AV_CODEC_CAP_AUTO_THREADS) {
+  if (context->iCodec->capabilities & AV_CODEC_CAP_OTHER_THREADS) {
 context->iCodecCtx->thread_count = 0;
   }
   else {


Bug#1041378: (no subject)

2023-08-02 Thread Nicola Ferralis

The most relevant change is in the file:

libavutil/hwcontext_qsv.h

where in ffmpeg 5.1.3 it used to read (line 22):

#include 

while in ffmpeg 6.0:

#include 

That said, simply adding the folder mfx/ in ffmpeg 6.0 leads to a 
compilation error for ffmpeg:


In file included from src/libavfilter/qsvvpp.h:32,
 from src/libavfilter/qsvvpp.c:30:
src/libavutil/hwcontext_qsv.h:22:10: fatal error: mfx/mfxvideo.h: No such file 
or directory
   22 | #include 
  |  ^~~~
compilation terminated.


Bug#994206: libopenshot requires deprecated libavresample-dev, leading to broken system

2021-09-13 Thread Nicola Ferralis

Package: libopenshot
Version: 0.2.5+dfsg1-5

libopenshot (v. 0.2.5+dfsg1-5) requires libavresample-dev in 
deboan/control. However, with FFmpeg 4.4-6, libavresample-dev is not 
available in version 4.4-5, leaving the system broken. Replacing 
libavresample-dev with libswresample-dev in debian/control fixes the issue.


I am using Ubuntu 20.04, kernel 5.11.0-34-generic and libc6 2.31-0ubuntu9.



Bug#994205: Compilation of libopenshot fails with FFmpeg 4.4

2021-09-13 Thread Nicola Ferralis


Package: libopenshot
Version: 0.2.5+dfsg1-5

When libopenshot (v. 0.2.5+dfsg1-5) is compiled with FFMPEG 4.4-6 (now 
in bookworm/sid) compilation fails.



The patch in attachment (proposed here: 
https://github.com/OpenShot/libopenshot/pull/698) fixes the issue.


I am using Ubuntu 20.04, kernel 5.11.0-34-generic and libc6 2.31-0ubuntu9.diff -Nru libopenshot-0.2.5.orig/src/FFmpegWriter.cpp 
libopenshot-0.2.5/src/FFmpegWriter.cpp
--- libopenshot-0.2.5.orig/src/FFmpegWriter.cpp 2020-03-03 03:00:06.0 
-0500
+++ libopenshot-0.2.5/src/FFmpegWriter.cpp  2021-09-11 22:05:52.0 
-0400
@@ -1710,7 +1710,10 @@

 audio_encoder_buffer_size, 0);
 
// Create output frame (and allocate arrays)
-   frame_final->nb_samples = 
audio_input_frame_size;
+frame_final->nb_samples = audio_input_frame_size;
+frame_final->channels = info.channels;
+frame_final->format = audio_codec->sample_fmt;
+frame_final->channel_layout = info.channel_layout;
av_samples_alloc(frame_final->data, 
frame_final->linesize, info.channels, frame_final->nb_samples, 
audio_codec->sample_fmt, 0);
 
// Convert audio samples

 RUNNING ALL TESTS

[libvpx @ 0x5620a7020700] v1.10.0
[libvpx @ 0x5620a7020700] Ignoring attempt to flush encoder that doesn't 
support it
[libx264 @ 0x5620a7363100] using cpu capabilities: MMX2 SSE2 SSE3 Cache64
[libx264 @ 0x5620a7363100] profile High, level 3.1, 4:2:0, 8-bit
[libx264 @ 0x5620a7363100] 264 - core 160 r3011 cde9a93 - H.264/MPEG-4 AVC 
codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options: 
cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 
psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 
deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=8 lookahead_threads=1 
sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 
constrained_intra=0 bframes=0 weightp=2 keyint=12 keyint_min=1 scenecut=40 
intra_refresh=0 rc_lookahead=12 rc=abr mbtree=1 bitrate=5000 ratetol=1.0 
qcomp=0.60 qpmin=2 qpmax=30 qpstep=4 ip_ratio=1.40 aq=1:1.00
[libx264 @ 0x5620a7363100] Ignoring attempt to flush encoder that doesn't 
support it
[libx264 @ 0x5620a7363100] Ignoring attempt to flush encoder that doesn't 
support it
[libx264 @ 0x5620a7363100] Ignoring attempt to flush encoder that doesn't 
support it
[libx264 @ 0x5620a7363100] Ignoring attempt to flush encoder that doesn't 
support it
[libx264 @ 0x5620a7363100] Ignoring attempt to flush encoder that doesn't 
support it
[libx264 @ 0x5620a7363100] Ignoring attempt to flush encoder that doesn't 
support it
[libx264 @ 0x5620a7363100] Ignoring attempt to flush encoder that doesn't 
support it
[libx264 @ 0x5620a7363100] Ignoring attempt to flush encoder that doesn't 
support it
[libx264 @ 0x5620a7363100] Ignoring attempt to flush encoder that doesn't 
support it
[libx264 @ 0x5620a7363100] Ignoring attempt to flush encoder that doesn't 
support it
[libx264 @ 0x5620a7363100] Ignoring attempt to flush encoder that doesn't 
support it
[libx264 @ 0x5620a7363100] Ignoring attempt to flush encoder that doesn't 
support it
[libx264 @ 0x5620a7363100] Ignoring attempt to flush encoder that doesn't 
support it
[libx264 @ 0x5620a7363100] Ignoring attempt to flush encoder that doesn't 
support it
[libx264 @ 0x5620a7363100] Ignoring attempt to flush encoder that doesn't 
support it
[libx264 @ 0x5620a7363100] Ignoring attempt to flush encoder that doesn't 
support it
[libx264 @ 0x5620a7363100] Ignoring attempt to flush encoder that doesn't 
support it
[libx264 @ 0x5620a7363100] Ignoring attempt to flush encoder that doesn't 
support it
[libx264 @ 0x5620a7363100] Ignoring attempt to flush encoder that doesn't 
support it
[libx264 @ 0x5620a7363100] Ignoring attempt to flush encoder that doesn't 
support it
[libx264 @ 0x5620a7363100] Ignoring attempt to flush encoder that doesn't 
support it
[libx264 @ 0x5620a7363100] Ignoring attempt to flush encoder that doesn't 
support it
/home/nicola/Software/Ubuntu/openshot/test/libopenshot-0.2.5+dfsg1/tests/FFmpegWriter_Tests.cpp:116:1:
 error: Failure in Options_Overloads: Expected 1 but was 0
/home/nicola/Software/Ubuntu/openshot/test/libopenshot-0.2.5+dfsg1/tests/FFmpegWriter_Tests.cpp:119:1:
 error: Failure in Options_Overloads: Expected 2 but was 0
/home/nicola/Software/Ubuntu/openshot/test/libopenshot-0.2.5+dfsg1/tests/FFmpegWriter_Tests.cpp:120:1:
 error: Failure in Options_Overloads: Expected 3 but was 4
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
FAILURE: 1 out of 93 tests failed (3 failures).
Test time: 23.54 seconds.

Bug#994002: MPlayer fails to compile against ffmpeg 4.4

2021-09-09 Thread Nicola Ferralis

Package: mplayer
Version:2:1.4+ds1-1

When MPlayer (v. 2:1.4+ds1-1) is compiled with FFMPEG 4.4-5 (now in 
bookworm/sid) compilation fails. Log:


In file included from libmpcodecs/ad_spdif.c:25:
/usr/include/x86_64-linux-gnu/libavformat/avformat.h:888:21: note: 
declared here

  888 | AVCodecContext *codec;
  | ^
libmpcodecs/ad_spdif.c:303:43: error: 'AVStream' {aka 'struct AVStream'} 
has no member named 'info'

  303 | av_freep(_ctx->streams[0]->info);
  | ^~
make[2]: *** [Makefile:726: libmpcodecs/ad_spdif.o] Error 1
make[2]: *** Waiting for unfinished jobs

The patch in attachment (proposed here: 
https://bbs.archlinux.org/viewtopic.php?id=265578 
) fix the issue.


I am using Ubuntu 20.04, kernel 5.11.0-34-generic and libc6 2.31-0ubuntu9.
diff -Nru MPlayer-1.4.orig/libmpcodecs/ad_spdif.c 
MPlayer-1.4/libmpcodecs/ad_spdif.c
--- MPlayer-1.4.orig/libmpcodecs/ad_spdif.c 2016-03-06 08:00:49.0 
-0500
+++ MPlayer-1.4/libmpcodecs/ad_spdif.c  2021-09-09 10:22:49.0 -0400
@@ -298,14 +298,8 @@
 if (spdif_ctx->header_written)
 av_write_trailer(lavf_ctx);
 av_freep(_ctx->pb);
-if (lavf_ctx->streams) {
-av_freep(_ctx->streams[0]->codec);
-av_freep(_ctx->streams[0]->info);
-av_freep(_ctx->streams[0]);
-}
-av_freep(_ctx->streams);
-av_freep(_ctx->priv_data);
+avformat_free_context(lavf_ctx);
+lavf_ctx = NULL;
 }
-av_freep(_ctx);
 av_freep(_ctx);
 }


Bug#840912: Add minizip dependency to gwyddion

2016-10-15 Thread Nicola Ferralis
Package: gwyddion
Version: 2.45-1

Gwyddion uses the minizip library to work with zip-compressed files
such as .plux.  Minizip is widely available because it comes with zlib,
a base compression library used just about everywhere in everything. 
Yet, it is not a required nor recommended dependency in the debian 
gwyddion package, which makes the feature of opening zipped packages 
missing in debian.

Adding a simple dependency to libminizip-dev in the control file seems 
to work. Tested on several versions of Ubuntu.




Bug#688771: Update gwyddion to version 2.30

2012-09-25 Thread Nicola Ferralis
Package: gwyddion
Version: 2.29-2Gwyddion 2.30 has been released upstream. In debian it's in 
version 2.29. This bug report request for an upgrade.

Please find attached a modified version of the fix-rpath-issue.patch. This new 
patches allow for successful compilation (it fails with th eolder one in 
2.29-2).

Changelog:

Application
Translations updated: French, Russian.
Handling of files with non-ASCII characters in names on Win32 was improved.

Libraries
libgwyprocess: A new function to remove grains touching image borders.
libgwyprocess: New grain quantities: Radius and position of maximum
inscribed disc and minimum excscribed circle, area of grain convex hull,
mean radius.
libgwyapp: Critical warning/crash if the last visible channel of a file is
deleted and this channel has a mask.
libgwyapp: Setting a channel or graph visibility key in a container
actually shows or hides the corresponding data.

Modules
Neural network: Split to two functions: training and application.  Networks
can be saved, trained on multiple data (sequentially), training signal can
be masked, units of the output can be specified.
APE file: Channel labelling for various modes was corrected.
Createc: Dimensions and values of imported data was corrected, all channels
are imported now.
IGOR file: Crash on files that contain no channel titles was fixed.
Selection manager tool: Chosen selection is shown in the data window.
Remove Grain by Threshold: Can also remove grains touching image borders.
Grain Statistics: Select Inscribed Discs and Select Excscribed Circles
create circular selections visualising the corresponding discs/circles.
Grain correlations: Really works when run non-interactively.

Other
Compatibility with newer version of GLib that deprecate various things was
improved.
  

fix-rpath-issue.patch
Description: Binary data


Bug#686688: Upgrade Gwyddion to version 2.29

2012-09-04 Thread Nicola Ferralis
Package: gwyddion
Version: 2.28-2

Gwyddion 2.29 has been released a few weeks ago upstream.  Gwyddion, howeevr 
it's still in version 2.28 in debian.

Changelog: 2.28 - 2.29 

Application
Translations updated: Czech, French, Russian.

Libraries
libgwyprocess: New function to calculate grain-wise rms.
libgwymodule: gwy_file_get_data_info() sets its arguments to NULL if no file
info is found, fixing a possible crash if newly generated data are saved.
libgwyapp: Recent file names are compared canonicalized, fixing repetition
of the same file in document history on MS Windows.

Modules
Pixmap: Scalebar ticks and label can be enabled/disabled.
Grain statistics: Displays total projected boundary length.
Median line correction: Masking is supported.
TIA SER: Spectral data import is supported.
Statistical quantities: New quantity was added: grain-wise rms.
Omicron: Files created by SPIP are recognised and loaded.
Nanoscope: Support for old files without @2:Z scale was improved.
Object synthesis: A bug causing Critical warning/crash during the generation
of non-square data was fixed.
Seiko: The guesswork involved in loading of non-square files was somewhat
improved.
Neural network: Result model size can differ from source, miscallaneous small
improvements.

Other
Standalone python gwy module is available (experimental).
Several icons were improved.
 
Using Ubuntu 12.04, kernel 3.2.

  

Bug#675132: [Debian-med-packaging] Bug#675132: No gwyddion (2.28) thumbnailer available for Gnome 3

2012-05-30 Thread Nicola Ferralis

Hi Jan,

No problem, thanks for taking care of this.

Best,
Nicola

 

 Date: Wed, 30 May 2012 21:35:50 +0200
 From: j...@beathovn.de
 To: feran...@hotmail.com; 675...@bugs.debian.org
 Subject: Re: [Debian-med-packaging] Bug#675132: No gwyddion (2.28) 
 thumbnailer available for Gnome 3
 
 Hi Nicolas,
 
 the culprit is a missing line in debian/gwyddion-common.install:
 
 --- debian/gwyddion-common.install(Revision 10971)
 +++ debian/gwyddion-common.install(Arbeitskopie)
 @@ -3,3 +3,4 @@
  usr/share/icons/
  usr/share/gwyddion/
  usr/share/mime/packages/
 +usr/share/thumbnailers/
 
 With this line, the thumbnailer installs and works fine.
 
 Sorry for forgetting about this. In a minute, I will upload gwyddion 2.28-2
 to Debian unstable.
 
 Thanks for the bug report!
 
 Jan
 
 Und es begab sich am 30.05.2012 06:55, dass Nicola Ferralis schrieb:
  Package: gwyddion
  Version: 2.28-1
  
  One of the features of gwyddion 2.28 is the presence of a gnome 3
  thumbnailer. The file should be installed, but apparently it is not in
  Ubuntu. While it is compiled in the temporary building folder, it is not
  packaged. Upon the installation of the packages for ubuntu [1], there is no
  thumbnailer in /usr/share/.
  
  
  
  I am not sure if the same applies to debian, it would be good to check (I
  don't have any debian system to test it myself), but it affects ubuntu.
  
  
  Thanks for any insight.
  Nicola
  
  
  [1] https://launchpad.net/~gwyddion-spm/+archive/ppa
 
 
 -- 
 Jan Beyer happy Debian Maintainer ;-) 
 
 mail  j...@beathovn.deGPG key ID 0x0CA6B4AA
 jabberbeath...@jabber.org
 web   http://www.beathovn.de/
  

Bug#675132: No gwyddion (2.28) thumbnailer available for Gnome 3

2012-05-29 Thread Nicola Ferralis

Package: gwyddion
Version: 2.28-1

One of the features of gwyddion 2.28 is the presence of a gnome 3 thumbnailer. 
The file should be installed, but apparently it is not in Ubuntu. While it is 
compiled in the temporary building folder, it is not packaged. Upon the 
installation of the packages for ubuntu [1], there is no thumbnailer in 
/usr/share/. 

I am not sure if the same applies to debian, it would be good to check (I don't 
have any debian system to test it myself), but it affects ubuntu.
Thanks for any insight.Nicola
[1] https://launchpad.net/~gwyddion-spm/+archive/ppa
  

Bug#655036: Add rmtpdump dependency to youtube-dl

2012-01-07 Thread Nicola Ferralis

Package: youtube-dl
Version: 2012.01.05-1Downloading movies from Comedy Central requires rtmpdump 
to work. However rtmpdump is not listed as a dependency in the debian package. 
When youtube-dl is installed (but rtmpdump is not) downloading movies fails 
because rtmpdump is not found.

Using Ubuntu Oneiric 11.10.

  

Bug#655038: rtmpdump exits with code 1, when downloading movie from ComedyCentral

2012-01-07 Thread Nicola Ferralis

Package: youtube-dl
Version: 2012.01.05-1
If  I try to download a movie from comedy central, for example:

youtube-dl -t 
http://www.thedailyshow.com/full-episodes/thu-january-5-2012-craig-shirley;

I get this error:

[comedycentral] thu-january-5-2012-craig-shirley: Extracting information
[comedycentral] thu-january-5-2012-craig-shirley: Determining player URL
[comedycentral] thu-january-5-2012-craig-shirley: Downloading show index
[comedycentral] thu-january-5-2012-craig-shirley: Downloading configuration
[download] Destination: thedailyshow-thu-january-5-2012-craig-shirley-405251.mp4
[rtmpdump] 0 bytes
ERROR: rtmpdump exited with code 1




A sample movie: 


http://www.thedailyshow.com/full-episodes/thu-january-5-2012-craig-shirley




Using Ubuntu Oneiric 11.10.


 

  

Bug#655041: Update gwyddion to version 2.26 from upstream

2012-01-07 Thread Nicola Ferralis

Package: gwyddion
Version: 2.25-2Gwyddion 2.26 has been released upstream with significantly 
improved or new features, such as 3D overlays,
configurable keyboard shortcuts and new file modules:

http://gwyddion.net/news.php#v2.26

Gwyddion in unstable is still in version 2.25 and should be updated to version 
2.26

Using Ubuntu Oneiric 11.10
  

Bug#655038: rtmpdump exits with code 1, when downloading movie from ComedyCentral

2012-01-07 Thread Nicola Ferralis

The attached patch resolves the issue for rtmpdump version 
2.4~20110711.gitc28f1bab-1. It is taken directly from upstream.



http://lists.mplayerhq.hu/pipermail/rtmpdump/attachments/20110908/2a239630/attachment.bin

  

debian-655038.diff
Description: Binary data


Bug#605311:

2010-11-30 Thread Nicola Ferralis
Patch: Add explanation in help menu about movie format code
Description: Add explanation in help menu about movie format code
Author: Nicola Ferralis feran...@hotmail.com
Debian-bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=605311
diff -Nru rg3-youtube-dl-f8dc441.orig//youtube-dl rg3-youtube-dl-f8dc441/youtube-dl
--- rg3-youtube-dl-f8dc441.orig//youtube-dl	2010-11-19 10:41:09.0 -0800
+++ rg3-youtube-dl-f8dc441/youtube-dl	2010-11-30 13:09:00.984755711 -0800
@@ -2177,7 +2177,7 @@
 
 		video_format = optparse.OptionGroup(parser, 'Video Format Options')
 		video_format.add_option('-f', '--format',
-action='store', dest='format', metavar='FORMAT', help='video format code')
+action='store', dest='format', metavar='FORMAT', help='video format code: WebM (480p: 43 - 720p: 45) - Mobile 360p: 18 - H264 (720p: 22 - 1080p: 37)')
 		video_format.add_option('-m', '--mobile-version',
 action='store_const', dest='format', help='alias for -f 17', const='17')
 		video_format.add_option('--all-formats',


Bug#605311:

2010-11-30 Thread Nicola Ferralis
Hi Rogerio,

Your suggestion makes a lot of sense. Please find a new patch for the
manfile. The explanation of the codes is taken from Wikipedia:

http://en.wikipedia.org/wiki/YouTube#Quality_and_codecs

Regards,
Nicola

2010/11/30 Rogério Brito rbr...@ime.usp.br

 Hi, Nicola.

 On Nov 30 2010, Nicola Ferralis wrote:
  Description: Add explanation in help menu about movie format code
  Author: Nicola Ferralis feran...@hotmail.com
  Debian-bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=605311

 (...)

  - action='store', dest='format',
 metavar='FORMAT', help='video format code')
  + action='store', dest='format',
 metavar='FORMAT', help='video format code: WebM (480p: 43 - 720p: 45) -
 Mobile 360p: 18 - H264 (720p: 22 - 1080p: 37)')

 I am not willing to apply a patch to the script itself, but I will *gladly*
 accept patches to the manpage, with more detailed descriptions of the
 meaning of what the video formats may mean.

 There are some reasons for that:

 * The source code is more volatile than the documentation.

 * The meaning of the video formats vary from site to site.

  For instance, I usually grab videos from video.google.com and the meaning
  of the format there is not the same as for youtube. I am also implementing
  upstream the ability to grab videos from vimeo.com and it seems that,
 there,
  we only have SD and HD videos.

 * The manpage can hold a detailed description of the details above, while
  having them in the source code is not the right place.

 So, if you send me a patch to the manpage, I am willing to upload a new
 revision of the package.


 Regards,

 --
 Rogério Brito : rbr...@{ime.usp.br,gmail.com} : GPG key 4096R/BCFC
 http://rb.doesntexist.org : Packages for LaTeX : algorithms.berlios.de
 DebianQA: http://qa.debian.org/developer.php?login=rbrito%40ime.usp.br

Description: Add explanation in manpage about movie format code
Author: Nicola Ferralis feran...@hotmail.com
Origin: http://en.wikipedia.org/wiki/YouTube#Quality_and_codecs
Debian-bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=605311
diff -Nru rg3-youtube-dl-f8dc441.orig//debian/youtube-dl.1 rg3-youtube-dl-f8dc441/debian/youtube-dl.1
--- rg3-youtube-dl-f8dc441.orig//debian/youtube-dl.1	2010-08-09 10:38:59.0 -0700
+++ rg3-youtube-dl-f8dc441/debian/youtube-dl.1	2010-11-30 14:41:19.840755711 -0800
@@ -189,8 +189,10 @@
 home directory. The machine name is youtube regarding this usage.
 .IP \-f \fB\s-1FMT\s0\fR, \-\-format=\fB\s-1FMT\s0\fR 4
 .IX Item -f FMT, --format=FMT
-Specify the video format (quality) in which to download the video. Note
-that not all videos are available in all formats.
+Specify the video format (quality) in which to download the video. 
+WebM (480p: 43 - 720p: 45) - H264 (480p: 18 - 720p: 22 - 1080p: 37) - 
+H263 400x240: 5 - FLV-H264 (640x360: 34 - 854x480: 35) - 3GP: 17
+Note that not all videos are available in all formats.
 .IP \-b, \-\-best\-quality 4
 .IX Item -b, --best-quality
 This option is deprecated, does nothing currently, and is expected to be


Bug#605311:

2010-11-30 Thread Nicola Ferralis
Obviously, once support for vimeo will be added, the manpage can be revised
to specify youtube codes vs Vimeo's.

Nicola

2010/11/30 Nicola Ferralis feran...@gmail.com

 Hi Rogerio,

 Your suggestion makes a lot of sense. Please find a new patch for the
 manfile. The explanation of the codes is taken from Wikipedia:

 http://en.wikipedia.org/wiki/YouTube#Quality_and_codecs

 Regards,
 Nicola

 2010/11/30 Rogério Brito rbr...@ime.usp.br

 Hi, Nicola.

 On Nov 30 2010, Nicola Ferralis wrote:
  Description: Add explanation in help menu about movie format code
  Author: Nicola Ferralis feran...@hotmail.com
  Debian-bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=605311

 (...)

  - action='store', dest='format',
 metavar='FORMAT', help='video format code')
  + action='store', dest='format',
 metavar='FORMAT', help='video format code: WebM (480p: 43 - 720p: 45) -
 Mobile 360p: 18 - H264 (720p: 22 - 1080p: 37)')

 I am not willing to apply a patch to the script itself, but I will
 *gladly*
 accept patches to the manpage, with more detailed descriptions of the
 meaning of what the video formats may mean.

 There are some reasons for that:

 * The source code is more volatile than the documentation.

 * The meaning of the video formats vary from site to site.

  For instance, I usually grab videos from video.google.com and the
 meaning
  of the format there is not the same as for youtube. I am also
 implementing
  upstream the ability to grab videos from vimeo.com and it seems that,
 there,
  we only have SD and HD videos.

 * The manpage can hold a detailed description of the details above, while
  having them in the source code is not the right place.

 So, if you send me a patch to the manpage, I am willing to upload a new
 revision of the package.


 Regards,

 --
 Rogério Brito : rbr...@{ime.usp.br,gmail.com} : GPG key 4096R/BCFC
 http://rb.doesntexist.org : Packages for LaTeX : algorithms.berlios.de
 DebianQA: http://qa.debian.org/developer.php?login=rbrito%40ime.usp.br





Bug#605311: No information in help menu for movie format code

2010-11-28 Thread Nicola Ferralis
Package: youtube-dl
Version: 2010.11.19-1
Severity: wishlist

The current help menu (--help) does not have any indication of which
format is available as a choice. This is the output:

Video Format Options:

-f FORMAT, --format=FORMAT
video format code
-m, --mobile-version
alias for -f 17
--all-formats   download all available video formats
--max-quality=FORMAT

highest quality format to download
-b, --best-quality  download the best video quality (DEPRECATED)


To specify the format, the -f flag is supposed to be used with a
number corresponding to some format (for example 43, 45, 18, 22, 37,
17).

Unfortunately, for the user, a guide to know what format corresponds
to which code is nowhere to be found.
How is the user supposed to know that code 37 corresponds to encoding
with h264 1080p?
This is a significant usability issue. One way to resolve it is to add
a short list of code-formats, for example:

WebM 480p: 43
WebM 720p: 45
Mobile 360p: 18
H264 720p: 22
h264 1080p: 37



OS: Ubuntu 10.10
kernel: 2.6.35-23-generic #40-Ubuntu SMP
Shell: /bin/sh

Versions of packages youtube-dl depends on:

ii  python  2.6.6-2ubuntu1
youtube-dl recommends no packages.

Versions of packages youtube-dl suggests:
ii  rtmpdump  2.3-2


Bug#603888:

2010-11-19 Thread Nicola Ferralis
Fixed in Ubuntu 11.04 Natty: vlc version 1.1.5-1ubuntu2.

https://launchpad.net/ubuntu/+source/vlc/1.1.5-1ubuntu2


Bug#603888:

2010-11-18 Thread Nicola Ferralis
Fix released (with the attached patch) upstream, 1.1.5 branch and 1.2 trunk.


Bug#603888: transcode from capture: Integer overflow in aspect ratio calculation (leads to deformed output stream)

2010-11-17 Thread Nicola Ferralis
Package: vlc
Version: 1.1.5-1

Using VLC 1.1.4-1 and 1.1.5-1 on Ubuntu 10.10. When I try to stream
and transcode from my webcam, the image I stream is always stretched
vertically. Note that if I select to stream without

transcoding, the image, in either case, looks normal. Please keep in
mind that this bug seems to be only reproducible with Ubuntu. In
Windows everything works as expected. I tried several webcams, with
similar results.

To reproduce:
0. Make sure you have a webcam attached.
1. Launch vlc
2. press CTRL+C for capture from the webcam using v4l2
3. press ALT+S for streaming
4. select stream to a file (but http will do also)

5. Important: make sure you select a transcoding option. Anyone is
good, other than OGG (where this bug seem not to apply).
6. Start the stream and wait a few minutes, before turning the stream OFF.

Expected: the file (or http stream) should have an image with the
correct aspect ratio.

Actual: the video is deformed (in my case vertically elongated.

The bug has been reported both upstream:
http://trac.videolan.org/vlc/ticket/4312


and in launchpad:
https://bugs.launchpad.net/ubuntu/+source/vlc/+bug/672304

I have been working with upstream to test possible causes and patches.
I prepared a working patch for vlc 1.1.5-1 (attached).

I tested successfully under Ubuntu, test versions for Natty are available here:
https://launchpad.net/~natty-bleed/+archive/ppa
https://launchpad.net/%7Enatty-bleed/+archive/ppa


 I am using Ubuntu Maverick 10.10, kernel 2.6.35 with vlc 1.1.5ubuntu1
backported to Maverick from my PPA:
 https://launchpad.net/~*maverick-bleed*/+archive/*ppa*


Bug#603888:

2010-11-17 Thread Nicola Ferralis
Sorry I forgot to attach the patch...
diff -Nru vlc-1.1.5.orig//modules/stream_out/transcode/video.c vlc-1.1.5/modules/stream_out/transcode/video.c
--- vlc-1.1.5.orig//modules/stream_out/transcode/video.c	2010-07-24 06:17:44.0 -0700
+++ vlc-1.1.5/modules/stream_out/transcode/video.c	2010-11-17 14:25:10.115084004 -0800
@@ -435,6 +435,11 @@
 if( id-p_encoder-fmt_out.video.i_sar_num = 0 ||
 id-p_encoder-fmt_out.video.i_sar_den = 0 )
 {
+	vlc_ureduce( id-p_decoder-fmt_out.video.i_sar_num, 
+ 	id-p_decoder-fmt_out.video.i_sar_den, 
+ 	id-p_decoder-fmt_out.video.i_sar_num, 
+ 	id-p_decoder-fmt_out.video.i_sar_den, 
+ 	0 ); 
 id-p_encoder-fmt_out.video.i_sar_num = id-p_decoder-fmt_out.video.i_sar_num * i_src_width / i_dst_width;
 id-p_encoder-fmt_out.video.i_sar_den = id-p_decoder-fmt_out.video.i_sar_den * i_src_height / i_dst_height;
 }


Bug#599791:

2010-10-31 Thread Nicola Ferralis
This bug is only present and reproducible when Metacity is the default
windows manager. The bug cannot be reproduced when Compiz is used instead.
For more, see upstream bug report.

http://plasma-gate.weizmann.ac.il/Grace/phpbb/viewtopic.php?f=1t=2017


Bug#601829: Nothing is shown when data is created/edited through external text editor.

2010-10-30 Thread Nicola Ferralis
Package: grace
Version: 5.1.22-8build1

When data is created/edited through external text editor, nothing is
shown in xmgrace, although a temporary file is created in the home
folder. Previously (see bug #582154), the gnome preferred terminal was
selected as the editor for grace. While this is still true, no data
appear to be shown.

To test:

1. Open grace.
2. Create a new set of data with the text editor.
3. Close the editor.

Expected: the data should be displayed in xmgrace

Actual: no data is shown and a temporary file (with the data) is saved
in the home folder.


I am using Ubuntu Maverick, kernel 2.6.35


Bug#599791:

2010-10-30 Thread Nicola Ferralis
Grace does not get stuck in an infinite loop. What happens is that a window
in the background asking for the permission to overwrite comes up, waiting
for an answer. Now, since the request panel doesn't show up in front of the
device panel it looks like grace is stuck in the loop.

To try, repeat all your steps. In the last one, when grace appears to be
stuck, move the device panel on a side. A dialog panel with the confirmation
request is there waiting for an answer. Either answer will unstuck the
loop.

I am not closing this bug, as the dialog panel should come up on top of the
other panels, not at the bottom (the title/description of the bug should be
changed however).


Bug#589965: New Patches

2010-07-23 Thread Nicola Ferralis
 of the peak #3);
+	sprintf(buf, Click on the approximate position of the maximum of the peak #3.\n);
+	stufftext(buf);
+	break;
 }
 
 action_flag = act;
diff -Nru grace-5.1.22.orig/src/events.h grace-5.1.22/src/events.h
--- grace-5.1.22.orig/src/events.h	2004-07-03 13:47:45.0 -0700
+++ grace-5.1.22/src/events.h	2010-07-23 11:13:10.915309285 -0700
@@ -81,7 +81,13 @@
 ZOOMY_1ST,
 ZOOMY_2ND,
 DISLINE1ST,
-DISLINE2ND
+DISLINE2ND,
+PEAK_POS,
+PEAK_POS1,
+PEAK_POS2,
+PEAK_POS1B,
+PEAK_POS2B,
+PEAK_POS3B
 } CanvasAction;
 
 /* add points at */
diff -Nru grace-5.1.22.orig/src/nonlwin.c grace-5.1.22/src/nonlwin.c
--- grace-5.1.22.orig/src/nonlwin.c	2006-05-17 13:53:13.0 -0700
+++ grace-5.1.22/src/nonlwin.c	2010-07-23 11:16:16.115308785 -0700
@@ -7,6 +7,7 @@
  * Copyright (c) 1996-2000 Grace Development Team
  * 
  * Maintained by Evgeny Stambulchik
+ * Additional non linear fitting functions by Nicola Ferralis
  * 
  * 
  *   All Rights Reserved
@@ -47,6 +48,7 @@
 #include parser.h
 #include motifinc.h
 #include protos.h
+#include events.h
 
 /* nonlprefs.load possible values */
 #define LOAD_VALUES 0
@@ -98,6 +100,34 @@
 static void nonl_wf_cb(int value, void *data);
 static void do_constr_toggle(int onoff, void *data);
 
+static void nonl_Lorentzian_cb(void *data);
+static void nonl_doubleLorentzian_cb(void *data);
+static void nonl_tripleLorentzian_cb(void *data);
+static void nonl_Gaussian_cb(void *data);
+static void nonl_doubleGaussian_cb(void *data);
+static void nonl_tripleGaussian_cb(void *data);
+static void nonl_Gaussian2_cb(void *data);
+static void nonl_PsVoight1_cb(void *data);
+static void nonl_PsVoight2_cb(void *data);
+static void nonl_DS_cb(void *data);
+static void nonl_Asym2Sig_cb(void *data);
+static void nonl_LogNormal_cb(void *data);
+static void nonl_GCAS_cb(void *data);
+static void nonl_ECS_cb(void *data);
+static void nonl_InvPoly_cb(void *data);
+static void nonl_Sine_cb(void *data);
+static void nonl_Sinesq_cb(void *data);
+static void nonl_Sinedamp_cb(void *data);
+static void nonl_ExpDec1_cb(void *data);
+static void nonl_ExpDec2_cb(void *data);
+static void nonl_ExpGrow1_cb(void *data);
+static void nonl_ExpGrow2_cb(void *data);
+static void nonl_Hyperbol_cb(void *data);
+static void nonl_Bradley_cb(void *data);
+static void nonl_Log3_cb(void *data);
+static void nonl_WeibullPD_cb(void *data);
+static void nonl_WeibullCD_cb(void *data);
+
 static void update_nonl_frame_cb(void *data);
 static void reset_nonl_frame_cb(void *data);
 
@@ -118,7 +148,7 @@
 if (nonl_frame == NULL) {
 int i;
 OptionItem np_option_items[MAXPARM + 1], option_items[5];
-Widget menubar, menupane;
+Widget menubar, menupane, submenugauss, submenulorentz, submenupeak, submenubaseline, submenuperiodic;
 Widget nonl_tab, nonl_main, nonl_advanced;
 Widget sw, title_fr, fr3, rc1, rc2, rc3, lab;
 
@@ -145,6 +175,54 @@
 CreateMenuSeparator(menupane);
 CreateMenuButton(menupane, Update, 'U', update_nonl_frame_cb, NULL);
 
+	menupane = CreateMenu(menubar, Library, 'L', FALSE);
+
+	submenugauss = CreateMenu(menupane, Gaussian Functions, 'G', FALSE);
+	CreateMenuButton(submenugauss, Single, 'g', nonl_Gaussian_cb, NULL);
+	CreateMenuButton(submenugauss, Double, 'D', nonl_doubleGaussian_cb, NULL);
+	CreateMenuButton(submenugauss, Triple, 'T', nonl_tripleGaussian_cb, NULL);
+	CreateMenuSeparator(submenugauss);
+	CreateMenuButton(submenugauss, Single (chromatography), 'c', nonl_Gaussian2_cb, NULL);
+	CreateMenuSeparator(menupane);
+
+	submenulorentz = CreateMenu(menupane, Lorentzian Functions, 'L', FALSE);
+	CreateMenuButton(submenulorentz, Single, 'S', nonl_Lorentzian_cb, NULL);
+	CreateMenuButton(submenulorentz, Double, 'D', nonl_doubleLorentzian_cb, NULL);
+	CreateMenuButton(submenulorentz, Triple, 'T', nonl_tripleLorentzian_cb, NULL);
+	CreateMenuSeparator(menupane);
+
+	submenupeak = CreateMenu(menupane, Peak Functions, 'P', FALSE);
+	CreateMenuButton(submenupeak, Pseudo Voigt 1, 'V', nonl_PsVoight1_cb, NULL);
+	CreateMenuButton(submenupeak, Pseudo Voigt 2, 'o', nonl_PsVoight2_cb, NULL);
+	CreateMenuButton(submenupeak, Doniach-Sunjic, 'D', nonl_DS_cb, NULL);
+	CreateMenuButton(submenupeak, Asymmetric Double Sigmoidal, 'S', nonl_Asym2Sig_cb, NULL);
+	CreateMenuButton(submenupeak, LogNormal, 'L', nonl_LogNormal_cb, NULL);
+	CreateMenuButton(submenupeak, Gram-Charlier A-Series, 'C', nonl_GCAS_cb, NULL);
+	CreateMenuButton(submenupeak, Edgeworth-Cramer Series, 'E', nonl_ECS_cb, NULL);
+	CreateMenuButton(submenupeak, Inverse Polynomial, 'I', nonl_InvPoly_cb, NULL);
+	CreateMenuSeparator(menupane);
+
+	submenuperiodic = CreateMenu(menupane, Periodic Peak Functions, 'e', FALSE);
+	CreateMenuButton(submenuperiodic, Sine, 'S', nonl_Sine_cb, NULL);
+	CreateMenuButton(submenuperiodic, Sine Square, 'q', nonl_Sinesq_cb, NULL);
+	CreateMenuButton(submenuperiodic, Sine Damp, 'D

Bug#589965: Patch

2010-07-22 Thread Nicola Ferralis
);
+	break;
 }
 
 action_flag = act;
diff -Nru grace-5.1.22.orig/src/events.h grace-5.1.22/src/events.h
--- grace-5.1.22.orig/src/events.h	2004-07-03 13:47:45.0 -0700
+++ grace-5.1.22/src/events.h	2010-07-22 13:54:05.278576390 -0700
@@ -81,7 +81,13 @@
 ZOOMY_1ST,
 ZOOMY_2ND,
 DISLINE1ST,
-DISLINE2ND
+DISLINE2ND,
+PEAK_POS,
+PEAK_POS1,
+PEAK_POS2,
+PEAK_POS1B,
+PEAK_POS2B,
+PEAK_POS3B
 } CanvasAction;
 
 /* add points at */
diff -Nru grace-5.1.22.orig/src/nonlwin.c grace-5.1.22/src/nonlwin.c
--- grace-5.1.22.orig/src/nonlwin.c	2006-05-17 13:53:13.0 -0700
+++ grace-5.1.22/src/nonlwin.c	2010-07-22 13:54:14.582576824 -0700
@@ -7,6 +7,7 @@
  * Copyright (c) 1996-2000 Grace Development Team
  * 
  * Maintained by Evgeny Stambulchik
+ * Additional non linear fitting functions by Nicola Ferralis
  * 
  * 
  *   All Rights Reserved
@@ -47,6 +48,7 @@
 #include parser.h
 #include motifinc.h
 #include protos.h
+#include events.h
 
 /* nonlprefs.load possible values */
 #define LOAD_VALUES 0
@@ -98,6 +100,33 @@
 static void nonl_wf_cb(int value, void *data);
 static void do_constr_toggle(int onoff, void *data);
 
+static void nonl_Lorentzian_cb(void *data);
+static void nonl_doubleLorentzian_cb(void *data);
+static void nonl_tripleLorentzian_cb(void *data);
+static void nonl_Gaussian_cb(void *data);
+static void nonl_doubleGaussian_cb(void *data);
+static void nonl_tripleGaussian_cb(void *data);
+static void nonl_Gaussian2_cb(void *data);
+static void nonl_PsVoight1_cb(void *data);
+static void nonl_PsVoight2_cb(void *data);
+static void nonl_DS_cb(void *data);
+static void nonl_Asym2Sig_cb(void *data);
+static void nonl_LogNormal_cb(void *data);
+static void nonl_GCAS_cb(void *data);
+static void nonl_ECS_cb(void *data);
+static void nonl_InvPoly_cb(void *data);
+static void nonl_Sine_cb(void *data);
+static void nonl_Sinesq_cb(void *data);
+static void nonl_Sinedamp_cb(void *data);
+static void nonl_ExpDec1_cb(void *data);
+static void nonl_ExpDec2_cb(void *data);
+static void nonl_ExpGrow1_cb(void *data);
+static void nonl_ExpGrow2_cb(void *data);
+static void nonl_Hyperbol_cb(void *data);
+static void nonl_Bradley_cb(void *data);
+static void nonl_Log3_cb(void *data);
+static void nonl_Weibull_cb(void *data);
+
 static void update_nonl_frame_cb(void *data);
 static void reset_nonl_frame_cb(void *data);
 
@@ -118,7 +147,7 @@
 if (nonl_frame == NULL) {
 int i;
 OptionItem np_option_items[MAXPARM + 1], option_items[5];
-Widget menubar, menupane;
+Widget menubar, menupane, submenugauss, submenulorentz, submenupeak, submenubaseline, submenuperiodic;
 Widget nonl_tab, nonl_main, nonl_advanced;
 Widget sw, title_fr, fr3, rc1, rc2, rc3, lab;
 
@@ -145,6 +174,53 @@
 CreateMenuSeparator(menupane);
 CreateMenuButton(menupane, Update, 'U', update_nonl_frame_cb, NULL);
 
+	menupane = CreateMenu(menubar, Library, 'L', FALSE);
+
+	submenugauss = CreateMenu(menupane, Gaussian Functions, 'G', FALSE);
+	CreateMenuButton(submenugauss, Single, 'g', nonl_Gaussian_cb, NULL);
+	CreateMenuButton(submenugauss, Double, 'D', nonl_doubleGaussian_cb, NULL);
+	CreateMenuButton(submenugauss, Triple, 'T', nonl_tripleGaussian_cb, NULL);
+	CreateMenuSeparator(submenugauss);
+	CreateMenuButton(submenugauss, Single (chromatography), 'c', nonl_Gaussian2_cb, NULL);
+	CreateMenuSeparator(menupane);
+
+	submenulorentz = CreateMenu(menupane, Lorentzian Functions, 'L', FALSE);
+	CreateMenuButton(submenulorentz, Single, 'S', nonl_Lorentzian_cb, NULL);
+	CreateMenuButton(submenulorentz, Double, 'D', nonl_doubleLorentzian_cb, NULL);
+	CreateMenuButton(submenulorentz, Triple, 'T', nonl_tripleLorentzian_cb, NULL);
+	CreateMenuSeparator(menupane);
+
+	submenupeak = CreateMenu(menupane, Peak Functions, 'P', FALSE);
+	CreateMenuButton(submenupeak, Pseudo Voigt 1, 'V', nonl_PsVoight1_cb, NULL);
+	CreateMenuButton(submenupeak, Pseudo Voigt 2, 'o', nonl_PsVoight2_cb, NULL);
+	CreateMenuButton(submenupeak, Doniach-Sunjic, 'D', nonl_DS_cb, NULL);
+	CreateMenuButton(submenupeak, Asymmetric Double Sigmoidal, 'S', nonl_Asym2Sig_cb, NULL);
+	CreateMenuButton(submenupeak, LogNormal, 'L', nonl_LogNormal_cb, NULL);
+	CreateMenuButton(submenupeak, Gram-Charlier A-Series, 'C', nonl_GCAS_cb, NULL);
+	CreateMenuButton(submenupeak, Edgeworth-Cramer Series, 'E', nonl_ECS_cb, NULL);
+	CreateMenuButton(submenupeak, Inverse Polynomial, 'I', nonl_InvPoly_cb, NULL);
+	CreateMenuSeparator(menupane);
+
+	submenuperiodic = CreateMenu(menupane, Periodic Peak Functions, 'e', FALSE);
+	CreateMenuButton(submenuperiodic, Sine, 'S', nonl_Sine_cb, NULL);
+	CreateMenuButton(submenuperiodic, Sine Square, 'q', nonl_Sinesq_cb, NULL);
+	CreateMenuButton(submenuperiodic, Sine Damp, 'D', nonl_Sinedamp_cb, NULL);
+	CreateMenuSeparator(menupane);
+
+	submenubaseline = CreateMenu(menupane, Baseline Functions, 'B', FALSE);
+	CreateMenuButton

Bug#583966:

2010-05-31 Thread Nicola Ferralis
Package: grace
Version: 5.1.22-6


in the new nonlinear fitting patch that was added in grace 5.1.22-6, a link
in the menu to the Doniach-Sunjic function was left out. Please find
attached a patch that add the proper menu entry.

I am using:

GNU/Linux 2.6.31-20-generic #58-Ubuntu SMP i686
libc6 2.10.1-0ubuntu16
diff -Nru grace-5.1.22.orig/src/nonlwin.c grace-5.1.22/src/nonlwin.c
--- grace-5.1.22.orig/src/nonlwin.c	2010-05-27 13:39:05.65584 -0700
+++ grace-5.1.22/src/nonlwin.c	2010-05-27 13:40:54.463840342 -0700
@@ -192,6 +192,7 @@
 	submenupeak = CreateMenu(menupane, Peak Functions, 'P', FALSE);
 	CreateMenuButton(submenupeak, Pseudo Voigt 1, 'V', nonl_PsVoight1_cb, NULL);
 	CreateMenuButton(submenupeak, Pseudo Voigt 2, 'o', nonl_PsVoight2_cb, NULL);
+	CreateMenuButton(submenupeak, Doniach-Sunjic, 'D', nonl_DS_cb, NULL);
 	CreateMenuButton(submenupeak, Asymmetric Double Sigmoidal, 'S', nonl_Asym2Sig_cb, NULL);
 	CreateMenuButton(submenupeak, LogNormal, 'L', nonl_LogNormal_cb, NULL);
 	CreateMenuButton(submenupeak, Gram-Charlier A-Series, 'C', nonl_GCAS_cb, NULL);


Bug#578435: Add non-linear peak fitting to xmgrace

2010-05-21 Thread Nicola Ferralis
);	
+	break;
 }
 
 action_flag = act;
diff -Nru grace-5.1.22.orig/src/events.h grace-5.1.22/src/events.h
--- grace-5.1.22.orig/src/events.h	2004-07-03 13:47:45.0 -0700
+++ grace-5.1.22/src/events.h	2010-05-12 16:30:04.876693553 -0700
@@ -81,7 +81,13 @@
 ZOOMY_1ST,
 ZOOMY_2ND,
 DISLINE1ST,
-DISLINE2ND
+DISLINE2ND,
+PEAK_POS,
+PEAK_POS1,
+PEAK_POS2,
+PEAK_POS1B,
+PEAK_POS2B,
+PEAK_POS3B
 } CanvasAction;
 
 /* add points at */
diff -Nru grace-5.1.22.orig/src/nonlwin.c grace-5.1.22/src/nonlwin.c
--- grace-5.1.22.orig/src/nonlwin.c	2006-05-17 13:53:13.0 -0700
+++ grace-5.1.22/src/nonlwin.c	2010-05-12 16:30:04.880693363 -0700
@@ -7,6 +7,7 @@
  * Copyright (c) 1996-2000 Grace Development Team
  * 
  * Maintained by Evgeny Stambulchik
+ * Additional non linear fitting functions by Nicola Ferralis
  * 
  * 
  *   All Rights Reserved
@@ -47,6 +48,7 @@
 #include parser.h
 #include motifinc.h
 #include protos.h
+#include events.h
 
 /* nonlprefs.load possible values */
 #define LOAD_VALUES 0
@@ -98,6 +100,31 @@
 static void nonl_wf_cb(int value, void *data);
 static void do_constr_toggle(int onoff, void *data);
 
+static void nonl_Lorentzian_cb(void *data);
+static void nonl_doubleLorentzian_cb(void *data);
+static void nonl_tripleLorentzian_cb(void *data);
+static void nonl_Gaussian_cb(void *data);
+static void nonl_doubleGaussian_cb(void *data);
+static void nonl_tripleGaussian_cb(void *data);
+static void nonl_Gaussian2_cb(void *data);
+static void nonl_PsVoight1_cb(void *data);
+static void nonl_PsVoight2_cb(void *data);
+static void nonl_Asym2Sig_cb(void *data);
+static void nonl_LogNormal_cb(void *data);
+static void nonl_GCAS_cb(void *data);
+static void nonl_ECS_cb(void *data);
+static void nonl_InvPoly_cb(void *data);
+static void nonl_Sine_cb(void *data);
+static void nonl_Sinesq_cb(void *data);
+static void nonl_Sinedamp_cb(void *data);
+static void nonl_ExpDec1_cb(void *data);
+static void nonl_ExpDec2_cb(void *data);
+static void nonl_ExpGrow1_cb(void *data);
+static void nonl_ExpGrow2_cb(void *data);
+static void nonl_Hyperbol_cb(void *data);
+static void nonl_Bradley_cb(void *data);
+static void nonl_Log3_cb(void *data);
+
 static void update_nonl_frame_cb(void *data);
 static void reset_nonl_frame_cb(void *data);
 
@@ -118,7 +145,7 @@
 if (nonl_frame == NULL) {
 int i;
 OptionItem np_option_items[MAXPARM + 1], option_items[5];
-Widget menubar, menupane;
+Widget menubar, menupane, submenugauss, submenulorentz, submenupeak, submenubaseline, submenuperiodic;
 Widget nonl_tab, nonl_main, nonl_advanced;
 Widget sw, title_fr, fr3, rc1, rc2, rc3, lab;
 
@@ -145,6 +172,50 @@
 CreateMenuSeparator(menupane);
 CreateMenuButton(menupane, Update, 'U', update_nonl_frame_cb, NULL);
 
+	menupane = CreateMenu(menubar, Library, 'L', FALSE);
+
+	submenugauss = CreateMenu(menupane, Gaussian Functions, 'G', FALSE);
+	CreateMenuButton(submenugauss, Single, 's', nonl_Gaussian_cb, NULL);
+	CreateMenuButton(submenugauss, Double, 'D', nonl_doubleGaussian_cb, NULL);
+	CreateMenuButton(submenugauss, Triple, 'T', nonl_tripleGaussian_cb, NULL);
+	CreateMenuSeparator(submenugauss);
+	CreateMenuButton(submenugauss, Single (chromatography), 'c', nonl_Gaussian2_cb, NULL);
+	CreateMenuSeparator(menupane);
+
+	submenulorentz = CreateMenu(menupane, Lorentzian Functions, 'L', FALSE);
+	CreateMenuButton(submenulorentz, Single, 'S', nonl_Lorentzian_cb, NULL);
+	CreateMenuButton(submenulorentz, Double, 'D', nonl_doubleLorentzian_cb, NULL);
+	CreateMenuButton(submenulorentz, Triple, 'T', nonl_tripleLorentzian_cb, NULL);
+	CreateMenuSeparator(menupane);
+	
+	submenupeak = CreateMenu(menupane, Peak Functions, 'P', FALSE);
+	CreateMenuButton(submenupeak, Pseudo Voigt 1, 'V', nonl_PsVoight1_cb, NULL);
+	CreateMenuButton(submenupeak, Pseudo Voigt 2, 'V', nonl_PsVoight2_cb, NULL);
+	CreateMenuButton(submenupeak, Asymmetric Double Sigmoidal, 'S', nonl_Asym2Sig_cb, NULL);
+	CreateMenuButton(submenupeak, LogNormal, 'L', nonl_LogNormal_cb, NULL);
+	CreateMenuButton(submenupeak, Gram-Charlier A-Series, 'C', nonl_GCAS_cb, NULL);
+	CreateMenuButton(submenupeak, Edgeworth-Cramer Series, 'E', nonl_ECS_cb, NULL);
+	CreateMenuButton(submenupeak, Inverse Polynomial, 'I', nonl_InvPoly_cb, NULL);
+	CreateMenuSeparator(menupane);
+
+	submenuperiodic = CreateMenu(menupane, Periodic Peak Functions, 'p', FALSE);
+	CreateMenuButton(submenuperiodic, Sine, 'S', nonl_Sine_cb, NULL);
+	CreateMenuButton(submenuperiodic, Sine Square, 'q', nonl_Sinesq_cb, NULL);
+	CreateMenuButton(submenuperiodic, Sine Damp, 'D', nonl_Sinedamp_cb, NULL);
+	CreateMenuSeparator(menupane);
+
+	submenubaseline = CreateMenu(menupane, Baseline Functions, 'B', FALSE);
+	CreateMenuButton(submenubaseline, Exponential Decay 1, 'D', nonl_ExpDec1_cb, NULL);
+	CreateMenuButton(submenubaseline, Exponential Decay 2, 'e', nonl_ExpDec2_cb, NULL

Bug#578435: Add non-linear peak fitting to xmgrace

2010-05-21 Thread Nicola Ferralis

It seems the patch you are pushing is based on a very old one (actually the 
second iteration I made a while back). It would be better to include the one 
recent one (nonlinear_extended.diff) which include several enhancements...

Thanks.
--Nicola

 




 Date: Fri, 21 May 2010 14:23:16 -0700
 From: nbr...@ofb.net
 To: feran...@hotmail.com; 578...@bugs.debian.org
 Subject: Re: Bug#578435: Add non-linear peak fitting to xmgrace
 
 I've cleaned up the patch slightly - whitespace, one spelling error, and fixed
 some keyboard shortcuts that weren't working properly.  It's working nicely,
 I'll get an upload taken care of soon.
 
 
 - Nicholas
 
  
_
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1

Bug#582154: Create New from text editor does not work when xmgrace is launched from the GNOME menu

2010-05-18 Thread Nicola Ferralis

Package: grace
Version: 5.1.22-5

In xmgrace a new dataset can be created from en external text editor. To 
do so, the text editor is accessed through Edit-In Text Editor, or 
Create New-in text editor. Two different behaviors are observed though, 
depending if xmgrace is launched through the GNOME menu or from the 
terminal.


Xmgrace launched from the terminal: the text editor (nano) opens 
correctly in the terminal.


Xmgrace opened from the GNOME menu: the text editor does not open, 
although it is expected to.


The bug has been reported upstream, but qualified as a distro specific 
misconfiguration.


http://plasma-gate.weizmann.ac.il/Grace/phpbb/viewtopic.php?t=1962

But present in grace-5.1.22-5, tested on lucid. A similar bug report was 
filed for Ubuntu:


https://bugs.launchpad.net/ubuntu/+source/grace/+bug/582399

The problem is in the fact that when the text-editor is launched within 
grace, the command:


sensible-editor

is issued. If grace itself was launched through the terminal, nano opens 
fine. However, when grace was opened through the GNOME menu, nothing 
happens. So the problem is related to the fact that nano can only be 
launched from the terminal. When launched as a regular, non-terminal 
application a new terminal should open with nano running in it, which 
does not happen.


I attach two patches, with two different workarounds:

1. text_editor_gnome.diff: I modified the gnome launcher (grace.desktop) 
to launch xmgrace as an application in the terminal (rather than a 
regular application). This allows nano to run.


2. text_editor.diff: I revert the debian configuration to the upstream 
default. Basically I removed the line:


--with-editor=sensible-editor \

from debian/rules. In this case, the editor (vim) opens with no 
problems, and regardless on how grace was launched. I personally like #2 
better...



I am using kernel 2.6.32-22-generic and libc6 2.11.1-0ubuntu7
diff -Nru grace-5.1.22.orig/debian/grace.desktop grace-5.1.22/debian/grace.desktop
--- grace-5.1.22.orig/debian/grace.desktop	2010-05-18 11:28:45.646892000 -0700
+++ grace-5.1.22/debian/grace.desktop	2010-05-18 11:29:23.354892205 -0700
@@ -12,6 +12,6 @@
 Categories=Education;Math;Science;Motif;
 MimeType=application/x-grace
 
-Terminal=false
+Terminal=true
 NoDisplay=false
 StartupNotify=false
diff -Nru grace-5.1.22.orig/debian/rules grace-5.1.22/debian/rules
--- grace-5.1.22.orig/debian/rules	2010-05-18 11:24:22.526892000 -0700
+++ grace-5.1.22/debian/rules	2010-05-18 11:25:09.150882910 -0700
@@ -14,7 +14,6 @@
 endif
 
 DEB_CONFIGURE_EXTRA_FLAGS := --enable-grace-home=/usr/share/grace \
-	--with-editor=sensible-editor \
 	--with-helpviewer=sensible-browser %s \
 	--with-f77=gfortran \
 	--disable-pdfdrv


Bug#582154: Create New from text editor does not work when xmgrace is launched from the GNOME menu

2010-05-18 Thread Nicola Ferralis
Yes, it makes perfect sense. Attached new patch (tested new behavior and 
proven to work as expected).
diff -Nru grace-5.1.22.orig/debian/rules grace-5.1.22/debian/rules
--- grace-5.1.22.orig/debian/rules	2010-05-18 12:36:58.590882000 -0700
+++ grace-5.1.22/debian/rules	2010-05-18 12:37:57.842882564 -0700
@@ -14,7 +14,7 @@
 endif
 
 DEB_CONFIGURE_EXTRA_FLAGS := --enable-grace-home=/usr/share/grace \
-	--with-editor=sensible-editor \
+	--with-editor=x-terminal-emulator -e sensible-editor \
 	--with-helpviewer=sensible-browser %s \
 	--with-f77=gfortran \
 	--disable-pdfdrv


Bug#578435: new patch available

2010-05-10 Thread Nicola Ferralis
)
+{
+WPoint wp;
+view2world(vp.x, vp.y, wp.x, wp.y);
+return (wp);
+}
 
 void symplus(VPoint vp, double s)
 {
diff -Nru grace-5.1.22.orig/src/draw.h grace-5.1.22/src/draw.h
--- grace-5.1.22.orig/src/draw.h	2004-07-03 13:47:45.0 -0700
+++ grace-5.1.22/src/draw.h	2010-05-10 13:47:31.109006652 -0700
@@ -236,6 +236,7 @@
 double xy_xconv(double wx);
 double xy_yconv(double wy);
 VPoint Wpoint2Vpoint(WPoint wp);
+WPoint Vpoint2Wpoint(VPoint vp);
 int world2view(double x, double y, double *xv, double *yv);
 void view2world(double xv, double yv, double *xw, double *yw);
 
diff -Nru grace-5.1.22.orig/src/events.c grace-5.1.22/src/events.c
--- grace-5.1.22.orig/src/events.c	2008-04-26 12:12:11.0 -0700
+++ grace-5.1.22/src/events.c	2010-05-10 13:47:31.113005834 -0700
@@ -111,6 +111,7 @@
 int axisno;
 Datapoint dpoint;
 GLocator locator;
+static char buf[256];
 
 cg = get_cg();
 get_tracking_props(track_setno, move_dir, add_at);
@@ -487,6 +488,60 @@
 }
 select_line(anchor_x, anchor_y, x, y, 0);
 		break;
+	case PEAK_POS:		
+		anchor_point(x, y, vp);	
+		sprintf(buf, Initial peak position, intensity: %f, %f \n, Vpoint2Wpoint(vp).x, Vpoint2Wpoint(vp).y);
+		stufftext(buf);
+		nonl_parms[1].value = Vpoint2Wpoint(vp).x;
+		nonl_parms[3].value = Vpoint2Wpoint(vp).y;
+		set_actioncb(NULL);
+		update_nonl_frame();
+		break;	
+	case PEAK_POS1:		
+		anchor_point(x, y, vp);	
+		sprintf(buf, Initial position, intensity peak #1: %f, %f \n, Vpoint2Wpoint(vp).x, Vpoint2Wpoint(vp).y);
+		stufftext(buf);
+		nonl_parms[1].value = Vpoint2Wpoint(vp).x;
+		nonl_parms[3].value = Vpoint2Wpoint(vp).y;		
+		set_actioncb((void*) PEAK_POS2);
+		update_nonl_frame();
+		break;
+	case PEAK_POS2:		
+		anchor_point(x, y, vp);	
+		sprintf(buf, Initial position, intensity peak #2: %f, %f \n, Vpoint2Wpoint(vp).x, Vpoint2Wpoint(vp).y);
+		stufftext(buf);		
+		nonl_parms[4].value = Vpoint2Wpoint(vp).x;
+		nonl_parms[6].value = Vpoint2Wpoint(vp).y;		
+		set_actioncb(NULL);
+		update_nonl_frame();
+		break;
+	case PEAK_POS1B:		
+		anchor_point(x, y, vp);	
+		sprintf(buf, Initial position, intensity peak #1: %f, %f \n, Vpoint2Wpoint(vp).x, Vpoint2Wpoint(vp).y);
+		stufftext(buf);		
+		nonl_parms[1].value = Vpoint2Wpoint(vp).x;
+		nonl_parms[3].value = Vpoint2Wpoint(vp).y;		
+		set_actioncb((void*) PEAK_POS2B);
+		update_nonl_frame();
+		break;
+	case PEAK_POS2B:		
+		anchor_point(x, y, vp);	
+		sprintf(buf, Initial position, intensity peak #2: %f, %f \n, Vpoint2Wpoint(vp).x, Vpoint2Wpoint(vp).y);
+		stufftext(buf);		
+		nonl_parms[4].value = Vpoint2Wpoint(vp).x;
+		nonl_parms[6].value = Vpoint2Wpoint(vp).y;		
+		set_actioncb((void*) PEAK_POS3B);
+		update_nonl_frame();
+		break;
+	case PEAK_POS3B:		
+		anchor_point(x, y, vp);	
+		sprintf(buf, Initial position, intensity peak #3: %f, %f \n, Vpoint2Wpoint(vp).x, Vpoint2Wpoint(vp).y);
+		stufftext(buf);
+		nonl_parms[7].value = Vpoint2Wpoint(vp).x;
+		nonl_parms[9].value = Vpoint2Wpoint(vp).y;		
+		set_actioncb(NULL);
+		update_nonl_frame();
+		break;
 default:
 break;
 }
@@ -760,6 +815,30 @@
 	set_cursor(0);
 	set_left_footer(Pick ending point);
 	break;
+case PEAK_POS:
+	set_cursor(0);		
+	set_left_footer(Click on the approximate position of the maximum of the peak);
+	break;
+case PEAK_POS1:
+	set_cursor(0);		
+	set_left_footer(Click on the approximate position of the maximum of the peak #1);
+	break;
+case PEAK_POS2:
+	set_cursor(0);		
+	set_left_footer(Click on the approximate position of the maximum of the peak #2);
+	break;
+case PEAK_POS1B:
+	set_cursor(0);		
+	set_left_footer(Click on the approximate position of the maximum of the peak #1);
+	break;
+case PEAK_POS2B:
+	set_cursor(0);		
+	set_left_footer(Click on the approximate position of the maximum of the peak #2);
+	break;
+case PEAK_POS3B:
+	set_cursor(0);		
+	set_left_footer(Click on the approximate position of the maximum of the peak #3);
+	break;
 }
 
 action_flag = act;
diff -Nru grace-5.1.22.orig/src/events.h grace-5.1.22/src/events.h
--- grace-5.1.22.orig/src/events.h	2004-07-03 13:47:45.0 -0700
+++ grace-5.1.22/src/events.h	2010-05-10 13:47:31.113005834 -0700
@@ -81,7 +81,13 @@
 ZOOMY_1ST,
 ZOOMY_2ND,
 DISLINE1ST,
-DISLINE2ND
+DISLINE2ND,
+PEAK_POS,
+PEAK_POS1,
+PEAK_POS2,
+PEAK_POS1B,
+PEAK_POS2B,
+PEAK_POS3B
 } CanvasAction;
 
 /* add points at */
diff -Nru grace-5.1.22.orig/src/nonlwin.c grace-5.1.22/src/nonlwin.c
--- grace-5.1.22.orig/src/nonlwin.c	2006-05-17 13:53:13.0 -0700
+++ grace-5.1.22/src/nonlwin.c	2010-05-10 13:48:26.806003694 -0700
@@ -7,6 +7,7 @@
  * Copyright (c) 1996-2000 Grace Development Team
  * 
  * Maintained by Evgeny Stambulchik
+ * Additional non linear fitting functions by Nicola Ferralis
  * 
  * 
  *   All Rights Reserved
@@ -47,6 +48,7 @@
 #include

Bug#578435: Add non-linear peak fitting to xmgrace

2010-04-19 Thread Nicola Ferralis
*(2*(x-A1)/A2)^2 + A5*(2*(x-A1)/A2)^4 + A6*(2*(x-A1)/A2)^6) br
+nbsp where: A0: Baseline offset; A1: Center of the peak; A2: Standard deviation;
+ A3: Peak Area; A4, A5, A6: Parameters. br
+ /P
+
+br
+PiPeriodic Peak Functions/ibr
+iSine:/i br
+nbspy=A0+A3*sin(pi*(x-A1)/A2)br
+nbspwhere: A0: Baseline offset; A1: Center; A2: Width; A3: Amplitude.br
+iSine Square: /ibr
+nbspy=A0+A3*sin(pi*(x-A1)/A2)^2br
+nbspwhere: A0: Baseline offset; A1: Center; A2: Width; A3: Amplitude.br
+iSine damp: /ibr
+nbspy=A0+A3*exp(-x/A4)*sin(pi*(x-A1)/A2)br
+nbspwhere: A0: Baseline offset; A1: Center; A2: Width; A3: Amplitude; A4: Decay time. br
+/P
+
+br
+PiBaseline Functions/ibr
+iExponential Decay 1:/ibr
+nbsp;y=A0+A3*exp(-(x-A1)/A2)br
+bExponential Decay 2:/b br
+nbsp;y=A0+A3*exp(-(x-A1)/A2)+A6*exp(-(x-A4)/A5);br
+iExponential Growth 1:/i br
+nbsp;y=A0+A3*exp((x-A1)/A2)br
+iExponential Growth 2: /ibr
+nbsp;y=A0+A3*exp(-(x-A1)/A2)+A6*exp((x-A4)/A5);br
+iHyperbolic:/ibr
+nbsp;y=A0+(A1*x)/(A2+x)br
+iBradley:/i br
+nbsp;y=A0*ln(-A1*ln(x))br
+iLogarithm 3 Parameters: /ibr
+nbsp;y=A0-A1*ln(x+A2)br
+/P
+
 H3A NAME=correlation/covariance/A Correlation/covariance  /H3
 
 PThis popup can be used to compute autocorrelation
diff -Nru grace-5.1.22.orig/src/draw.c grace-5.1.22/src/draw.c
--- grace-5.1.22.orig/src/draw.c	2005-11-19 13:53:24.0 -0800
+++ grace-5.1.22/src/draw.c	2010-03-17 11:25:06.872982387 -0700
@@ -258,6 +258,12 @@
 return (vp);
 }
 
+WPoint Vpoint2Wpoint(VPoint vp)
+{
+WPoint wp;
+view2world(vp.x, vp.y, wp.x, wp.y);
+return (wp);
+}
 
 void symplus(VPoint vp, double s)
 {
diff -Nru grace-5.1.22.orig/src/draw.h grace-5.1.22/src/draw.h
--- grace-5.1.22.orig/src/draw.h	2004-07-03 13:47:45.0 -0700
+++ grace-5.1.22/src/draw.h	2010-03-17 11:25:06.872982387 -0700
@@ -236,6 +236,7 @@
 double xy_xconv(double wx);
 double xy_yconv(double wy);
 VPoint Wpoint2Vpoint(WPoint wp);
+WPoint Vpoint2Wpoint(VPoint vp);
 int world2view(double x, double y, double *xv, double *yv);
 void view2world(double xv, double yv, double *xw, double *yw);
 
diff -Nru grace-5.1.22.orig/src/events.c grace-5.1.22/src/events.c
--- grace-5.1.22.orig/src/events.c	2008-04-26 12:12:11.0 -0700
+++ grace-5.1.22/src/events.c	2010-03-17 11:25:06.872982387 -0700
@@ -487,6 +487,13 @@
 }
 select_line(anchor_x, anchor_y, x, y, 0);
 		break;
+	case PEAK_POS:		
+		anchor_point(x, y, vp);	
+		nonl_parms[1].value = Vpoint2Wpoint(vp).x;
+		nonl_parms[3].value = Vpoint2Wpoint(vp).y;
+		set_actioncb(NULL);
+		update_nonl_frame();
+		break;
 default:
 break;
 }
@@ -760,6 +767,10 @@
 	set_cursor(0);
 	set_left_footer(Pick ending point);
 	break;
+case PEAK_POS:
+	set_cursor(0);		
+	set_left_footer(Click on the approximate position of the maximum of the peak);
+	break;
 }
 
 action_flag = act;
diff -Nru grace-5.1.22.orig/src/events.h grace-5.1.22/src/events.h
--- grace-5.1.22.orig/src/events.h	2004-07-03 13:47:45.0 -0700
+++ grace-5.1.22/src/events.h	2010-03-17 11:25:06.872982387 -0700
@@ -81,7 +81,8 @@
 ZOOMY_1ST,
 ZOOMY_2ND,
 DISLINE1ST,
-DISLINE2ND
+DISLINE2ND,
+PEAK_POS
 } CanvasAction;
 
 /* add points at */
diff -Nru grace-5.1.22.orig/src/nonlwin.c grace-5.1.22/src/nonlwin.c
--- grace-5.1.22.orig/src/nonlwin.c	2006-05-17 13:53:13.0 -0700
+++ grace-5.1.22/src/nonlwin.c	2010-03-17 11:35:39.048972353 -0700
@@ -7,6 +7,7 @@
  * Copyright (c) 1996-2000 Grace Development Team
  * 
  * Maintained by Evgeny Stambulchik
+ * Additional non linear fitting functions by Nicola Ferralis
  * 
  * 
  *   All Rights Reserved
@@ -47,6 +48,7 @@
 #include parser.h
 #include motifinc.h
 #include protos.h
+#include events.h
 
 /* nonlprefs.load possible values */
 #define LOAD_VALUES 0
@@ -98,6 +100,31 @@
 static void nonl_wf_cb(int value, void *data);
 static void do_constr_toggle(int onoff, void *data);
 
+static void nonl_Lorentzian_cb(void *data);
+static void nonl_doubleLorentzian_cb(void *data);
+static void nonl_tripleLorentzian_cb(void *data);
+static void nonl_Gaussian_cb(void *data);
+static void nonl_doubleGaussian_cb(void *data);
+static void nonl_tripleGaussian_cb(void *data);
+static void nonl_Gaussian2_cb(void *data);
+static void nonl_PsVoight1_cb(void *data);
+static void nonl_PsVoight2_cb(void *data);
+static void nonl_Asym2Sig_cb(void *data);
+static void nonl_LogNormal_cb(void *data);
+static void nonl_GCAS_cb(void *data);
+static void nonl_ECS_cb(void *data);
+static void nonl_InvPoly_cb(void *data);
+static void nonl_Sine_cb(void *data);
+static void nonl_Sinesq_cb(void *data);
+static void nonl_Sinedamp_cb(void *data);
+static void nonl_ExpDec1_cb(void *data);
+static void nonl_ExpDec2_cb(void *data);
+static void nonl_ExpGrow1_cb(void *data);
+static void nonl_ExpGrow2_cb(void *data);
+static void nonl_Hyperbol_cb(void *data);
+static void nonl_Bradley_cb(void *data