comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: How to plot the magnetic field vector along the trajectory
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: How to plot the magnetic field vector along the trajectory [message #59126] Wed, 12 March 2008 06:26 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Lasse Clausen writes:

> I found the question perfectly straight forward already from the first
> post. Maybe it's to do with the fact that I fiddle with spacecraft
> trajectories and magnetic fields every day. Or maybe I'm just in a
> better mood than David...

No question I was in a bad mood after wasting most of the
afternoon looking for vestiges of earlier IDL installations
on my computer, but it seems to me that how you go about
adding magnetic vectors depends *entirely* on how you go
about plotting the trajectory.

In the proposed solution, I see we are just throwing
out the Z component of both the trajectory and the vector
field. Certainly this is the easiest way to proceed.
I just wonder if it is accurate though. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: How to plot the magnetic field vector along the trajectory [message #59129 is a reply to message #59126] Wed, 12 March 2008 04:27 Go to previous messageGo to next message
lasse is currently offline  lasse
Messages: 48
Registered: February 2007
Member
On 12 Mar, 12:06, "dux...@gmail.com" <dux...@gmail.com> wrote:
> I cannot connect to the web site you gave me.
> Sorry for my poor English and I did not state my question clearly.
>
> http://picasaweb.google.com/duxiyu/1/photo#51768046173768035 86
> Could you browse this web page? There is a sample figure.
>
> I have the position data of the satellite and the magnetic field data
> for each position.
> For example, (posx, posy, posz) is the position of satellit and the
> magneitc field data for this position is (Bx, By, Bz).
> Firstly I plot the projection of the satellite trajectory in X-Y plane
> by using "plot, posx, posy"
> Then I want to plot the vector of magnetic field data for each point
>
> Du
>
> On Mar 12, 11:26 am, David Fanning <n...@dfanning.com> wrote:
>
>> dux...@gmail.com writes:
>>> I have the magnetic field data and spacecraft position data.
>>> I want to plot the magnetic field vector along the trajectory.
>>> I think I should first plot the spacecraft trajectory, and then plot
>>> the magnetic field vector along the trajectory.
>>> But I do not know which procedure in IDL can perform the second step.
>>> Is there anyone who can can help me?
>
>> I've been thinking lately that either we need a refresher
>> course in how to ask technical questions, or my mind is going
>> blank faster than I anticipated. Neither prospect is
>> encouraging to me.
>
>> Here is a good place to start if you need a refresher:
>
>> http://catb.org/~esr/faqs/smart-questions.html
>
>> The section on "Be Explicit About Your Question" might
>> be a good place to start, if you are short on time.
>
>> If you think my mind is going, then join the line. :-(
>
>> Cheers,
>
>> David
>
>> P.S. With respect to *this* question, I'm not sure I
>> even know which IDL procedure performs the *first* step.
>
>> --
>> David Fanning, Ph.D.
>> Fanning Software Consulting, Inc.
>> Coyote's Guide to IDL Programming:http://www.dfanning.com/
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

I found the question perfectly straight forward already from the first
post. Maybe it's to do with the fact that I fiddle with spacecraft
trajectories and magnetic fields every day. Or maybe I'm just in a
better mood than David...

Anyway, the way I would do this is:

nn = n_elements(posx)
plot, posx, posy
for i=0, nn-1L do $
plots, posx[i]+[0., Bx[i]], posy+[0., By[i]]

So essentially you draw every field vector starting at the current
point of the trajectory to the projected magnitude of the vector. You
might want to introduce some sort of scaling factor get the magnetic
field vectors nicely in the coordinate system. Also, this only works
if all 6 components have the same time stamps.

Instead of PLOTS you might want to have a look at ARROW to get nice
arrows as in your example, like so

arrow, posx[i], posy[i], posx[i]+bx[i], posy[i]+by[i]

Cheers
Lasse
Re: How to plot the magnetic field vector along the trajectory [message #59130 is a reply to message #59129] Wed, 12 March 2008 04:06 Go to previous messageGo to next message
duxiyu@gmail.com is currently offline  duxiyu@gmail.com
Messages: 88
Registered: March 2007
Member
I cannot connect to the web site you gave me.
Sorry for my poor English and I did not state my question clearly.

http://picasaweb.google.com/duxiyu/1/photo#51768046173768035 86
Could you browse this web page? There is a sample figure.

I have the position data of the satellite and the magnetic field data
for each position.
For example, (posx, posy, posz) is the position of satellit and the
magneitc field data for this position is (Bx, By, Bz).
Firstly I plot the projection of the satellite trajectory in X-Y plane
by using "plot, posx, posy"
Then I want to plot the vector of magnetic field data for each point


Du







On Mar 12, 11:26 am, David Fanning <n...@dfanning.com> wrote:
> dux...@gmail.com writes:
>> I have the magnetic field data and spacecraft position data.
>> I want to plot the magnetic field vector along the trajectory.
>> I think I should first plot the spacecraft trajectory, and then plot
>> the magnetic field vector along the trajectory.
>> But I do not know which procedure in IDL can perform the second step.
>> Is there anyone who can can help me?
>
> I've been thinking lately that either we need a refresher
> course in how to ask technical questions, or my mind is going
> blank faster than I anticipated. Neither prospect is
> encouraging to me.
>
> Here is a good place to start if you need a refresher:
>
> http://catb.org/~esr/faqs/smart-questions.html
>
> The section on "Be Explicit About Your Question" might
> be a good place to start, if you are short on time.
>
> If you think my mind is going, then join the line. :-(
>
> Cheers,
>
> David
>
> P.S. With respect to *this* question, I'm not sure I
> even know which IDL procedure performs the *first* step.
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: How to plot the magnetic field vector along the trajectory [message #59132 is a reply to message #59130] Tue, 11 March 2008 20:26 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
duxiyu@gmail.com writes:

> I have the magnetic field data and spacecraft position data.
> I want to plot the magnetic field vector along the trajectory.
> I think I should first plot the spacecraft trajectory, and then plot
> the magnetic field vector along the trajectory.
> But I do not know which procedure in IDL can perform the second step.
> Is there anyone who can can help me?

I've been thinking lately that either we need a refresher
course in how to ask technical questions, or my mind is going
blank faster than I anticipated. Neither prospect is
encouraging to me.

Here is a good place to start if you need a refresher:

http://catb.org/~esr/faqs/smart-questions.html

The section on "Be Explicit About Your Question" might
be a good place to start, if you are short on time.

If you think my mind is going, then join the line. :-(

Cheers,

David

P.S. With respect to *this* question, I'm not sure I
even know which IDL procedure performs the *first* step.

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: How to plot the magnetic field vector along the trajectory [message #59271 is a reply to message #59126] Wed, 12 March 2008 07:23 Go to previous message
lasse is currently offline  lasse
Messages: 48
Registered: February 2007
Member
On 12 Mar, 14:26, David Fanning <n...@dfanning.com> wrote:
> Lasse Clausen writes:
>> I found the question perfectly straight forward already from the first
>> post. Maybe it's to do with the fact that I fiddle with spacecraft
>> trajectories and magnetic fields every day. Or maybe I'm just in a
>> better mood than David...
>
> No question I was in a bad mood after wasting most of the
> afternoon looking for vestiges of earlier IDL installations
> on my computer, but it seems to me that how you go about
> adding magnetic vectors depends *entirely* on how you go
> about plotting the trajectory.
>
> In the proposed solution, I see we are just throwing
> out the Z component of both the trajectory and the vector
> field. Certainly this is the easiest way to proceed.
> I just wonder if it is accurate though. :-)
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

We are not throwing away anything, we are merely projecting into the
XY plane... ;-) You have to project somewhere as the computer screen
is not capable of displaying 3D - nor is paper, incidentally. And the
usual way to do this kind of thing is to provide three plots, one in
the XY plane, one in XZ and one in YZ. You then have to assemble the
3D picture in your head.

Alternatively, you can do the whole thing in "3D", using SURFACE to
establish the coordinate system and then

PLOTS, posx[i]+bx[i], posy[i]+by[i], posz[i]+bz[i], /T3D

to plot the lines.

Cheers
Lasse Clausen
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Including ASCII file in .sav ?
Next Topic: unsigned long long and min/max operator

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:57:12 PDT 2025

Total time taken to generate the page: 0.00551 seconds