FACT++  1.0
Checksum ofits::WriteFitsHeader ( )
inline

Definition at line 809 of file ofits.h.

References AddComment(), End(), ofits::Key::offset, SetBool(), SetInt(), SetStr(), Checksum::str(), and WriteHeader().

Referenced by WriteTableHeader().

810  {
811  ofits h;
812 
813  h.SetBool("SIMPLE", true, "file does conform to FITS standard");
814  h.SetInt ("BITPIX", 8, "number of bits per data pixel");
815  h.SetInt ("NAXIS", 0, "number of data axes");
816  h.SetBool("EXTEND", true, "FITS dataset may contain extensions");
817  h.SetStr ("CHECKSUM","0000000000000000", "Checksum for the whole HDU");
818  h.SetStr ("DATASUM", " 0", "Checksum for the data block");
819  h.AddComment("FITS (Flexible Image Transport System) format is defined in 'Astronomy");
820  h.AddComment("and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H");
821  h.End();
822 
823  const Checksum sum = h.WriteHeader(*this);
824 
825  h.SetStr("CHECKSUM", sum.str());
826 
827  const size_t offset = tellp();
828  h.WriteHeader(*this);
829  seekp(offset);
830 
831  return sum;
832  }
bool SetInt(const std::string &key, int64_t i, const std::string &comment="")
Definition: ofits.h:535
bool SetBool(const std::string &key, bool b, const std::string &comment="")
Definition: ofits.h:516
bool AddComment(const std::string &comment)
Definition: ofits.h:578
Definition: ofits.h:29
bool SetStr(const std::string &key, std::string s, const std::string &comment="")
Definition: ofits.h:526
std::string str(bool complm=true) const
Definition: checksum.h:148
void End()
Definition: ofits.h:588
Checksum WriteHeader(std::ostream &fout)
Definition: ofits.h:782

+ Here is the call graph for this function:

+ Here is the caller graph for this function: