Changeset 2012

Show
Ignore:
Timestamp:
05/03/08 10:38:05 (2 weeks ago)
Author:
gary
Message:

two changes in assert case b command
now have faint keyword - will not assert intensities fainter than this limit of the normalization line

all HeI lines with +Col contribution are now asserted by default

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/source/assert_results.cpp

    r1998 r2012  
    118118 
    119119                        /* these are a pair of optional parameters */ 
    120                         Param[i] = ((double *)MALLOC(4*sizeof(double ))); 
     120                        Param[i] = ((double *)MALLOC(5*sizeof(double ))); 
    121121                } 
    122122 
     
    455455                wavelength[nAsserts] = 0.; 
    456456 
     457                /* faint option - do not test line if relative intensity is less 
     458                 * than entered value */ 
     459                if( (i=nMatch("FAINT",input.chCARDCAPS ))>0 ) 
     460                { 
     461                        Param[nAsserts][4] =  
     462                                FFmtRead(input.chCARDCAPS ,&i, INPUT_LINE_LENGTH,&lgEOL); 
     463                        if( lgEOL )  
     464                        { 
     465                                /* did not get 2 numbers */ 
     466                                fprintf(ioQQQ," The assert Case B faint option must have a number," 
     467                                        " the relative intensity of the fainest line to assert.\n"); 
     468                                cdEXIT(EXIT_FAILURE); 
     469                        } 
     470                        /* number is log if <= 0 */ 
     471                        if( Param[nAsserts][4]<=0. ) 
     472                                Param[nAsserts][4] = pow(10., Param[nAsserts][4] ); 
     473                } 
     474                else 
     475                { 
     476                        /* use default - include everything*/ 
     477                        Param[nAsserts][4] = SMALLFLOAT; 
     478                } 
     479 
    457480                /* range option - to limit check on a certain wavelength range */ 
    458                 if( nMatch("RANG",input.chCARDCAPS )
     481                if( (i=nMatch("RANG",input.chCARDCAPS ))>0
    459482                { 
    460483                        Param[nAsserts][2] =  
     
    19391962                                                /* find the predicted line intensity */ 
    19401963                                                cdLine( chAssertLineLabel[i] , wl , &CBrelint , &CBabsint ); 
     1964                                                if( CBrelint < Param[i][4]  ) 
     1965                                                        continue; 
    19411966                                                CBabsint = pow( 10., CBabsint ); 
    19421967                                                double error; 
     
    20132038                                if( !dense.lgElmtOn[ipHELIUM] ) 
    20142039                                { 
    2015                                         fprintf(ioQQQ,"DISASTER assert case B for a He is requested but He is not " 
     2040                                        fprintf(ioQQQ,"PROBLEM assert case B for a He is requested but He is not " 
    20162041                                                "included.\n"); 
    2017                                         fprintf(ioQQQ,"Do not turn off He is you want to assert its spectrum.\n"); 
     2042                                        fprintf(ioQQQ,"Do not turn off He if you want to assert its spectrum.\n"); 
    20182043                                        cdEXIT(EXIT_FAILURE); 
    20192044                                } 
     2045#                               if 0 
    20202046#                               define N_CASEB_HEI      11 
    20212047                                realnum CaseBWlHeI[N_CASEB_HEI]= 
    20222048                                { 10830.f, 3889.f, 3188.f, 5016.f, 3965.f, 7065.f, 5876.f, 4471.f, 
    20232049                                4026.f, 6678.f, 4922.f }; 
     2050#                               endif 
    20242051                                /* do He I as special case */ 
    20252052                                fprintf(ioASSERT,"                     Wl  Computed  Asserted       error\n"); 
    2026                                 for( long int ipLine=0; ipLine< N_CASEB_HEI ; ++ipLine ) 
     2053                                for( long int ipLine=0; ipLine< atmdat.nCaseBHeI ; ++ipLine ) 
    20272054                                { 
    20282055                                        /* assert the line */ 
    2029                                         realnum wl = CaseBWlHeI[ipLine]; 
     2056                                        realnum wl = atmdat.CaseBWlHeI[ipLine]; 
     2057                                        /* range option to restrict wavelength coverage */ 
     2058                                        if( wl < Param[i][2] || wl > Param[i][3] ) 
     2059                                                continue; 
    20302060                                        double relint , absint,CBrelint , CBabsint; 
    20312061                                        cdLine( chAssertLineLabel[i] , wl , &CBrelint , &CBabsint ); 
     2062                                        if( CBrelint < Param[i][4]  ) 
     2063                                                continue; 
    20322064                                        CBabsint = pow( 10., CBabsint ); 
    20332065                                        double error; 
  • trunk/source/atmdat.h

    r1940 r2012  
    205205        /** wavelengths of Hummer & Storey case B lines for H - O */ 
    206206        realnum WaveLengthCaseB[8][25][24]; 
     207 
     208        /** wavelengths for HeI case b */ 
     209        realnum *CaseBWlHeI; 
     210        /** number of HeI case b lines included */ 
     211        long int nCaseBHeI; 
    207212 
    208213        }       atmdat; 
  • trunk/source/iter_startend.cpp

    r1789 r2012  
    565565 
    566566        /* there are three types of calls to lines()  
    567          * this is first call with ipass = -1, only counted number 
    568          * of lines and malloced space.  Below is second call and will do 
    569          * one-time creation of line labels */ 
     567         * ipass = -1, first call, only count number off lines 
     568         * ipass =  0, second pass, save labels and wavelengths 
     569         * ipass =  1, integrate intensity*/ 
    570570        LineSave.ipass = -1; 
    571571        lines(); 
  • trunk/source/lines.h

    r1732 r2012  
    6666        long int nComment; 
    6767 
    68         /** variable to tell lines whether this is the first initialization 
    69          * pass or whether we are in the middle of a model 
    70          * ipass=0 on initialization call, =1 on all others */ 
     68        /** there are three types of calls to lines()  
     69         * ipass = -1, first call, only count number off lines 
     70         * ipass =  0, second pass, save labels and wavelengths 
     71         * ipass =  1, integrate intensity*/ 
    7172        long int ipass; 
    7273 
  • trunk/source/prt_lines_helium.cpp

    r1986 r2012  
    77#include "helike.h" 
    88#include "iso.h" 
     9#include "atmdat.h" 
    910#include "lines.h" 
    1011#include "lines_service.h" 
     
    6667                GetStandardHeLines(); 
    6768                lgFirstRun = false; 
     69        } 
     70 
     71        /* store labels for all case b HeI lines in case we assert case b  
     72         * ipass == -1 only counting number of lines */ 
     73        if( LineSave.ipass < 0 ) 
     74                atmdat.nCaseBHeI = 0; 
     75        else if( LineSave.ipass == 0 ) 
     76        { 
     77                /* ipass == 0 allocate space and save wavelengths */ 
     78                atmdat.CaseBWlHeI = (realnum *)MALLOC( (sizeof realnum)*atmdat.nCaseBHeI); 
     79                atmdat.nCaseBHeI = 0; 
    6880        } 
    6981 
     
    132144                                                        if( ipLo==4 ) 
    133145                                                                totBranch += iso.BranchRatio[ipISO][nelem][ipHi][3] + iso.BranchRatio[ipISO][nelem][ipHi][5]; 
     146 
     147                                                        if( LineSave.ipass < 0 ) 
     148                                                                ++atmdat.nCaseBHeI; 
     149                                                        else if( LineSave.ipass == 0 ) 
     150                                                        { 
     151                                                                /* save wavelengths */ 
     152                                                                atmdat.CaseBWlHeI[atmdat.nCaseBHeI] =  
     153                                                                        Transitions[ipHE_LIKE][nelem][ipHi][ipLo].WLAng; 
     154                                                                ++atmdat.nCaseBHeI; 
     155                                                        } 
    134156 
    135157                                                        if( ipHi==4 )