README.md

Build
Status

Introduction

Variable Star package provides the main funtions to analized patterns on the oscilation modes of variable stars.

All the code is based on these two papers:

Installation

install.packages("devtools")
library(devtools)
install_github("rmaestre/variableStars")

** Note for Windows users **

We strongly recommend to use The Microsoft R Open & MKL R distribution as R distribution.

Also, please do not forgive to include the file Makevars.win into the src project folder with the next content:

CXX_STD = CXX11

PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) 
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)

An UI for experimentation with synthetic data is provided

library(variableStars)
runUISynthetic()

Example of use on a pulsar data

Please, find here or here the main execution of the complete package procedure.

Main Workflow

(The pulsar in the Crab Nebula is composed by images taken by Hubble (red) and Chandra X-Ray(blue))

Implementation

All core funcionalities are programmed in C++ using RcppArmadillo integrated through Rcpp. An example of function to calculate all differences between pair of element using Armadillo C++ library, iterators and std operattions:

  // Calculate all frequences differences
  int n = frequences.n_elem;
  int diagSupElements = n * (n - 1) / 2;
  arma::vec diff(diagSupElements); // Number of elements in the sup. diag.
  NumericVector::iterator it_first, it_second, it_diff;
  it_diff = diff.begin(); // output iterator
  int countElements = 0;
  // Double loop (n^2 complexity)
  for (it_first = frequences.begin(); it_first < frequences.end(); it_first++) {
    for (it_second = it_first; it_second < frequences.end() & it_diff < diff.end(); it_second++) {
      if (it_first != it_second) { // Jump same elements
        * it_diff =
          std::abs( * it_second - * it_first); // Save absolute difference
        if ( * it_diff != 0) {
          it_diff++; // Increase pointer
          countElements++; // Increase elements
        }
      }
    }
  }
  // Remove unused memory
  diff.resize(diagSupElements - (diagSupElements - countElements));
  // Return results
  return diff;
}

However, all code can be call from R easily with the next function

result <- process(
  data$frequency,
  data$amplitude,
  filter = "uniform",
  gRegimen = 0,
  minDnu = 15,
  maxDnu = 95,
  dnuValue = -1,
  dnuGuessError = 10,
  dnuEstimation = TRUE,
  numFrequencies = 30,
  debug = TRUE
)

Deep Neural Networks

This package is also used as feature engineering in Deep Neural Network application to Dnu and dr estimation.



rmaestre/variableStars documentation built on April 11, 2020, 11:10 p.m.