Recent content by octopode

  1. O

    A Ellipse of transformation from spherical to cartesian

    So, just to make things more rigorous (I hope...), here is an updated screenshot. For the small ellipses I use dθ and dφ spanning no more than 0.02 (so, they vary between -0.01 and +0.01). That makes the circle in input space (θ, φ) that multiplies the Jacobian, and on top of that I put the...
  2. O

    A Ellipse of transformation from spherical to cartesian

    I'm using this above method. I agree. I exaggerated the radius on purpose, so we can see something. But I realize it's not very consistent with using the Jacobian method, as linearization only applies in the "vicinity" of a given point p. Yet I'm going rather far away from it. In practice...
  3. O

    A Ellipse of transformation from spherical to cartesian

    Here is a new screenshot with corrected points (calculations and codes were already using this).
  4. O

    A Ellipse of transformation from spherical to cartesian

    You are totally right for p1, it's a mistake. It should read p1 = (90, 0), p2 = (90, 60), p3 = (30, 0), which is what all my code is using. I was using "elevation" angles instead of polar angles a few days ago and it got stuck in my head. I'll update it in the first post. Regarding the...
  5. O

    A Ellipse of transformation from spherical to cartesian

    Hello Andrewkirk, Thank you for this first reply. First of all, as I described, θ is the polar angle, not elevation. So it's 90 degrees minus the "elevation". The polar angle is 0 on the Z-axis. Otherwise, we wouldn't have z = cos(θ) but z = sin(θ) and the whole formula would be different. As...
  6. O

    A Ellipse of transformation from spherical to cartesian

    Hi, I have to resample images taken from camera, whose target is a spherical object, onto a regular grid of 2 spherical coordinates: the polar and azimutal angles (θ, Φ). For best accuracy, I need to be aware of, and visualise, the "footprints" of the small angle differences onto the original...
  7. O

    Potential magnetic field lines and Stokes theorem....

    Hi, A potential magnetic field has no curl. According to the "curl theorem" or stokes theorem, a vector field with no curl does not close. Yet, Maxwell's equation tell us we shall not have magnetic monopoles, so the loops have to close... ? What am I missing to remove this apparent paradox of a...
  8. O

    Comp Sci [Fortran] making a more efficient bilinear interpolation

    i'm actually profiling the code from Matlab, the problem is it cannot profile the code within the Fortran file itself. So, all i get is the time spent to execute the whole function. I would have to use the function within a fortran exec, outside Matalb. This may not be worth it for the time...
  9. O

    Comp Sci [Fortran] making a more efficient bilinear interpolation

    Another intriguing fact is that i made another version, with more checks in the loops instead of the WHERE construct at the beginning (see below). And surprisingly, with a higher load in the DO LOOP, this version of the code is 50% faster than the one in my 1st post (30s instead of 60s) ! So...
  10. O

    Comp Sci [Fortran] making a more efficient bilinear interpolation

    15 years ?? You're making me feel like a dinosaure by using Fortran now ! :) The number of points to process is of the order of 10^5 points.
  11. O

    Comp Sci [Fortran] making a more efficient bilinear interpolation

    After unrolling, and dealing with the odd even (just an IF statement upstream from the DO loops), i did just what you suggested, and this did not affect computing time at all. Actually it took 4s longer, which is about by how much time the code varies from one run to the next. Any other idea...
  12. O

    Comp Sci [Fortran] making a more efficient bilinear interpolation

    Ok, I'm trying. In the meantime, i tried your style of DO LOOP. It would not compile with the END instead of the CONTINUE. It expects "END DO".
  13. O

    Comp Sci [Fortran] making a more efficient bilinear interpolation

    Ok, Thank you for this 1st reply. Are you suggesting to use a matrix-form of this calculation to "pack" a few points that are to be interpolated ? Or are you suggesting an explicit parallelization where each core get a set in parallel ? It's something i already do in Matlab, never tried it with...
  14. O

    Comp Sci [Fortran] making a more efficient bilinear interpolation

    Homework Statement I'm trying to write an efficient bilinear (2D)-interpolation, after reading some recipes, as a fortran-mex for Matlab that is used extensively throughout a long algorithm of solar image processing, and therefore is one of my main bottlenecks. I'm not a Fortran expert and...
Back
Top