function norh_p2h,index,pix,string=string ;+ ; NAME: ; NORH_P2H ; ; PURPOSE: ; convert pixel coordinate to the heliographic coordinate ; ; CALLING SEQUENCE: ; nsew=norh_p2h(index,pix) ; nsew=norh_p2h(index,pix,/string) ; ; INPUTS: ; index: NORH index ; pix: position [x,y] in pixel unit ; ; OUTPUTS: ; nsew: heliographic coordinate [ew,ns] ; ; OPTIONAL KEYWORD INPUTS: ; string: string such as 'N30E20' will be given ; ; HISTORY: ; Writtern 1998-01-03 TY ; Modified 2000-04-19 TY based on V. Grechnev's suggestion ; ;- if (n_elements(index) ne 1) then begin print,'index must be scalar' return,-1 endif szpix=size(pix) if (szpix(0) ne 1) and (szpix(0) ne 2) then begin print,'pix must be 2-element or 2xN-elements array' return,-1 endif else begin if (szpix(1) ne 2) then begin print,'pix must be 2-element or 2xN-elements array' return,-1 endif endelse sunc=norh_cen(index,rol=roll) rfactor=norh_gt_solr(index) sec_per_pix = norh_gt_pixsz(index) r_pix = rfactor*get_rb0p(index,/rad)/sec_per_pix ; radius in pixels lonlat= conv_p2h(pix,index,roll=roll,suncenter=sunc,radius=r_pix) if keyword_set(string) then begin sz = size(pix) lonlatst = make_array(/string, size=sz, val='W') lonlatst(1,*) = 'N' east = where(lonlat(0,*) lt 0, count) if (count ge 1) then lonlatst(0,east) = 'E' south = where(lonlat(1,*) lt 0, count) if (count ge 1) then lonlatst(1, south) = 'S' lonlatst(0,*)=lonlatst(0,*)+ string(abs(lonlat(0,*)), format='(i2.2)' ) lonlatst(1,*)=lonlatst(1,*)+ string(abs(lonlat(1,*)), format='(i2.2)' ) return, transpose(lonlatst(1,*)+lonlatst(0,*)) endif else return,lonlat end