PlotScaledIntensity and NAN values

I often use NAN values in CVI plots and graphs (and in LabVIEW too) so that some portions of traces are not drawn, for example when my application hasn't been able to calculate some of the values.
I noticed that the behavior of PlotScaledIntensity is different, and NAN values are drawn with a color that is more or less the of of the center-scale.
Is this an intended behavior?
Vix
In claris non fit interpretatio
Using LV 2013 SP1 on Win 7 64bit
Using LV 8.2.1 on WinXP SP3
Using CVI 2012 SP1 on Win 7 64bit, WinXP and WinXP Embedded
Using CVI 6.0 on Win2k, WinXP and WinXP Embedded

Hi
unfortunately your suggestion is not an option:
int PlotScaledIntensity (int panelHandle, int controlID, void *zArray, size_t numberOfXPoints, size_t numberOfYPoints, int zDataType, double yGain, double yOffset, double xGain, double xOffset, ColorMapEntry colorMapArray[], int hiColor, size_t numberOfColors, int interpColors, int interpPixels);
values higher than the highest in the colorMapArray are translated into hiColor (that I can customize); but I use hiColor for other purposes
values lower than the lowest in the colorMapArray are translated into the first color in colorMapArray;
The mai question is: is this handling of NAN an intended behavior or not?
It's different from how NAN is handled in other graphs, so I think it's not an inteneded behavior, but rather a bug... but I'm not sure
Vix
In claris non fit interpretatio
Using LV 2013 SP1 on Win 7 64bit
Using LV 8.2.1 on WinXP SP3
Using CVI 2012 SP1 on Win 7 64bit, WinXP and WinXP Embedded
Using CVI 6.0 on Win2k, WinXP and WinXP Embedded

