PRO create_pixel_coordinates_1dvec, xsize, fx, x0, hires_x, xvec, status, NO_PAR_CHECK = no_par_check
; Description: This module creates a one-dimensional coordinate vector "xvec" with "hires_x*xsize" elements,
; where the ith element has the value:
;
; xvec[i] = fx*(((i + 0.5)/hires_x) - x0)
;
; This coordinate vector corresponds to the pixel coordinates of a one-dimensional pixel vector
; of length "xsize" elements, oversampled by an integer factor "hires_x", with the origin
; shifted to the position "x0", and with an overall scale factor of "fx" applied.
; By setting "fx" to "1.0", "x0" to "0.0", and "hires_x" to "1", the simple vector of pixel
; coordinates "xvec" is obtained with "xsize" elements, where the ith element has the value:
;
; xvec[i] = i + 0.5
;
; Input Parameters:
;
; xsize - INTEGER/LONG - The length of the one-dimensional pixel vector (pix). This parameter must be
; positive.
; fx - FLOAT/DOUBLE - The x coordinate scale factor as defined above. This parameter must be non-zero.
; x0 - FLOAT/DOUBLE - The x coordinate offset (pix) as defined above.
; hires_x - INTEGER/LONG - The oversampling factor of the pixel vector. This parameter must be positive.
;
; Output Parameters:
;
; xvec - DOUBLE VECTOR - A one-dimensional coordinate vector of length "hires_x*xsize" with values as
; defined above.
; status - INTEGER - If the module successfully created the coordinate vector "xvec", then "status" is
; returned with a value of "1", otherwise it is returned with a value of "0".
;
; Keywords:
;
; If the keyword NO_PAR_CHECK is set (as "/NO_PAR_CHECK"), then the module will not perform parameter
; checking on the input parameters, reducing module overheads.
;
; N.B: In DanIDL, I adopt a pixel coordinate system such that the origin of the coordinate system is at
; the left hand side of the left hand pixel in a vector. Therefore, the centre of the left hand pixel
; in a vector has an x coordinate of 0.5 in this coordinate system. For each full pixel moved to the
; right in the vector, the x pixel coordinate increments by 1.
;
; Author: Dan Bramich (dan.bramich@hotmail.co.uk)
;
; History:
;
; 13/11/2010 - Module created (dmb).
;Set the default output parameter values
;Perform parameter checking if not instructed otherwise
;Check that "xsize" is a positive number of the correct type
;Check that "fx" is a non-zero number of the correct type
;Check that "x0" is a number of the correct type
;Check that "hires_x" is a positive number of the correct type
;Generate the coordinate vector for the one-dimensional pixel vector
;Set "status" to "1"