Integrate obspy into .NET via IronPython

Hello,

Curious, has anyone tried and had success integrating obspy (and
dependencies) through .NET using IronPython?

I am also studying up on the possibilities of the C# 4.0 dynamic
keyword opening up the potential for this to be doable.

Notwithstanding feasibility. krischer commented on Github
(https://github.com/obspy/obspy/issues/815) that the matplotlib
dependency might be something to be cautious of, but I don't know
anything about this.

One school of thought is, if Matplotlib is for visualization, and we
are more concerned about the seismic, filtering, and these sorts of
"model" components, why not separate the concerns? Or at the least,
decouple view from model.

Any thoughts around this sort of thing?

Thank you.

Best regards,

Michael Powell

Hi Michael,

I remember, the idea of separation matplotlib (or maybe making it configurable) exactly for the purpose of a processing "backend" without graphics, was already discussed. Maybe it was on the devel list though. I think following this all imports of matplotlib were made "lazy", i.e. it is only imported when really needed (maybe someone of the core developers can confirm). This way just could patch obspy to **not** require matplotlib and of cause not use it.

However, I would guess the Real Big Challengeā„¢, is all the non-pure python code in ObsPy or its dependencies, and there is quite a lot of it around. To my understanding IronPython does **not** support extension other that those written for the .NET environment in C#.

Just to get you an idea of the implication. (1) Obspy has the following important dependencies which use some sort of non-pure python extensions and link against external libraries, and you will have difficulties to get ObsPy done something reasonable without:

- `scipy` implements extensions in both C and Fortran (not sure about C++) and it links against some BLAS/LAPACK and few other libraries. All this make it already a porting nightmare by itself ;-(
- `numpy` is implemented mainly in C and links against BLAS/LAPACK and other libraries as well;
- `lxml` uses a C wrapper for external libraries;

(2) Some ObsPy components themselves implements extensions in C or Fortran:
obspy.taup (Fortran)
obspy.signal
obspy.mseed
obspy.gse2
obspy.segy

You probably might not need all of these, but at least some of them should be relevant, e.g. mseed support and signal process.

If you really need this and you will need to invest quite some time into this and you probably might want to have a look at: http://www.resolversystems.com/documentation/index.php/Ironclad to start with. It does not seem to be very mature yet, but it might give you some fundamental NumPy support.

So I am not saying this would not be possible at all, however, to me it looks like a really big project.

Hope I have not discouraged anyone, to get started :wink:
~petr