<commit_before>// A simple wrapper to call wcslib from Python.
// Originally by <NAME>.
// Taken from USG SVN revision 1206.

// Compile using cmake:
//   $ cmake .
//   $ make
//   # make install
// (The naive CMakeLists.txt currently assumes Python 2.4 and that you have
// wcslib installed under /usr/local/(include|lib).

// This code implements a Python interface to the 'middle layer' of wcslib.
// That is, it does not attempt to parse FITS files itself (the 'top layer')
// and does not directly address the low-level mathematical routines.
// 
// Brief usage example:
//
// import wcslib
// wcs = wcslib.wcs()
// wcs.crval = (CRVAL1, CRVAL2) # All params from e.g. FITS header
// wcs.crpix = (CRPIX1, CRPIX2) # NB: not limited to two axes.
// wcs.cdelt = (CDELT1, CDELT2)
// wcs.crota = (CROTA1, CROTA2)
// wcs.ctype = (CTYPE1, CTYPE2) # 'RA---SIN', 'DEC--SIN' for e.g.
// wcs.cunit = (CUNIT1, CUNIT2) # 'deg', 'deg' for e.g.
// # could call wcs.wcsset() here, but it's not actually necessary
// wcs.pprint()                 # print settings
// wcs.p2s([pixel_x, pixel_y])  # pixel to spatial
// wcs.s2p([ra, dec])           # spatial to pixel

#include <vector>
#include <boost/python.hpp>
#include <boost/python/detail/api_placeholder.hpp>
#include <wcs.h>

using namespace boost::python;
using namespace std;

struct wcs
{
  wcsprm *_wcs;
  bool _init;

  wcs(int naxis = 2) {
    wcsprm *w = (wcsprm*)calloc(1, sizeof(wcsprm));
    w->flag = -1; // Only for the first wcsini
    wcsini(1, naxis, w);

    _wcs = w;
    _init = false;
  }

  ~wcs() {<commit_msg>fix order of includes so stuff compiles on osx<commit_after>// A simple wrapper to call wcslib from Python.
// Originally by <NAME>.
// Taken from USG SVN revision 1206.

// Compile using cmake:
//   $ cmake .
//   $ make
//   # make install
// (The naive CMakeLists.txt currently assumes Python 2.4 and that you have
// wcslib installed under /usr/local/(include|lib).

// This code implements a Python interface to the 'middle layer' of wcslib.
// That is, it does not attempt to parse FITS files itself (the 'top layer')
// and does not directly address the low-level mathematical routines.
// 
// Brief usage example:
//
// import wcslib
// wcs = wcslib.wcs()
// wcs.crval = (CRVAL1, CRVAL2) # All params from e.g. FITS header
// wcs.crpix = (CRPIX1, CRPIX2) # NB: not limited to two axes.
// wcs.cdelt = (CDELT1, CDELT2)
// wcs.crota = (CROTA1, CROTA2)
// wcs.ctype = (CTYPE1, CTYPE2) # 'RA---SIN', 'DEC--SIN' for e.g.
// wcs.cunit = (CUNIT1, CUNIT2) # 'deg', 'deg' for e.g.
// # could call wcs.wcsset() here, but it's not actually necessary
// wcs.pprint()                 # print settings
// wcs.p2s([pixel_x, pixel_y])  # pixel to spatial
// wcs.s2p([ra, dec])           # spatial to pixel

#include <wcs.h>
#include <boost/python/detail/api_placeholder.hpp>
#include <boost/python.hpp>
#include <vector>

using namespace boost::python;
using namespace std;

struct wcs
{
  wcsprm *_wcs;
  bool _init;

  wcs(int naxis = 2) {
    wcsprm *w = (wcsprm*)calloc(1, sizeof(wcsprm));
    w->flag = -1; // Only for the first wcsini
    wcsini(1, naxis, w);

    _wcs = w;
    _init = false;
  }

  ~wcs() {
{'fraction_non_alphanumeric': 0.14838101226029551, 'fraction_numerical': 0.015089594467148696, 'mean_word_length': 2.829121540312876, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7128992', 'n_tokens_mistral': 1235, 'n_tokens_neox': 1182, 'n_words': 376}