Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Little fixes and question about README #2

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 33 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,65 +4,77 @@

## Related Scripts

Cand_all.py
- `cand_all.py`

light_curve_fitting.py
- `light_curve_fitting.py`

Light_curve_bazin.py
>> - `Light_curve_bazin.py`

## Preparation

Packages: pandas, spicy, functools, matplotlib, numpy, os, light_curve
Install packages:
```sh
python3 -mpip install pandas scipy matplotlib numpy light_curve
```

Data: OGLE dwarf novae data in /phot
Data: OGLE dwarf novae data in `./phot`

## Results

outburst extracted

outburst extracted plots

fitting plots, which is by default saved under pictures/ directory.
fitting plots, which is by default saved under `./pictures` directory.

## Run Code

--Extract outburst
### Extract outburst

Cand_all.py extracts candidate outburst and return the time arrays and magnitudes arrays. It also plots the extracted data against the original OGLE data.
`cand_all.py` extracts candidate outburst and return the time arrays and magnitudes arrays. It also plots the extracted data against the original OGLE data.
>> Doesn't produce all figures

After manually check each selected outburst, couple of good candidates have been selected and their information is stored in a csv file.

--Fitting model
### Fitting model

Light_curve_fitting.py fit the extracted outbursts with peicewise function and used scipy.optimize to fit the data. It also plots the model against data per light curve and is by default saved under "pictures" directory.
`light_curve_fitting.py` fits the extracted outbursts with piecewise function and uses `scipy.optimize` to fit the data. It also plots the model against data per light curve and is by default saved under `./pictures` directory.
>> fails with `FileNotFoundError: [Errno 2] No such file or directory: 'Dwarf nova.csv'`

Light_curve_bazin.py used bazin function to fit the data and plot it.
>> `Light_curve_bazin.py` used Bazin function to fit the data and plot it.

Further steps used fitting model from light_curve package which can be installed by pip
Further steps use fitting model from `light_curve` package

## Provided results

Selected objects:

> selected_obj = ['OGLE BLG-DN-0001', 'OGLE BLG-DN-0002', 'OGLE BLG-DN-0036', 'OGLE BLG-DN-0087', 'OGLE BLG-DN-0168', 'OGLE BLG-DN-0174', 'OGLE BLG-DN-0233', 'OGLE BLG-DN-0275', 'OGLE BLG-DN-0286', 'OGLE BLG-DN-0305', 'OGLE BLG-DN-0373', 'OGLE BLG-DN-0376', 'OGLE BLG-DN-0421', 'OGLE BLG-DN-0444', 'OGLE BLG-DN-0458', 'OGLE BLG-DN-0531', 'OGLE BLG-DN-0588', 'OGLE BLG-DN-0595', 'OGLE BLG-DN-0690', 'OGLE BLG-DN-0783', 'OGLE BLG-DN-0826', 'OGLE BLG-DN-0899']

Model Fitting information: saved as a csv files "analysis/fitting_info.csv", with OGLE ID, outburst index, starting time, ending time, and model parameters.
Model Fitting information: saved as a csv files `analysis/fitting_info.csv`, with OGLE ID, outburst index, starting time, ending time, and model parameters.



# Retrive Distance and extinction
# Retrieve Distance and extinction

## Related scripts

Get_distance.py
>> - `Get_distance.py`

get_extinction.py
- `get_extinction.py`

## Preperation
>> ## Preperation
>>
>> Packages: cand_all, numpy, matplotlib, os, light_curve
>>
>> Data: phot
>>
>> **Remove?**

Packages: cand_all, numpy, matplotlib, os, light_curve

Data: phot
>> Describe dustmaps data file fetching
```sh
python3 -c 'from dustmaps import sfd, bayestar; sfd.fetch(); beystar.fetch()'
```

## Run Code

Expand All @@ -76,7 +88,7 @@ If distance is provided from Gaia, extinction is given by Bayestar

Get_distance.py provides distance information for all extracted objects (not the manually selected objects) and is by default saved as "analysis/distance_1arcsec.csv". Objects without data from Gaia will be skipped.

Get_extinction.py provides extinction information for all selected objects. Columns: OGLE ID (name), galactic coordinates (l,b), extinction from Bayestar, SFD, and Marshall.
`get_extinction.py` provides extinction information for all selected objects. Columns: OGLE ID (name), galactic coordinates (l,b), extinction from Bayestar, SFD, and Marshall.

## Provided Results:

Expand Down
2 changes: 2 additions & 0 deletions cand_all.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import numpy as np
from matplotlib import pyplot as plt
import os
Expand Down
2 changes: 2 additions & 0 deletions get_extinction.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

from astropy.table import Table
from astropy.io import ascii
from astropy.coordinates import SkyCoord
Expand Down
11 changes: 4 additions & 7 deletions light_curve_fitting.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import pandas as pd
from scipy import optimize
from functools import partial
Expand Down Expand Up @@ -88,10 +90,5 @@ def main():
plot_piecewise_fit(t, m, p)









if __name__ == '__main__':
main()