Similar Messages

  • NaN values in array

    Hello
    I had a code done by my colleague who is not working with us anymore. In an array 8 columns and programmatically generated no. of rows all values initialize as NaN values. I have never come across NaN values before.
    From research I gather it is not a number but it really isn't making much sense to me. Why the cells in array are written as NaN? What is the significance of NaN? Can I leave the cells empty and not showing NaN in it?
    Kind Regards
    Austin
    Solved!
    Go to Solution.

    Hi Austin,
    for the constant you can use the standard numeric constant (set to any floating point format) and type "NaN" into it.
    As NaN is a number you can type it into numeric inputs... (The same applies to +Inf and -Inf, they are standard numbers too!)
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Point4D.Multiply inconsistent behaviour with NaN values

    I've noticed some peculiar behaviour with System.Windows.Media.Media3D.Point4d.Mutiply when used with NaN values.
    The following assumes that I expect that 0 * NaN should result in 0. There is an argument against that logic, but that is not the point here.
    I have a 4x4 matrix defined, in the case that it is an Identity matrix and there is a NaN component in the vector, I would like to get some defined vector output where it is possible to calculate the component.
    E.g. (1,2,NaN,4) * (Identity Matrix) = (1,2,NaN,4).
    I was caught out for a while:
    By stepping through using the debugger gives the output I want (1,2,NaN,4).
    But allowing the debug code to run through uninterrupted gives the result (NaN, NaN, Nan, Nan).
    There is a slightly surprising workaround: - using Matrix.IsIdentity seems to trigger the result I want
    If I use the default Matrix constructor instead of a manually created one (normally created elsewhere in code), there is no problem.
    Can anyone explain this inconsistency?
    Simple C# console demo:
    using System;
    using System.Windows.Media.Media3D;
    namespace TestNan
    class Program
    static void Main(string[] args)
    Point4D testPoint = new Point4D(1.0, 2.0, Double.NaN, 4.0);
    Matrix3D testMatrix = new Matrix3D(1.0, 0.0, 0.0, 0.0,
    0.0, 1.0, 0.0, 0.0,
    0.0, 0.0, 1.0, 0.0,
    0.0, 0.0, 0.0, 1.0);
    var testResult1 = Point4D.Multiply(testPoint, testMatrix);
    Console.WriteLine(testResult1.ToString());// NaN,NaN,NaN,NaN
    var b = testMatrix.IsIdentity;
    var testResult2 = Point4D.Multiply(testPoint, testMatrix);
    Console.WriteLine(testResult2.ToString());// 1, 2, NaN, 4
    Console.ReadKey();

    >>Can anyone explain this inconsistency?
    The Matrix3D class has an internal boolean flag that it uses to determine if the matrix is actually an identity matrix and this flag is not set when you create a Matrix3D object using the constructor that takes the 16 double values despite the fact that
    you are actually creating an identity matrix (the flag is then eventually set when you access the IsIdentity property).
    If you use the Matrix3D.Identity static property, the flag will get set to the correct value immediately and the results will be the expected:
    static void Main(string[] args)
    Point4D testPoint = new Point4D(1.0, 2.0, Double.NaN, 4.0);
    Matrix3D testMatrix = Matrix3D.Identity;
    var testResult1 = Point4D.Multiply(testPoint, testMatrix);
    Console.WriteLine(testResult1.ToString());
    var b = testMatrix.IsIdentity;
    var testResult2 = Point4D.Multiply(testPoint, testMatrix);
    Console.WriteLine(testResult2.ToString());// 1, 2, NaN, 4
    Console.ReadKey();
    Hope that helps.
    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't post several questions in the same thread.

  • Problems with convertNumber and Double values

    I've serious troubles using convertNumber with Double data in input fields.
    While output formatting works fine, the outputted string fails to be converted back - I get conversion errors.
    So the value that is written to the input field generates a conversion error being submitted! This is not good practice!
    I've found out the following: (I use german locale, so following examples containing ',' means decimal point)
    <f:convertNumber pattern="##0.00" />generates the right output, eg. for Double(20.50) - "20,50", but this value ("20,50") will not be parsed using the above pattern! Only values with non zero last minimum fractional digit (eg "20,51", "20,59", ... ) will be parsed!
    In addition, the above pattern doesn't parse numberstrings that don't contain all significant digits.
    For example an input of "20" will not be parsed to "20.00"!
    Maybe this is not the right forum for that problem, since i think this is a general java formatting problem (?).
    But as the problem arised by using the convertNumber tag and acting like this on numeric input fields is not very comfortable, I liked to post this here. Maybe someone can give me some advice?

    I also have found this problem, except that in my experience it is the decimal part that must be non-zero, not just the last digit of the decimal part. So with a pattern of "0.00" the string "1.50" (one and a half) will be accepted whereas the string "1.00" will not.
    My guess (just a guess) is that it is related to the documented behaviour of the DecimalFormat object when it parses a number. According to the documentation:
    The most economical subclass that can represent the number given by the string is chosen. Most integer values are returned as Long objects, no matter how they are written: "17" and "17.000" both parse to Long(17). Values that cannot fit into a Long are returned as Doubles. This includes values with a fractional part, infinite values, NaN, and the value -0.0. DecimalFormat does not decide whether to return a Double or a Long based on the presence of a decimal separator in the source string. Doing so would prevent integers that overflow the mantissa of a double, such as "10,000,000,000,000,000.00", from being parsed accurately. Currently, the only classes that parse returns are Long and Double, but callers should not rely on this. Callers may use the Number methods doubleValue, longValue, etc., to obtain the type they want.
    Which means that "1.50" will be returned as a Double while "1.00" will be returned as a Long. Perhaps there is then a class-cast exception whie trying to use this value?
    If this is indeed the problem, the solution is to use the getDouble() method of the parsed Number to create the Double to be returned, but this is for the implementer to do - not the user!

  • NaN value with Sum

    Hello,i am new to bipublisher and i am trying to do a sum in my report (rtf) but i get a NaN value.
    I am pretty sure it's because i have null value in the field i am trying to sum but i don't know how to fix that.
    Here is how my rtf is made (summary) :
    For each Line
    LINE_ENT_CR
    End Each line
    Sum result
    I tried using this but for some reason now i always have a blank result <? sum( LINE_ENT_CR [ .! = '' ]) ?>
    Anyone can help me ?
    Thank you

    Simply try this: <?sum(//LINE_ENT_CR[.!=''])?>
    regards
    Jorge

  • Avoiding null and duplicate values using model clause

    Hi,
    I am trying to use model clause to get comma seperated list of data : following is the scenario:
    testuser>select * from test1;
    ID VALUE
    1 Value1
    2 Value2
    3 Value3
    4 Value4
    5 Value4
    6
    7 value5
    8
    8 rows selected.
    the query I have is:
    testuser>with src as (
    2 select distinct id,value
    3 from test1
    4 ),
    5 t as (
    6 select distinct substr(value,2) value
    7 from src
    8 model
    9 ignore nav
    10 dimension by (id)
    11 measures (cast(value as varchar2(100)) value)
    12 rules
    13 (
    14 value[any] order by id =
    15 value[cv()-1] || ',' || value[cv()]
    16 )
    17 )
    18 select max(value) oneline
    19 from t;
    ONELINE
    Value1,Value2,Value3,Value4,Value4,,value5,
    what I find is that this query has duplicate value and null (',,') coming in as data has null and duplicate value. Is there a way i can avoid the null and the duplicate values in the query output?
    thanks,
    Edited by: orausern on Feb 19, 2010 5:05 AM

    Hi,
    Try this code.
    with
    t as ( select substr(value,2)value,ind
            from test1
            model
            ignore nav
            dimension by (id)
            measures (cast(value as varchar2(100)) value, 0 ind)
            rules
            ( ind[any]=  instr(value[cv()-1],value[cv()]),
            value[any] order by id = value[cv()-1] || CASE WHEN value[cv()] IS NOT NULL
                                               and ind[cv()]=0     THEN ',' || value[cv()] END      
    select max(value) oneline
    from t;
    SQL> select * from test1;
            ID VALUE
             1 Value1
             2 Value2
             3 Value3
             4 Value4
             5 Value4
             6
             7 value5
             8
    8 ligne(s) sélectionnée(s).
    SQL> with
      2   t as ( select substr(value,2)value,ind
      3          from test1
      4          model
      5          ignore nav
      6          dimension by (id)
      7          measures (cast(value as varchar2(100)) value, 0 ind)
      8          rules
      9          ( ind[any]=  instr(value[cv()-1],value[cv()]),
    10          value[any] order by id = value[cv()-1] || CASE WHEN value[cv()] IS NOT NULL
    11                                             and ind[cv()]=0     THEN ',' || value[cv()] END 
    12          )
    13        )
    14   select max(value) oneline
    15   from t;
    ONELINE
    Value1,Value2,Value3,Value4,value5
    SQL>

  • NULL and Space value in ABAP

    Hi All,
           I like to know, is it NULL and Space value is same in ABAP, if it is not how to check null value.
    Thank you.
    Senthil

    everything is correct though some answers are not correct.
    A Database NULL value represents a field that has never been stored to database - this saving space, potentially.
    Usually all SAP tables are stored with all fields, empty fields are stored with their initial value.
    But: If a new table append is created and the newly-added fields do not have the 'initial value' marked in table definition, Oracle will just set NULL values for them.
    as mentioned: There is no NULL value to be stored in an ABAP field. The IS NULL comparison is valid only for WHERE clause in SELECT statement. WHERE field = space is different from WHERE field IS NULL. That's why you should check for both specially for appended table fields.
    If a record is selected (fulfilling another WHERE condition) into an internal table or work area, NULL values are convertted to their initial values anyway.
    Hope that sheds some light on the subject!
    regards,
    Clemens

  • Opening and Closing values on two separate rows for an indvidual A/c?

    Hi / Salam To all SAP Members,
    I am creating a COGS report in which i need to show opening and closing values for a stock account in two separate rows. The tool i am using is report painter.
    What i need to know is how can the system identify between opening and closing values for that account? Which characteristic/s do i need to include in the rows? The table i am using is FAGLFLEXT.
    Please provide help.
    Regards,
    Mohammed Ali Khan.

    Resolved Issue.

  • How to differentiate the EMPTY Records and Null Values in DSO

    Hello....how is everyone here?? Ehehehe!
    I try to load some data from the flat file which contains some EMPTY data and Null Values for the records. The data type for the InfoObjects of the fields "Quantity" is "number". The sample data from the flat file (CSV) are as below:
    Food              Quantity
    Hamburger  -       12
    Cheese        -       0
    Vegetable      -               (Empty)
    When I try to load the above sample data to the DSO, I get the results of the data as follow:
    Food              Quantity
    Hamburger     - 12.000
    Cheese           -  0.000
    Vegetable         - 0.000
    In this case, how can the user differentiate whether the records is contain empty value of null values in DSO? This is kinda of hard to differentiate the both scenarios above. Is there any way to differentiate the scenarios described here?
    Thanks alot =)

    Hi Fluffy,
    It depends on the initial values of the data type
    The inital values For quantity/Currency/ Numbers it takes spaces as 0
    for char it is SPACE
    We cannot differeniate between space and null values.
    IF you have to force this then define quantity as char and load the data. we will not have units and aggregation in this case.
    Hope this helps.
    PV

  • From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    Hi,
    Use NVL or COALESCE:
    NVL (col_a, col_b)
    Returns col_a if col_a is not NULL; otherwise, it returns col_b.
    Col_a and col_b must have similar (if not identical) datatypes; for example, if col_a is a DATE, then col_b can be another DATE or it can be a TIMESTAMP, but it can't be a VARCHAR2.
    For more about NVL and COALESCE, see the SQL Language manual: http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions119.htm#sthref1310
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • Union two tables with diffrent count of fields with null and float value

    Hello,
    i want to union two tables, first one with 3 fields and second one with 4 fields (diffrent count of fields).
    I can add null value at end of first select but it does not work with float values in second table. Value form second table is convert to integer.
    For example:
    select null v1 from sessions
    union
    select 0.05 v1 from sessions
    result is set of null and 0 value.
    As workaround i can type:
    select null+0.0 v1 from sessions
    union
    select 0.05 v1 from sessions
    or simple change select's order.
    Is any better/proper way to do this? Can I somehow set float field type in first select?
    Best regards,
    Lukasz.
    WIN XP, MAXDB 7.6.03

    Hi Lukasz,
    in a UNION statement the first statement defines the structure (number, names and types of fields) of the resultset.
    Therefore you have to define a FLOAT field in the first SELECT statement in order to avoid conversion to VARCHAR.
    Be aware that NULL and 0.0 are not the same thus NULL+0.0 does not equal NULL.
    In fact NULL cannot equal to any number or character value at all.
    BTW: you may want to use UNION ALL to avoid the search and removal of duplicates - looks like your datasets won't contain duplicates anyhow...
    Regards,
    Lars

  • Reading and Inserting Value in Long Raw

    Hi guys !!
    I have a table with 15 columns out of which RESUME column has data type long Raw. I want to copy this table to another table with selectd columns and validation. I want to check whether RESUME column is NULL. How to achieve it ?
    Similarly, using VB how to insert and retrieve values in such column ?
    thanx in advance
    Abhi

    do one thing ,
    Create a summary item for detail amount column, say m_tot_amt
    Set its fol. properties
    Calculation Mode : Summary
    Summary : Sum
    Summ.Blk : Your detail blk
    Summ. Item : Your detail amount item
    Also, Set Query all records of your detail block as Yes
    Then In PRE-INSERT/ PRE_UPDATE of detail block, write
    :COP_ORDER_HEADER.DISCOUNT_AMOUNT := nvl(:m_tot_amt,0) ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Find and replace value in Delimited String

    Hi All,
    I have a requirement, where i need to find and replace values in delimited string.
    For example, the string is "GL~1001~157747~FEB-13~CREDIT~A~N~USD~NULL~". The 4th column gives month and year. I need to replace it with previous month name. For example: "GL~1001~157747~JAN-13~CREDIT~A~N~USD~NULL~". I need to do same for last 12 months.
    I thought of first devide the values and store it in variable and then after replacing it with required value, join it back.
    I just wanted to know if there is any better way to do it?

    for example (Assumption: the abbreviated month is the first occurance of 3 consecutive alphabetic charachters)
    with testdata as (
    select 'GL~1001~157747~FEB-13~CREDIT~A~N~USD~NULL~' str from dual
    select
    str
    ,regexp_substr(str, '[[:alpha:]]{3}') part
    ,to_date('01'||regexp_substr(str, '[[:alpha:]]{3}')||'2013', 'DDMONYYYY') part_date
    ,replace (str
             ,regexp_substr(str, '[[:alpha:]]{3}')
             ,to_char(add_months(to_date('01'||regexp_substr(str, '[[:alpha:]]{3}')||'2013', 'DDMONYYYY'),-1),'MON')
    ) res
    from testdata
    STR
    PART
    PART_DATE
    RES
    GL~1001~157747~FEB-13~CREDIT~A~N~USD~NULL~
    FEB
    02/01/2013
    GL~1001~157747~JAN-13~CREDIT~A~N~USD~NULL~
    with year included
    with testdata as (
    select 'GL~1001~157747~JAN-13~CREDIT~A~N~USD~NULL~' str from dual
    select
    str
    ,regexp_substr(str, '[[:alpha:]]{3}-\d{2}') part
    ,to_date(regexp_substr(str, '[[:alpha:]]{3}-\d{2}'), 'MON-YY') part_date
    ,replace (str
             ,regexp_substr(str, '[[:alpha:]]{3}-\d{2}')
             ,to_char(add_months(to_date(regexp_substr(str, '[[:alpha:]]{3}-\d{2}'), 'MON-YY'),-1),'MON-YY')
    ) res
    from testdata
    STR
    PART
    PART_DATE
    RES
    GL~1001~157747~JAN-13~CREDIT~A~N~USD~NULL~
    JAN-13
    01/01/2013
    GL~1001~157747~DEC-12~CREDIT~A~N~USD~NULL~
    Message was edited by: chris227 year included

  • Min and MAx Value in a SELECT Statement

    Hi,
    I have a scenario where I am Selecting the values BETWEEN MIN and MAX values:
    SELECT * FROM ABC WHERE CODE BETWEEN MIN(CODE) AND MAX(CODE)
    ITS GETTING Error as:ORA-00934: group function is not allowed here
    Any help will be needful for me.

    select substr(no,1,3)||to_char(substr(no,4,1)+1) "first missing number"
    from
    with t as
    (select 'ABC1' no from dual
    union select 'ABC2' from dual
    union select 'ABC3' from dual
    union select 'ABC5' from dual
    union select 'ABC6' from dual
    union select 'ABC8' from dual
    select no, lead(no,1,0) over (order by no) next_no from t
    where substr(next_no,4,1) - substr(no,4,1) > 1
    and rownum = 1;

  • Display and return value in select list.

    hi,
    i want to display the value in select list coming from this quary .
    select student_id from class_record where class_id =:p1_class_id and SECTION =:p1_section
    minus
    select student_id from STUDENT_TYPE_DETAILS where class_id =:p1_class_id and SECTION =:p1_section;
    but i want f_name and last name with student_id .f_name and l_name store in table s_per_det.student is also in that table.
    how can i define display value and return value in this quary using 3rd table s_per_det.
    How can i do this.
    Thanks
    manoj

    Ooh, MINUS.... Can you not use a NOT EXISTS in this case, could have a big effect on the execution plan?
    Something like this perhaps?
    SELECT f_name||' '||l_name,
           stundent_id
    FROM class_record a,
         s_per_det b
    WHERE a.student_id = b.student_id
    AND   a.class_id   = :P1_CLASS_ID
    AND   a.section    = :P1_SECTION
    AND   NOT EXISTS(SELECT 'X'
                     FROM student_type_details c
                     WHERE a.student_id = c.student_id
                     AND   c.class_id = :P1_CLASS_ID
                     AND   c.section = :P1_SECTION)Cheers
    Ben
    http://www.munkyben.wordpress.com
    Don't forget to mark replies helpful or correct ;)

Maybe you are looking for

  • Odd fonts in safari

    In some web pages Safari displays an odd non-english font that looks like it could be some sort of eastern european or arabic or something. I assume there's something wrong with the fonts somewhere but I don't know why it would happen in some pages b

  • Only half the keyboard works after sleep

    I have a fall 2011 Air running Lion. It has a weird problem: sometimes (maybe 1 out of 10), after waking up from sleeping (closing the case - I haven't tried manually putting it to sleep - only the left hand portion of the keyboard works. At the logi

  • PDF's Missing!!

    Hi, I've not deleated any PDFs as I need them for university.  I had a substantial amount built up over the year but I've realised that I have only a handful on my system now.....As I said, I havent deleated anything. When I go and download a PDF tha

  • Video tutorial for Photoshop CS6 3d

    I have been fighting and struggling for at least two weeks trying to find decent video tutorials for Photoshop CS6 3d. Does no one use it? is there nothing out there. The stuff I have found is either incomplete or the sites don't work or function pro

  • Need advice on Zen to

    I just got this zen touch 20 gig. I have it up and running with no problems. I also have a Creative Nomad jukebox (blue and grey) 6 gig hard dri've. I own a legitimate copy of notmad explorer that i have been using for the jukebox. But i installed th