pro convert_geo_to_apex,time,geoglat,geoglon,apexlat,apexlon,mlt ; simple routine to convert geographic locations into APEX geomagnetic ; coordinates that are used by IMAGE-FUV and Polar-UVI ; ; INPUT: time has to be given in format ; [year,DOY,hour,minute,second,millisec] ; geoglat geographic latitude, can be array ; geoglon geographic longitude, can be array ; ; OUTPUT: apexlat geomagnetic APEX latitude ; apexlon geomagnetic APEX longitude ; mlt magnetic local time ; ; CALL: ; convert_geo_to_apex,[2000,197,15,0,0],geoglat,geoglon,apexlat,apexlon,mlt ; ; hfrey, July 21, 2005 ; ; some initialization @fuv_cmnblk fuv_init bell=string(7B) ; some input check case 1 of (n_elements(time) lt 3): begin print,bell print,' ' print,'No sufficient input time specified. Returning' return endcase (n_elements(time) eq 3): begin print,bell print,' ' print,'Full Hour assumed' year=time[0] doy=time[1] hour=time[2] minute=0 second=0 millisecond=0 endcase (n_elements(time) eq 4): begin year=time[0] doy=time[1] hour=time[2] minute=time[3] second=0 millisecond=0 endcase (n_elements(time) eq 5): begin year=time[0] doy=time[1] hour=time[2] minute=time[3] second=time[4] millisecond=0 endcase (n_elements(time) eq 6): begin year=time[0] doy=time[1] hour=time[2] minute=time[3] second=time[4] millisecond=time[5] endcase (n_elements(time) gt 6): begin print,bell print,' ' print,'Do not understand time input. Too many scalars. Returning' return endcase endcase ; geographic longitude between 0 and 360 degrees geoglon=(geoglon+360.) mod 360. ; calculate magnetic coordinates geo_to_apex, geoglat, geoglon, apexlat, apexlon, apexfile ; calculate MLT ut=hour + minute/60. +second/3600. + millisecond/(3600.*1000) date=put_doy(year,doy) month=fix(strmid(date,0,2)) day=fix(strmid(date,3,2)) get_lt,ut,year,month,day,geoglat,geoglon,apexfile,glt,mlt end