#### Description:

This function writes an Object to a Channel, appending it to any previous Objects written to that Channel.

#### Synopsis

int astWrite( AstChannel ∗this, AstObject ∗object )

#### Parameters:

##### this

Pointer to the Channel.

##### object

Pointer to the Object which is to be written.

#### Applicability

##### FitsChan

If the FitsChan uses a foreign encoding (e.g. FITS-WCS) rather than the native AST encoding, then storing values in the FitsChan for keywords NAXIS1, NAXIS2, etc., before invoking astWrite can help to produce a successful write.

#### Returned Value

##### astWrite()

The number of Objects written to the Channel by this invocation of astWrite (normally, this will be one).

#### Notes:

- A value of zero will be returned if this function is invoked with the AST error status set, or if it should fail for any reason.

- Invoking this function will usually cause the sink function associated with the channel to be called in order to transfer a textual description of the supplied object to some external data store. However, the FitsChan class behaves differently. Invoking this function on a FitsChan causes new FITS header cards to be added to an internal buffer (the sink function is not invoked). This buffer is written out through the sink function only when the FitsChan is deleted.

Copyright (C) 2021 East Asian Observatory