File: cmpack_mfind.h

package info (click to toggle)
c-munipack 2.1.39-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 55,888 kB
  • sloc: ansic: 200,762; cpp: 106,129; lex: 9,035; yacc: 4,916; sh: 4,074; fortran: 2,613; xml: 2,105; python: 1,182; makefile: 546; perl: 104
file content (215 lines) | stat: -rw-r--r-- 8,205 bytes parent folder | download | duplicates (2)
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
/**
	\file
	\brief Functions for the making mag-dev graph

	Set of functions defined in this module allows user to 
	make a mag-dev graph, that is used to find variable stars
	in a viewfield.
	
	\author David Motl <dmotl@volny.cz>
	
	\par Copying
	This program is free software; you can redistribute it and/or
	modify it under the terms of the GNU General Public License
	as published by the Free Software Foundation, version 2.
	
	$Id: cmpack_mfind.h,v 1.2 2015/07/12 08:11:55 dmotl Exp $
*/
#ifndef _CMPACK_MFIND_H_INCLUDED
#define _CMPACK_MFIND_H_INCLUDED

#include "cmpack_console.h"
#include "cmpack_table.h"
#include "cmpack_fset.h"

/********************   Private data structures   ********************************/

/**
	\brief Munifind context
	\details This private data structure holds information needed to build
	the mag-dev graph.
*/
typedef struct _CmpackMuniFind CmpackMuniFind;

/**********************   Public constants   ***********************************/

#define CMPACK_MFIND_AUTO	(-1)		/**< Automatically select comparison star */

/**
	\brief Output modifiers
*/
typedef enum _CmpackMFindFlags
{
	CMPACK_MFIND_DEFAULT	= 0		/**< Default behavior */
} CmpackMFindFlags;

/********************   Public functions   ********************************/

