include wave data with procedure file

I am working on a procedure file which will calculate electric field strength as it passes through a stack of various materials. To accurately determine the electric field as a function of wavelength, I wish to use the irradiance values from the AM1.5 solar spectrum. As I can not be certain that individual users will always use the same source for these values, I want to include these irradiance values with the procedure code. I can't just calculate these values at run-time as they do not follow an equation.

Is it possible to permanently store wave data as part of the procedure file? Or do I have to write a function which will fill the wave with constants?
Quote:
Is it possible to permanently store wave data as part of the procedure file? Or do I have to write a function which will fill the wave with constants?


You can create a wave in a function like this:
Function/WAVE GetMyWave()
    Make/FREE myFreeWave = {1, 2, 3}
    return myFreeWave
End

Function Test()
    Wave w = GetMyWave()
    Print w
End     // myFreeWave ceases to exist at this point


I used a free wave in this example but you could use a regular wave.

If the wave may be too big to conveniently generate in code, you can store it in an Igor binary wave file in the same folder as the procedure file. Then use the FunctionPath function to get the path to the folder containing the binary wave file and use LoadWave to load it into memory.
You might consider (also) to create your experiment as a "package" where the values are stored in the experiment. Make a folder called Packages at the root level. Then, inside this, create a folder for your "package". Put your important data wave(s) permanently inside that folder ...

root
- Packages
-- SolarCalculator
--- AMsolarspectradata


Do a search on the work "packages" in the general help search and follow the first link that says "Using a Package Data Folder".

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
hrodstein wrote:


You can create a wave in a function like this:
Function/WAVE GetMyWave()
    Make/FREE myFreeWave = {1, 2, 3}
    return myFreeWave
End

Function Test()
    Wave w = GetMyWave()
    Print w
End     // myFreeWave ceases to exist at this point




I understand that this is an option, but my wave would have over 4000 datapoints, accompanied by a corresponding x-wave, I was hoping there would be a better way.
jjweimer wrote:

Do a search on the work "packages" in the general help search and follow the first link that says "Using a Package Data Folder".


Sorry for my incompetence, but I was unable to find the above mentioned link when searching for "packages" or even searching for " package data folder". Could you please elaborate, or provide a link?
proland wrote:
I understand that this is an option, but my wave would have over 4000 datapoints, accompanied by a corresponding x-wave, I was hoping there would be a better way.


Read the rest of my answer above about FunctionPath.

proland wrote:
... I was unable to find the above mentioned link when searching for "packages" or even searching for " package data folder". Could you please elaborate, or provide a link?


Apologies ... I forgot the exact way to get this information ...

On the command line, type displayhelptopic "Using a Package Data Folder"

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville