C+ C NAME: C iReadUCSD C CALLING SEQUENCE: function iReadUCSD(iU,iFirst) C CALLS: C XMAP_SC_POS, SunNewcomb, ECLIPTIC_HELIOGRAPHIC, POINT_ON_LOS, ECLIPTIC_EQUATOR C INCLUDE: include 'sun.h' C EXTERNAL: external EARTH C PURPOSE: C > Structure of UCSD files: C iY integer year-1900 C IDOY integer day of year C IH,IM integer time of day C cSrce string descriptor for radio source C IQUAL integer quality indicator C VEL real IPS velocity (km/s) C DVEL real error in velocity (km/s) C VELpeak real IPS peak velocity (km/s) C DVELpeak real error in peak velocity (km/s) C SCALE real spatial scale of IPS pattern (km) C ISITE integer site parameter C ELO real Sun-Source angle (elongation; deg) C ILONG integer Carrington longitude point P (mapped to Sun) C XC real modified Carrington variable point P (x100) (mapped to Sun) C HLAT real heliographic latitude point P (deg) C ILONGe real Carrington longitude sub-Earth point C XCe real modified Carrington variable sub-Earth point (x100) C C NOTES: C ILONG = (1-(XC-int(XC)))*360.0 C XCe = XMAP_SC_POS(EARTH,nYr,Doy,nCar,JDCar) C Both appear to be true to within 2 degree in longitude, or so. C C For large elongation the point P was probably taken at a fixed distance C from the Earth. In principle, the distance can be reconstructed from C ILONG and HLAT by reversing the traceback to the solar surface. C I tried to do this for a number of elongations above 90 degrees and C found point-P distances close to 0.3 AU: C Elongation Dist (AU) Elongation Dist (AU) C 91.00000 0.3017747 115.0000 0.3055834 C 92.00000 0.3120534 116.0000 0.2949757 C 93.00000 0.3077490 117.0000 0.2932528 C 94.00000 0.3076252 121.0000 0.2888033 C 95.00000 0.2509942 122.0000 0.2779170 C 96.00000 0.2847953 123.0000 0.2820099 C 97.00000 0.2842951 124.0000 0.2752993 C 98.00000 0.2923858 125.0000 0.2946435 C 99.00000 0.3047100 126.0000 0.2908247 C 100.0000 0.2982190 127.0000 0.2950612 C 101.0000 0.2989129 128.0000 0.2925285 C 102.0000 0.3032739 129.0000 0.2909675 C 103.0000 0.2805566 130.0000 0.2826101 C 104.0000 0.2944881 131.0000 0.2786521 C 105.0000 0.2971804 132.0000 0.3057403 C 106.0000 0.2883710 133.0000 0.2940556 C 107.0000 0.3060628 134.0000 0.2966698 C 108.0000 0.2852099 135.0000 0.2718044 C 110.0000 0.2984203 136.0000 0.272730 C 111.0000 0.2984303 137.0000 0.2766779 C 112.0000 0.2980161 140.0000 0.2886397 C 113.0000 0.2884684 C 114.0000 0.2940932 C- integer iU integer iFirst double precision JDCar(nCar) character cSrce*9 double precision dLngSun double precision dLatSun double precision dDisSun save iY,iD,iH,iM,cSrce,iQUAL,VEL,DVEL,R1,R2,R3,I1, & ELO,ILON,XCobs_in,HLAT,RLONsc,XCsc_in,iRec iU = iU read (iU,'(2I4,I3,I2,A,I3,5F9.1,I2,F7.1,I4,F9.1,2F7.1,F9.1)',iostat=iReadUCSD) & iY,iD,iH,iM,cSrce,iQUAL,VEL,DVEL,R1,R2,R3,I1, & ELO,ILON,XCobs_in,HLAT,RLONsc,XCsc_in XCobs_in = XCobs_in/100.0 iRec = (1-iFirst)*iRec+1 ! iFirst=1 initializes record counter return C+ C NAME: C iProcessUCSD C PURPOSE: C Used as external function in 1st argument of ReadVIPS C CALLING SEQUENCE: entry iProcessUCSD(iR,nCar,JDCar,NCoff,XCend,Radius, & nYr,Doy,XCsc,XCobs,xLat,xVV,xGG,dRA, & rLngSun,rDisSun,rLngP,rLatP,rEloP) C INPUTS: C See documentation for href=ReadVIPS=. C OUTPUTS: C See documentation for href=ReadVIPS=. C SEE ALSO: C iReadUCSD C PROCEDURE: C Entry point in iReadUCSD C MODIFICATION HISTORY: C ???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C- if (iQUAL .lt. 21) then ! Data not good enough: reject iProcessUCSD = 0 return end if nYr = 1900+iY Doy = iD+(iH+iM/60.0)/24.0 XCsc = XMAP_SC_POS(EARTH,nYr,Doy,nCar,JDCar) ! Sub-Earth position if (XCsc .eq. BadR4()) then ! Time outside JDCar range iProcessUCSD = 0 return end if if (XCsc .gt. XCend) then ! Sub-Earth past XCend iProcessUCSD = 2 return end if iR = iRec XCobs = XCobs_in+(Radius-SUN__RAU)/VEL*SUN__SPIRAL-NCoff ! Point-P at Radius xLat = HLAT ! Heliographic lat(P) xVV = VEL ! IPS velocity (km/s) xGG = 0.0 ! No disturbance factor call SunNewcomb(0,nYr,Doy,dLngSun,dLatSun,dDisSun) rDisSun = dDisSun rLngSun = dLngSun ! Geocentric ecliptic lng(Sun) rSun = rLngSun !------- ! POINT_ON_LOS calculates the elongation based on the DP value assumed here. ! The cut-off at 0.30 appears to be the best choice and reproduces the ! elongations on the input file to within a few degrees for most sources. DP = max(0.30,cosd(ELO)) ! Geocentric distance P (at least 0.3 AU) DP = 1.0+DP*DP-2*DP*cosd(ELO) ! Cos-rule in Earth-Sun-P DP = sqrt(max(0.0,DP)) ! Distance Sun-P (AU) rLng = XCobs_in+(DP-SUN__RAU)/VEL*SUN__SPIRAL-NCoff rLng = rLng-int(rLng) ! Fractional Carrington rotation rLng = 360.0*(1.0-rLng) ! Heliographic lng(P) rLat = HLAT ! Heliographic lat(P) call ECLIPTIC_HELIOGRAPHIC(1,nYr,Doy,rLng,rLat) ! rLng = Heliocentric ecliptic lng(P) ! rLat = Heliocentric ecliptic lat(P) rLng = rLng-(180.0+rSun) ! Heliocentric ecliptic lng(P)-lng(Earth) rP = DP ! Distance Sun-P (AU) call POINT_ON_LOS(rLng,rLat,rP,rEloSun,rElo,i) rLngP = rLng ! Geocentric ecliptic lng(P)-lng(Sun) rLatP = rLat ! Geocentric ecliptic lat(P) rEloP = -i*ELO ! rEloP>0 : East of Sun ! <0 : West of Sun rLng = rSun+rLng ! Geocentric ecliptic lng(P) call ECLIPTIC_EQUATOR(0,nYr,Doy,rLng,rLat) ! rLng = RA of P rLat = dLatSun ! Geocentric ecliptic lat(Sun) call ECLIPTIC_EQUATOR(0,nYr,Doy,rSun,rLat) ! rSun = RA of Sun dRA = rLng-rSun ! RA(P)-RA(Sun) if (abs(dRA) .gt. 180.0) dRA = dRA-sign(1.0,dRA)*360.0 iProcessUCSD = 1 return end