semvec/pypi-packages huggingface dataset:
random-fourier-features-pytorch 1.0.1
Random Fourier Features for PyTorch
License: MIT

# Random Fourier Features Pytorch
[![Python package](https://github.com/jmclong/random-fourier-features-pytorch/actions/workflows/python-package.yml/badge.svg)](https://github.com/jmclong/random-fourier-features-pytorch/actions/workflows/python-package.yml)
[![Coverage Status](https://coveralls.io/repos/github/jmclong/random-fourier-features-pytorch/badge.svg)](https://coveralls.io/github/jmclong/random-fourier-features-pytorch)
[![Documentation Status](https://readthedocs.org/projects/random-fourier-features-pytorch/badge/?version=latest)](https://random-fourier-features-pytorch.readthedocs.io/en/latest/?badge=latest)

[![PyPI](https://img.shields.io/pypi/v/random-fourier-features-pytorch.svg?style=plastic&PyPI)](https://pypi.org/project/random-fourier-features-pytorch/)
[![Downloads](https://img.shields.io/pypi/dm/random-fourier-features-pytorch.svg?style=plastic&label=Downloads)](https://pypi.org/project/random-fourier-features-pytorch/)

Random Fourier Features Pytorch is an implementation of "Fourier Features Let Networks Learn High Frequency Functions in Low Dimensional Domains" by Tancik et al. designed to fit seamlessly into any PyTorch project.

## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install the package.

```bash
pip install random-fourier-features-pytorch
```

## Usage
See the [documentation](https://random-fourier-features-pytorch.readthedocs.io/en/latest/) for more details, but here are a few simple usage examples:
### Gaussian Encoding
```python
import torch
import rff

X = torch.randn((256, 256, 2))
encoding = rff.layers.GaussianEncoding(sigma=10.0, input_size=2, encoded_size=256)
Xp = encoding(X)
```
### Basic Encoding
```python
import torch
import rff

X = torch.randn((256, 256, 2))
encoding = rff.layers.BasicEncoding()
Xp = encoding(X)
```
### Positional Encoding
```python
import torch
import rff

X = torch.randn((256, 256, 2))
encoding = rff.layers.PositionalEncoding(sigma=1.0, m=10)
Xp = encoding(X)
```
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.


## Citation
If you end up using this repository, please cite it as:
```bibtex
@article{long2021rffpytorch,
  title={Random Fourier Features Pytorch},
  author={Joshua M. Long},
  journal={GitHub. Note: https://github.com/jmclong/random-fourier-features-pytorch},
  year={2021}
}
```
also cite the original work
```bibtex
@misc{tancik2020fourier,
      title={Fourier Features Let Networks Learn High Frequency Functions in Low Dimensional Domains}, 
      author={Matthew Tancik and Pratul P. Srinivasan and Ben Mildenhall and Sara Fridovich-Keil and Nithin Raghavan and Utkarsh Singhal and Ravi Ramamoorthi and Jonathan T. Barron and Ren Ng},
      year={2020},
      eprint={2006.10739},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}
```

## License
This is released under the MIT license found in the [LICENSE](LICENSE) file.
Jux 1.0.0
Package for feature detection in Astronomy Lightcurves
License: MIT

# JUX

<div style="display:flex;">
    <div>
        This project is concerned with processing and identification of features present in astronomical light data, often referred to as lightcurve data. It was created in response to 2 ocassions:
        <ul>
            <li>ISRO Problem Statement: Inter-IIT Tech Meet 10.0</li>
            <li>XUVI: Summer Project, Astronomy Club IITK, 2022</li>
        </ul>
    </div>
    <div style="max-width:120px;margin-left:10px">
        <img src="./assets/logo.jpg" />
    </div>
</div>

## How to install it?
```sh
pip install jux
```
Dependencies will build and you can proceed using it.

## What all can it process?
Currently, feature detection is supported for:
- Exoplanet detection
    - Transit Photometry
    - Astrometry
- Solar Flare detection

## How to use it?
Sample data can be downloaded <a href="https://github.com/astroclubiitk/jux/tree/main/examples" targer="_blank">here</a>.

### Exoplanet detection
1. Transit Photometry
```py
import pandas as pd
from jux.exoplanet import TransitingExoplanet

R = 7e8

df = pd.read_csv('transit_data.csv')
time = df[df.columns[0]]
fraw = df[df.columns[1]]

exoplanet = TransitingExoplanet(time, fraw, R)
exoplanet.plot_raw_data()

exoplanet.correct_data(threshold_brightness=0.998)
exoplanet.plot_corrected_data()

print("Radius of the planet is {} km".format(int(exoplanet.radius / 1000)))
print("The planet orbits around it's host star every {} Earth days".format(round(exoplanet.orbital_period, 2)))
print("The transit duration of the exoplanet is {} hours".format(round(exoplanet.transit_duration, 2)))
```

2. Astrometry
```py
import pandas as pd
from jux.exoplanet import Star

M = 1e30

df = pd.read_csv('astrometry_data.csv')
time = df[df.columns[0]]
vel = df[df.columns[1]]

star = Star(time, vel, M)
star.plot_raw_fourier_transform()

star.correct_fourier_transform(threshold_power=50)
star.plot_individual_planet_influence()

for i in range(len(star.planets)):
    star.print_planet_details(i)
    print("")
```

### Solar Flare detection

```py
from jux.sun import Flares, read_lc_file

path_to_lc = 'ch2_xsm_20200928_v1_level2.lc'
time, rate = read_lc_file(path_to_lc)

flares = Flares(time, rate)
flares.identified.plot()
flares.print_details()
```