function N_AXIS, Dim, Arr ;+ ; NAME: ; ROUTINE_NAME ; ; PURPOSE: ; This function returns the number of elements along dimension ; Dim of array Arr. Dimensions (axes) are numbered starting ; from 1. ; ; CATEGORY: ; Comet Nucleus Tour CRISP IR Spectrometer calibration pipeline. ; ; CALLING SEQUENCE: ; ; naxis1=n_axis(1, image) ; ; INPUTS: ; Dim: Integer number of the dimension of interest, starting at 1. ; Arr: The array to query for its size on that axis. ; ; OUTPUTS: ; This function returns the number of elements along dimension ; Dim of array Arr. ; ; EXAMPLE: ; image=indgen(100,200) ; print, n_axis(1, image) ; 100 ; ; MODIFICATION HISTORY: ; Written by: Joseph Harrington, Cornell. 2002 Jan 30 ; jh@oobleck.astro.cornell.edu ;- sz = size(arr) if dim gt sz[0] then begin nel = 1 endif else begin nel = sz[dim] endelse return, nel end