Particle Cross Section Regression Line

Post any praises for the work of the HYSPLIT Developers and the products they make available to the public or any helpful criticisms so that we can do a better job of providing quality products.
Post Reply
kdgeorge
Posts: 8
Joined: May 20th, 2013, 12:26 pm
Registered HYSPLIT User: Yes

Particle Cross Section Regression Line

Post by kdgeorge »

How is the location of the red regression line shown in the particle cross section plot determined?
glenn.rolph
Posts: 362
Joined: November 7th, 2012, 1:39 pm
Registered HYSPLIT User: Yes

Re: Particle Cross Section Regression Line

Post by glenn.rolph »

The computation of the regression line through the particle positions is determined using the following fortran routine....


DO N=1,NUMTIM
! time period index record
READ(32)NUMPAR,NUMPOL,IYR,IMO,IDA,IHR
CNTR=0.0
SUMX=0.0
SUMY=0.0
SUMXY=0.0
SUMX2=0.0
SUMY2=0.0

DO J=1,NUMPAR
READ(32)(MASS(I),I=1,NUMPOL)
READ(32)TLAT,TLON,ZLVL,SIGH,SIGV,SIGX
READ(32)PAGE,HDWP,PTYP,PGRD,NSORT
IF(SUM(MASS).GT.0.0)THEN
CALL CLL2XY(PARMAP,TLAT,TLON,X1,Y1)

! regression sums
CNTR=CNTR+1.0
SUMX=SUMX+X1
SUMY=SUMY+Y1
SUMXY=SUMXY+X1*Y1
SUMX2=SUMX2+X1*X1
SUMY2=SUMY2+Y1*Y1
END IF
END DO

! regression line to determine cross-section
IF(CNTR.GE.2.0)THEN
SLOPE(N)=(CNTR*SUMXY-SUMX*SUMY)/(CNTR*SUMX2-SUMX*SUMX)
YNODE(N)=SUMY/CNTR-SLOPE(N)*SUMX/CNTR
ELSE
SLOPE(N)=1.0
YNODE(N)=0.0
END IF
END DO
Post Reply

Return to “General Comments”