#ifdef __cplusplus
extern "C" {
#endif

/**
	\brief Make new Munifind context
	\details The function allocates memory with Munifind context and returns a 
	new reference to it. The reference counter is set to one. The caller is 
	responsible to call cmpack_konv_destroy() when it is no longer needed.
	\return pointer to a new reference
*/
	CMPACK_EXPORT(CmpackMuniFind*, cmpack_mfind_init, (void));

/**
	\brief Make a new reference to the Munifind context
	\details The function makes a new reference to the context and returns a 
	pointer to it. The reference counter is incremented by one. The caller 
	is responsible to call cmpack_konv_destroy() when the reference is 
	no longer needed.
	\return pointer to a new reference
*/
	CMPACK_EXPORT(CmpackMuniFind*, cmpack_mfind_reference, (CmpackMuniFind* ctx));

/**
	\brief Release a reference to the Munifind context
	\details The function releases a reference to the context. 
	The reference counter is decreased by one and when it was the 
	last reference to the context, the context is freed and all memory 
	allocated in the context is reclaimed.
*/
	CMPACK_EXPORT(void, cmpack_mfind_destroy, (CmpackMuniFind* ctx));

/**
	\brief Attach console to the context
	\details The function connects a Munifind context with
	a console context. The console is designed to print the information
	during the data processing. The functions makes its own reference
	to the console. Only one console can be attached to a single context, 
	if another console is attached to the single context, the original 
	one is released. Set console to NULL to release a reference to the 
	console that is currently attached to the context.
	\param[in] ctx			munifind context
	\param[in] con			console context
*/
	CMPACK_EXPORT(void, cmpack_mfind_set_console, (CmpackMuniFind* ctx, CmpackConsole* con));

/**
	\brief Set the aperture identifier
	\details The function sets the identifier of the aperture which
	is used to read the measurements. The default value is zero.
	\param[in] ctx			munifind context
	\param[in] aperture		aperture aperture
*/
	CMPACK_EXPORT(void, cmpack_mfind_set_aperture, (CmpackMuniFind* ctx, int aperture));

/**
	\brief Set the comparison star 
	\details The function sets the comparison star which is used to compute
	the brightness of the objects. If this parameter is set to CMPACK_MFIND_AUTO, 
	the program will choose a suitable comparison star (default). When the cmpack_mfind 
	function is finished, you can tell the used comparison star by means of the 
	cmpack_mfind_get_comparison() function. If you set this parameter to positive 
	value, it must be a valid star identifier and this star will be used as a comparison 
	star. This is equivalent to calling cmpack_mfind_clear_comparison and cmpack_mfind_add_comparison.
	\param[in] ctx			munifind context
	\param[in] star_id		comparison star identifier or CMPACK_MFIND_AUTO
*/
	CMPACK_EXPORT(void, cmpack_mfind_set_comparison, (CmpackMuniFind* ctx, int star_id));

/**
	\brief Clear selection of comparison stars
	\details The function clears the list of selected comparison stars. If no comparison
	star is selected, the program will choose a suitable comparison star (this is the 
	default behavior). 
	\param[in] ctx			munifind context
*/
	CMPACK_EXPORT(void, cmpack_mfind_clear_comparison, (CmpackMuniFind* ctx));

/**
	\brief Select an object as a comparison star
	\details The function appends an object to the list of comparison stars. See
	cmpack_mfind_set_comparison and cmpack_mfind_clear_comparison for more info.
	\param[in] ctx			munifind context
	\param[in] star_id		comparison star identifier
*/
	CMPACK_EXPORT(void, cmpack_mfind_add_comparison, (CmpackMuniFind* ctx, int star_id));

/**
	\brief Get comparison star used 
	\details If the autodetection mode is in effect (see the cmpack_mfind_set_comparison()
	function), this function returns the identifier or the comparison star which was 
	actually used during computation.
	\param[in] ctx			munifind context
	\return identifier of the comparison star or negative value on error
*/
	CMPACK_EXPORT(int, cmpack_mfind_get_comparison, (CmpackMuniFind* ctx));

/**
	\brief Set clipping threshold
	\details The function sets the clipping threshold for the
	Munifind tool.
	\param[in] ctx			munifind context
	\param[in] threshold	threshold in %
*/
	CMPACK_EXPORT(void, cmpack_mfind_set_threshold, (CmpackMuniFind* ctx, double threshold));

/**
	\brief Make mag-dev graph from frame set
	\details The result is stored to a given table
	\param[in] ctx			munifind context
	\param[in] fset			frameset context
	\param[out] table		table with results
	\param[in] flags		flags
	\return zero on success or error code on failure.
*/
	CMPACK_EXPORT(int, cmpack_mfind, (CmpackMuniFind* ctx, CmpackFrameSet* fset,
		CmpackTable** table, CmpackMFindFlags flags));

/**
	\brief Find a suitable comparison star
	\details The function tries to find a star, that be the best
	choice to use as a comparison star.
	\param[in] ctx			munifind context
	\param[in] fset			frameset context
	\param[out] star_id		comparison star identifier
	\param[in] flags		flags
	\return zero on success or error code on failure.
*/
	CMPACK_EXPORT(int, cmpack_mfind_autocomp, (CmpackMuniFind* ctx, CmpackFrameSet* fset,
		int* star_id, CmpackMFindFlags flags));

/**
	\brief Determine date and time range
	\details The function finds valid measurements for the selected
	comparison star and finds minimum and maximum date of observation. 
	This value can be used for presentation as a magnitude scale range. 
	\param[in] ctx			munifind context
	\param[in] fset			frameset context
	\param[out] jdmin		minimum JD of the valid measurements
	\param[out] jdmax		maximum JD of the valid measurements
	\param[in] flags		flags
	\return zero on success or error code on failure.
*/
	CMPACK_EXPORT(int, cmpack_mfind_jdrange, (CmpackMuniFind* ctx, CmpackFrameSet* fset,
		double* jdmin, double* jdmax, CmpackMFindFlags flags));

/**
	\brief Determine magnitude range
	\details The function makes pairs using the selected comparison
	star and all other stars, creates a light curve for each pair
	and determines the mag range as difference between minimum and
	maximum magnitude in each light curve. The function returns 
	maximum from the mag ranges. This value can be used for presentation
	as a magnitude scale range. 
	\param[in] ctx			munifind context
	\param[in] fset			frameset context
	\param[out] magrange	maximum magnitude range
	\param[in] flags		flags
	\return zero on success or error code on failure.
*/
	CMPACK_EXPORT(int, cmpack_mfind_magrange, (CmpackMuniFind* ctx, CmpackFrameSet* fset,
		double* magrange, CmpackMFindFlags flags));

#ifdef __cplusplus
}
#endif

#endif