next up previous contents
Next: GDF_RANGE Up: GDF API and programming Previous: GDF_ALLOCATE   Contents


Subroutine GDF_COPY_HEADER copy the information from one header to another. The output header must have been initialized by a call to GILDAS_NULL before.

  subroutine gdf_copy_header(input,output, error)
    use image_def
    ! @ public
    ! Copy (a part of) the input header into the output header.
    ! Since the arguments are the full gildas type, 'output' must be
    ! inout to avoid resetting the data part of the type. This implies that
    ! the other header components must also have been set/initialized
    ! before.
    type (gildas), intent(inout), target :: input   ! Input header
    type (gildas), intent(inout), target :: output  ! Output header
    logical, intent(out) :: error
  end subroutine gdf_copy_header
end interface

The behaviour depends on the type of headers, defined as h%gil%type_gdf. If the destination header is of same type as the source header, which means the same absolute value of h%gil%type_gdf, all the relevant information is copied, including the source type, as this indicates the transposition status. If the destination header has a different type, only the common information is copied, so that the information which is only present in the destination header is preserved. This typically happens when copying an Image header to a UV header or vice-versa.

The routine may return an error. This is a change of interface compared to GILDAS V1.

Gildas manager 2014-07-01