26#define restrict __restrict
27extern ssize_t getdelim(
char **restrict lineptr,
size_t *restrict n,
int delim, FILE *restrict stream);
82 virtual int Init(
int argc,
char** argv)
133 void addModel(
const char *name,
char *format,
char *b64);
186 void addNode(
const char *name,
dsp_location *locations,
void *buf,
int len, timespec starttime,
bool geo);
206 void Plot(
const char *name,
int flags);
214 void Idft(
const char *name,
const char *magnitude,
const char *phase);
222 void Dft(
const char *name,
const char *magnitude,
const char *phase);
230 void Mask(
const char *name,
const char *model,
const char *mask);
238 void Stack(
const char *name,
const char *model1,
const char *model2);
245 void Copy(
const char *name,
const char *model);
253 void Diff(
const char *name,
const char *model1,
const char *model2);
261 void Convolve(
const char *name,
const char *model1,
const char *model2);
269 void LowPass(
const char *name,
const char *node,
double freq);
277 void HighPass(
const char *name,
const char *node,
double freq);
286 void BandPass(
const char *name,
const char *node,
double lofreq,
double hifreq);
295 void BandReject(
const char *name,
const char *node,
double lofreq,
double hifreq);
307 inline virtual void setRa(
double value)
495 FILE *input, *output;
497 char *tmpdir {
nullptr };
Inherit this class to create an OpenVLBI server application.
Definition: vlbi_server.h:66
virtual void setBps(int value)
set the bytes per sample, do this before calling addNode()
Definition: vlbi_server.h:343
void addContext(const char *name)
add a new OpenVLBI context by giving it a name. VLBI::Server has an internal context collection
FILE * getInput()
get the input stream
Definition: vlbi_server.h:448
void addNode(const char *name, dsp_location *locations, void *buf, int len, timespec starttime, bool geo)
Create a new node from a its raw data, give it a name and add it to the current context.
virtual void setHeight(int value)
set the plot height, do this before calling Plot()
Definition: vlbi_server.h:361
void HighPass(const char *name, const char *node, double freq)
Apply a high pass filter on a node buffer.
double getSampleRate(void)
get the current sample rate
Definition: vlbi_server.h:397
int getModels(char **names)
get the names of all the models of the current context.
void setOutput(FILE *out)
set the output stream
Definition: vlbi_server.h:457
char * getModel(const char *name, char *format)
Obtain the base64 encoded file buffer of a model by passing its name.
double getDec(void)
get the current declination coordinate
Definition: vlbi_server.h:379
vlbi_context getContext(void)
Obtain the current OpenVLBI context object.
virtual void setSampleRate(double value)
set the sampling frequency, do this before calling Plot()
Definition: vlbi_server.h:334
dsp_stream_p getModel(const char *name)
Obtain the dsp_stream_p object of a model by passing its name.
void Mask(const char *name, const char *model, const char *mask)
Mask a model with another model by multiplication.
double getRa(void)
get the current right ascension coordinate
Definition: vlbi_server.h:370
void BandReject(const char *name, const char *node, double lofreq, double hifreq)
Apply a band reject filter on a node buffer.
void LowPass(const char *name, const char *node, double freq)
Apply a low pass filter on a node buffer.
double getBps(void)
get the bytes per sample
Definition: vlbi_server.h:412
void Dft(const char *name, const char *magnitude, const char *phase)
Save the magnitude and phase to new models obtained by the fourier transform of the model passed.
void addNode(const char *name, char *b64)
Create a new node from a monodimensional image FITS file, give it a name and add it to the current co...
void delContext(const char *name)
delete an existing OpenVLBI context by name.
void setCorrelationOrder(int order)
set the current correlation order
void Idft(const char *name, const char *magnitude, const char *phase)
Obtain an inverse fourier transform from the magnitude and phase models passed.
virtual void setFreq(double value)
set the frequency observed, do this before calling Plot()
Definition: vlbi_server.h:325
void setContext(const char *name)
set the current OpenVLBI context by passing its name.
Server(void)
Constructor, initializes all the internal variables.
vlbi_func2_t getDelegate()
get the current delegate function
Definition: vlbi_server.h:484
void setInput(FILE *in)
set the input stream
Definition: vlbi_server.h:439
double getFreq(void)
get the current frequency
Definition: vlbi_server.h:388
double getHeight(void)
get the plot height
Definition: vlbi_server.h:430
void setDelegate(vlbi_func2_t func)
set the delegate function
Definition: vlbi_server.h:475
char * currentContext(void)
Obtain the name current OpenVLBI context.
Definition: vlbi_server.h:122
void Shift(const char *name)
Shift a model by its dimension in-place.
void Convolve(const char *name, const char *model1, const char *model2)
Convolve a model with a convolution matrix model.
void Diff(const char *name, const char *model1, const char *model2)
Diff a model with another model.
virtual ~Server(void)
Destructor, destroys this object.
void Copy(const char *name, const char *model)
Copy a model into another model.
virtual int Init(int argc, char **argv)
Called immediately after main(), can be overriden to add your custom arguments.
Definition: vlbi_server.h:82
virtual void setWidth(int value)
set the plot width, do this before calling Plot()
Definition: vlbi_server.h:352
FILE * getOutput()
get the output stream
Definition: vlbi_server.h:466
virtual void setDec(double value)
set the target declination coordinate, do this before calling Plot()
Definition: vlbi_server.h:316
void addModel(const char *name, char *format, char *b64)
Create a new model from a picture, give it a name and add it to the current context.
void Plot(const char *name, int flags)
Plot the current observation into a new model.
void addNodes(const char *name, char *b64)
Create as many nodes as the rows number of an SDFITS file, give it a name and add it to the current c...
void delModel(const char *name)
delete from the current context an existing model by name.
void Stack(const char *name, const char *model1, const char *model2)
Stack a model with another model.
void delNode(const char *name)
delete from the current context an existing node by name.
void BandPass(const char *name, const char *node, double lofreq, double hifreq)
Apply a band pass filter on a node buffer.
void CopyNode(const char *name, const char *node)
Copy a node into another node.
virtual void setRa(double value)
set the target right ascension coordinate, do this before calling Plot()
Definition: vlbi_server.h:307
double getWidth(void)
get the plot width
Definition: vlbi_server.h:421
virtual void Parse(void)
main() creates a loop that calls Parse(), you can use this one, which uses the standard syntax or ove...
vlbi_plot_flags
Flags that characterize a plot.
Definition: vlbi_server.h:51
@ plot_flags_uv_coverage
This will fill all baselines projected pixels with ones.
Definition: vlbi_server.h:55
@ plot_flags_moving_baseline
This indicates that the nodes have a positional stream companion.
Definition: vlbi_server.h:53
@ plot_flags_synced
This indicates that the nodes are synced already and no delay calculation will be done.
Definition: vlbi_server.h:57
@ plot_flags_custom_delegate
This will use a custom visibility delegate.
Definition: vlbi_server.h:59
double(* vlbi_func2_t)(double, double)
The delegate function type to pass to vlbi_plot_uv_plane.
Definition: vlbi.h:342
void * vlbi_context
the OpenVLBI context object type
Definition: vlbi.h:345
Contains a set of informations and data relative to a buffer and how to use it.
Definition: dsp.h:387
The location type.
Definition: dsp.h:352