Home Forums Trace Elements DRS Changing import files

This topic contains 5 replies, has 2 voices, and was last updated by  Dr Tephy Marillo-Sialer 18 hours, 9 minutes ago.

  • Creator
    Topic
  • #12816

    Tomas Næraa
    Participant

    Hi,

    I am using Igor Pro 7.08 and Iolite 3.65 on a Windows 10 system. I am using a Bruker Aurora Elite MS and the import file type is Varian.prn.
    To make interference corrections I would like to change the .prn files before I import them into Iolite, however this is not directly possibly. I was wondering if there is a setup one can follow to generate the Universal filetype . csv.
    Or even better, is there an easy way to generate new channels in Iolite?
    Thanks

    Best regards
    Tomas

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #12846

    Hi Tomas,

    The easiest solution in this case would be to be able to perform the corrections within iolite. This will save you lots of preprocessing time.

    The way to generate new intermediate channels in iolite would depend on the DRS you are using. If using the X_Trace_Elements_IS DRS, there’s a good example of interference correction code that you can adapt to do your corrections. To have a look at the code just open the X_Trace_Elements_IS.ipf (Windows > Procedure Windows > X_Trace_Elements_IS), then do a keyword search for Interference. You will see that there’s some portion of the script that has been commented out which is called ‘Optional Interference Correction Code’. Use that code as a template to create new channels with interference corrected data.

    Give this a go and if you have any questions reply to this post.

    Cheers,
    Tephy

    #12850

    Tomas Næraa
    Participant

    Hi Tephy,
    Thanks for the reply.
    I have changed the Script as seen below (running inside the X_Trace_Elemets_IS) however I get the following error message when running the DRS:

    ** A run-time error occurred within the Data Reduction Scheme “X_Trace_Elements_IS,” as follows:
    “a wave read” gave the error “Attempt to operate on a null (missing) wave.”

    I can se in the Data Browser that it calculates a Mo98Corr_CPS wave but the Mo98Corr_CPS_v_Ca43 wave does not hold any data; and no ppm values are calculated.

    Any idea what and/or where it goes wrong?

    Regards Tomas

    How I changed the Script:

    // //====== Optional Interference Correction Code ===========================
    // //Create a channel to hold the corrected values. NOTE: This assumes that the default intensity units are CPS
    Wave Mo98Corr_CPS=$MakeioliteWave(“CurrentDRS”,”Mo98Corr_CPS”,n=NoOfPoints)
    // //Need to declare the channel the corrected channel will be based on:
    Wave Mo98_CPS = $ioliteDFpath(“CurrentDRS”,”Mo98_CPS”)
    Wave Ru101_CPS = $ioliteDFpath(“CurrentDRS”,”Ru101_CPS”)

    Mo98Corr_CPS = Mo98_CPS – 0.1111 * Ru101_CPS //Assume that 50% of the original wave is Argide (stupidly high, but just for illustrative purposes)

    DRS_ListOfInputs+=”Mo98Corr_CPS;” //Add the name of this new output channel to the list of outputs
    // //==============================================================

    #12854

    In this case it’s more appropriate to add the ‘corrected’ channel to the list of intermediate channels (and not to the list of inputs) as shown below. I’m also adding some checks to avoid errors when the correction is not needed.

    //====== Optional Interference Correction Code ===========================
    string WaveToCorrect = “Mo98_CPS”
    string CorrIndex = “Ru101_CPS”

    if(WhichListItem(WaveToCorrect, ListOfIntermediateChannels) != -1 && WhichListItem(CorrIndex, ListOfIntermediateChannels) != -1)
    //Create a channel to hold the corrected values. NOTE: This assumes that the default intensity units are CPS
    Wave Mo98Corr_CPS=$MakeioliteWave(“CurrentDRS”,”Mo98Corr_CPS”,n=NoOfPoints)
    //Need to declare the channel the corrected channel will be based on:
    Wave Mo98_CPS = $ioliteDFpath(“CurrentDRS”,”Mo98_CPS”)
    Wave Ru101_CPS = $ioliteDFpath(“CurrentDRS”,”Ru101_CPS”)

    Mo98Corr_CPS = Mo98_CPS – 0.1111 * Ru101_CPS

    ListOfIntermediateChannels += “Mo98Corr_CPS;” //Add the name of this new output channel to the list of intermediate channels

    else

    Printf “\rIt seems that no \”%s\” or \”%s\” has been measured. No correction has been applied.\r”, WaveToCorrect, CorrIndex
    String DRSError_str
    SPrintF DRSError_str, “\rIt seems that no \”%s\” or \”%s\” has been measured. No correction has been applied.\r”, WaveToCorrect, CorrIndex
    WriteTextToPanel(“IoliteMainWindow#DRSTab_NBpanel#DRSTab_TextFeedback”, DRSError_str)
    endif
    //==============================================================

    #12855

    Tomas Næraa
    Participant

    Hi Tephy,

    Thanks for the help; however I still face some problems.

    With the coding you supplied I now get the intermediate channel “Mo98Corr_CPS” and no error messages, however this new channel is not taken into the further calculations in the Procedure. That is I get no channel with Mo98Corr_ppm_m98 or Mo98Corr_v_Ca43.

    I have tried to figure out why this is so and to me it seems that only the channels that are listed in ListOfInputChannels are processed in the concentration calculations. However if added to the ListOfInputChannels I get the error message as describe earlier.

    Do you have a way for me to get an output with ppm calculations for the corrected values.

    Thanks regards
    Tomas

    #12856

    Hi Tomas,

    Try this:

    //====== Optional Interference Correction Code ===========================
    string WaveToCorrect = “Mo98_CPS”
    string CorrIndex = “Ru101_CPS”
    
    if(WhichListItem(WaveToCorrect, ListOfIntermediateChannels) != -1 && WhichListItem(CorrIndex, ListOfIntermediateChannels) != -1)
       //Create a channel to hold the corrected values. NOTE: This assumes that the default intensity units are CPS
       Wave Mo98Corr_CPS=$MakeioliteWave(“CurrentDRS”,”Mo98Corr_CPS”,n=NoOfPoints)
       //Need to declare the channel the corrected channel will be based on:
       Wave Mo98_CPS = $ioliteDFpath(“CurrentDRS”,”Mo98_CPS”)
       Wave Ru101_CPS = $ioliteDFpath(“CurrentDRS”,”Ru101_CPS”)
    
       Mo98Corr_CPS = Mo98_CPS – 0.1111 * Ru101_CPS
    
       DRS_ListOfInputs+=”Mo98Corr;”
       ListOfIntermediateChannels += “Mo98Corr_CPS;” //Add the name of this new output channel to the list of intermediate channels
    
    else
    
       Printf “\rIt seems that no \”%s\” or \”%s\” has been measured. No correction has been applied.\r”, WaveToCorrect, CorrIndex
       String DRSError_str
       SPrintF DRSError_str, “\rIt seems that no \”%s\” or \”%s\” has been measured. No correction has been applied.\r”, WaveToCorrect, CorrIndex
       
    WriteTextToPanel(“IoliteMainWindow#DRSTab_NBpanel#DRSTab_TextFeedback”, DRSError_str)
    
    endif
    //==============================================================
Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.