This file is indexed.

/usr/include/astrometry/tweak.h is in libastrometry-dev 0.67+dfsg-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*
# This file is part of the Astrometry.net suite.
# Licensed under a 3-clause BSD style license - see LICENSE
*/

#ifndef _TWEAK_INTERNAL_H
#define _TWEAK_INTERNAL_H

#include "astrometry/an-bool.h"
#include "astrometry/kdtree.h"
#include "astrometry/bl.h"
#include "astrometry/sip.h"
#include "astrometry/starutil.h"
#include "astrometry/starxy.h"

// These flags represent the work already done on a tweak problem
enum tweak_flags {
	TWEAK_HAS_SIP                   = 0x1,
	TWEAK_HAS_IMAGE_XY              = 0x2,
	TWEAK_HAS_IMAGE_XYZ             = 0x4,
	TWEAK_HAS_IMAGE_AD              = 0x8,
	TWEAK_HAS_REF_XY                = 0x10, 
	TWEAK_HAS_REF_XYZ               = 0x20, 
	TWEAK_HAS_REF_AD                = 0x40, 
	TWEAK_HAS_CORRESPONDENCES       = 0x100,
	TWEAK_HAS_COARSLY_SHIFTED       = 0x800,
	TWEAK_HAS_FINELY_SHIFTED        = 0x1000,
	TWEAK_HAS_REALLY_FINELY_SHIFTED = 0x2000,
	TWEAK_HAS_LINEAR_CD             = 0x4000,
};

typedef struct tweak_s {
	sip_t* sip;
    // bitfield of tweak_flags
	unsigned int state; 

	// Sources in the image
	int n;
    // pixel x,y
	double *x;
	double *y;
    // CACHED:
    // RA,Dec
	double *a;
	double *d;
    // vector on the unit sphere
	double *xyz;

	// Sources in the catalog
	int n_ref;
    // RA,Dec
	double *a_ref;
	double *d_ref;
    // unit vector on the sphere
	double *xyz_ref;
    // CACHED:
    // pixel
	double *x_ref;
	double *y_ref;

	// Correspondences
	il* image;
	il* ref;
	dl* dist2;
	dl* weight;

	// Size of Hough space for shift
	double mindx, mindy, maxdx, maxdy;

	// Size of last run shift operation
	double xs, ys;

	// Trees used for finding correspondences
	kdtree_t* kd_image;
	kdtree_t* kd_ref;

	// star jitter, in arcseconds.
	double jitter;

	// (computed from jitter); star jitter in distance-squared on the unit sphere.
	double jitterd2;

	// Weighted or unweighted fit?
    anbool weighted_fit;

	// push SIP shift term onto CRPIX, or CRVAL?
	// traditional behavior is CRPIX; ie push_crval = FALSE.
	//anbool push_crval;


} tweak_t;

tweak_t* tweak_new();
void tweak_init(tweak_t*);
void tweak_push_wcs_tan(tweak_t* t, const tan_t* wcs);
void tweak_push_ref_xyz(tweak_t* t, const double* xyz, int n);
void tweak_push_ref_ad(tweak_t* t, const double* a, const double *d, int n);
void tweak_push_ref_ad_array(tweak_t* t, const double* ad, int n);
void tweak_push_image_xy(tweak_t* t, const starxy_t* xy);
void tweak_push_correspondence_indices(tweak_t* t, il* image, il* ref, dl* distsq, dl* weight);

unsigned int tweak_advance_to(tweak_t* t, unsigned int flag);
void tweak_clear(tweak_t* t);
void tweak_dump_ascii(tweak_t* t);
void tweak_skip_shift(tweak_t* t);
char* tweak_get_state_string(const tweak_t* t);
void tweak_go_to(tweak_t* t, unsigned int flag);
void tweak_clear_correspondences(tweak_t* t);
void tweak_clear_on_sip_change(tweak_t* t);
void tweak_clear_image_ad(tweak_t* t);
void tweak_clear_ref_xy(tweak_t* t);
void tweak_clear_image_xyz(tweak_t* t);
void tweak_free(tweak_t* t);

void tweak_iterate_to_order(tweak_t* t, int maxorder, int iterations);

sip_t* tweak_just_do_it(const tan_t* wcs, const starxy_t* imagexy,
                        const double* starxyz,
                        const double* star_ra, const double* star_dec,
                        const double* star_radec,
                        int nstars, double jitter_arcsec,
                        int order, int inverse_order, int iterations,
                        anbool weighted, anbool skip_shift);


// TEST
void tchebyshev_tweak(tweak_t* t, int W, int H);

#endif