;------------------------------------------------------------------ ;+ ; NAME: ; CGRID2 ; PURPOSE: ; ; This program makes a coordinate grid for use with the ; output images of the CMAP program. The grid is square in ; latitude and Carrington longitude, from 45 to 90 degrees ; for the north pole, or 90 to 45 degrees for the south pole ; in y and runs from 0 to 360 degrees in Carrington longitude ; in x. ; ; The scale is 4 pixels per degree in each direction. ; ; This program is the same as cgrid, but has narrower grid lines. ; CATEGORY: ; POLAR ; CALLING SEQUENCE: ; imname = cgrid2(dir) ; INPUTS: ; dir = either 'N' or 'S'. Indicates which pole to use. ; KEYWORD PARAMETERS: ; OUTPUTS: ; imname = blank image with grid. ; The pixel coordinates are based on the lower left corner ; of the picture being 0,0. ; COMMON BLOCKS: ; NOTES: ; MODIFICATION HISTORY: ; J. Varsik, 27 Nov. 1995 --- Port from IRAF task ;- ;------------------------------------------------------------------- function cgrid2,dir,help=help ; Display IDL header if help is required. if (keyword_set(help)) then begin get_idlhdr,'cgrid2.pro' goto,finishup endif if (dir eq 'N' or dir eq 'n') then npole = 1 if (dir eq 'S' or dir eq 's') then npole = 0 if (dir ne 'n' and dir ne 'N' and dir ne 'S' and dir ne 's') then begin print,"direction must be north or south" goto,finishup endif If (npole) then print," North pole image" Else print," South pole image" grid = REPLICATE(-32767,1440,180) ; Scan image For i = 0, 1439 do begin If (i GT 0) then m2 = mod((i), 40) Else m2 = 1 ; we want a bright pixel here For j = 0, 179 do begin If (npole EQ 1) then jp = j + 180.0 Else jp = -360 + j If (j eq 0) then p2 = 1 Else p2 = mod((jp), 40) ; we want a bright pixel here If ((m2 eq 0) OR (p2 eq 0)) then grid(i,j) = 29999 Endfor Endfor return,grid finishup: return end