Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
arrays in integration (qpint1d)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
lucylim  
View profile  
 More options Nov 13 2012, 1:28 pm
Newsgroups: comp.lang.idl-pvwave
From: lucylim <lucylim.ca95...@gmail.com>
Date: Tue, 13 Nov 2012 10:28:16 -0800 (PST)
Local: Tues, Nov 13 2012 1:28 pm
Subject: arrays in integration (qpint1d)

Hi all,

    I'm trying to set up an integration of spectral emission over a sphere.  The problem is that the integral has to be done over longitude and latitude "theta" and "phi", but I need a spectrum to come out as a function of wavelength, "lambda".   Wavelength is NOT a variable of integration -- rather, an array of wavelengths goes in and an array of fluxes as a function of wavelength comes out.

    Right now I have this implemented as a for loop over wavelength inside which are the two nested "qpint1d" function calls.   The first "qpint1d" function also has a for loop in it over "theta" to make the inner "qpint1d" call work with "theta" as a scalar.   It works but as you can imagine, with nested for loops this is not very efficient.

    I've tried to pass the wavelength through to the inner integral as a vector within the "private" structure so that instead of a vector over "phi", the inner function would return a matrix of "phi" vs. wavelength, thus eliminating the outermost for loop (over wavelength).   No luck, though -- I'm just getting the error message from QPINT1D_QKEVAL about how the integrand function must return a vector of values.  Is there a better way to do this?

Many thanks,
Lucy Lim
NASA/GSFC


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Craig Markwardt  
View profile  
 More options Nov 13 2012, 4:42 pm
Newsgroups: comp.lang.idl-pvwave
From: Craig Markwardt <craig.markwa...@gmail.com>
Date: Tue, 13 Nov 2012 13:42:38 -0800 (PST)
Local: Tues, Nov 13 2012 4:42 pm
Subject: Re: arrays in integration (qpint1d)

You should just come down the hall and ask :-)

The only vector input to your integrand function should be the variable of integration.  You are right the the wavelength part will need to be done as a FOR loop.  Sorry.

And yes, you will need to do an inner loop over THETA variable.  The "1D" of QPINT1D is there for a reason.  Sorry.  Since QPINT1D does a fair amount of work per call, I don't think it would be any faster to try to "vectorize" it.

Craig


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
lucylim  
View profile  
 More options Nov 14 2012, 1:06 pm
Newsgroups: comp.lang.idl-pvwave
From: lucylim <lucylim.ca95...@gmail.com>
Date: Wed, 14 Nov 2012 10:06:12 -0800 (PST)
Local: Wed, Nov 14 2012 1:06 pm
Subject: Re: arrays in integration (qpint1d)

OK -- nested FOR loops it is, then.  (Just don't tell JD.)  Thanks!   Also, it's immensely helpful to have the quadpack available in IDL, so thanks for writing that too.

- Lucy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »