Code Monkey home page Code Monkey logo

pacman's People

Contributors

dfm avatar gapp-c avatar ivastar avatar lkreidberg avatar mbsck avatar n-bachmann avatar sebastian-zieba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pacman's Issues

Fitting the Light Curves documentation: Model calculation

In the Fitting the Light Curves Documentation, the fit parameters corresponding to each model are given, but the exact meaning of many of the listed parameters is ambiguous since many of them are given in abbreviations only and without units. I think more descriptions of the fit parameters are needed. Also, for the models with analytical expressions (such as model_ramp), I think it'd be useful to state the equation of the model for clarification of the parameters' meanings.

Error when running Stage 30 in the Quickstart Tutorial

Hi,

I'm currently working through the Quickstart Tutorial and come across the following error when running Stage 30. I have not altered any parameters in the PCF from the example.

Here's the output & error:

workdir:  ./run_2022-10-19_11-54-11_GJ1214_Hubble13021/
eventlabel:  GJ1214_Hubble13021
Successfully reloaded meta file
Starting s30
Spectroscopic light curve fit(s) will be performed
using most recent s21 run: ./run_2022-10-19_11-54-11_GJ1214_Hubble13021//extracted_sp/bins11_2022-10-19_12-12-10
Identified file(s) for fitting: ['./run_2022-10-19_11-54-11_GJ1214_Hubble13021//extracted_sp/bins11_2022-10-19_12-12-10/speclc1.158.txt', './run_2022-10-19_11-54-11_GJ1214_Hubble13021//extracted_sp/bins11_2022-10-19_12-12-10/speclc1.204.txt', './run_2022-10-19_11-54-11_GJ1214_Hubble13021//extracted_sp/bins11_2022-10-19_12-12-10/speclc1.250.txt', './run_2022-10-19_11-54-11_GJ1214_Hubble13021//extracted_sp/bins11_2022-10-19_12-12-10/speclc1.296.txt', './run_2022-10-19_11-54-11_GJ1214_Hubble13021//extracted_sp/bins11_2022-10-19_12-12-10/speclc1.342.txt', './run_2022-10-19_11-54-11_GJ1214_Hubble13021//extracted_sp/bins11_2022-10-19_12-12-10/speclc1.389.txt', './run_2022-10-19_11-54-11_GJ1214_Hubble13021//extracted_sp/bins11_2022-10-19_12-12-10/speclc1.435.txt', './run_2022-10-19_11-54-11_GJ1214_Hubble13021//extracted_sp/bins11_2022-10-19_12-12-10/speclc1.481.txt', './run_2022-10-19_11-54-11_GJ1214_Hubble13021//extracted_sp/bins11_2022-10-19_12-12-10/speclc1.527.txt', './run_2022-10-19_11-54-11_GJ1214_Hubble13021//extracted_sp/bins11_2022-10-19_12-12-10/speclc1.573.txt', './run_2022-10-19_11-54-11_GJ1214_Hubble13021//extracted_sp/bins11_2022-10-19_12-12-10/speclc1.619.txt']

****** File: 1/11


Removed 8 exposures because they were the first exposures in the orbit.
Removed 34 exposures because they were the first orbit in the visit.
median log10 raw flux: 6.246165202239972
The highest amount of exposures in an orbit is 18
Number of free parameters:  21
Names of free parameters:  ['t0', 'rp', 'u1', 'c', 'c', 'c', 'v', 'v', 'v', 'r1', 'r1', 'r1', 'r2', 'r2', 'r2', 'r3', 'r3', 'r3', 'scale', 'scale', 'scale']
The predicted rms is 247.26

*STARTS LEAST SQUARED*
Runs MPFIT... 
v_1      9.7091e-05      8.4716e-07
r2_0     1.1420e-05      6.5022e-10
r2_1     2.2779e-03      3.3807e-07
r3_0     6.2578e-05      5.5039e-09
r3_1     4.1557e-05      3.3397e-07
scale_0          2.8774e-02      7.4845e-05
scale_1          3.9560e-03      6.7583e-05
rms, chi2red =  267564.70429841534 1454721.5884296482
['t0', 'rp', 'u1', 'c0', 'c1', 'c0', 'v1', 'v0', 'v1', 'r10', 'r11', 'r10', 'r21', 'r20', 'r21', 'r30', 'r31', 'r30', 'scale1', 'scale0', 'scale1']

*STARTS MCMC*
Runs MPFIT... 
c_1      6.2841e+00      7.7178e-02
v_1      9.7091e-05      1.0218e-03
r2_0     1.6484e-05      1.1320e-06
r3_0     9.0327e-05      9.5821e-06
r3_1     1.7544e-01      1.8905e+00
scale_0          2.8774e-02      9.0272e-02
scale_1          3.9560e-03      8.1513e-02
rms, chi2red =  267564.70429854095 0.99999999999999
Traceback (most recent call last):
  File "/home/isy/aur/PACMAN/src/pacman/workdir/pacman_script.py", line 135, in <module>
    main()
  File "/home/isy/aur/PACMAN/src/pacman/workdir/pacman_script.py", line 131, in main
    meta = s30.run30(eventlabel, workdir)
  File "/home/isy/aur/PACMAN/src/pacman/s30_run.py", line 147, in run30
    val_mcmc, err_lower_mcmc, err_upper_mcmc, fit = mcmc_fit(data, model, params, f, meta, fit_par)
  File "/home/isy/aur/PACMAN/src/pacman/lib/mcmc.py", line 37, in mcmc_fit
    theta = util.format_params_for_sampling(params, meta, fit_par)
  File "/home/isy/aur/PACMAN/src/pacman/lib/util.py", line 706, in format_params_for_sampling
    theta = params[free_array]
IndexError: boolean index did not match indexed array along dimension 0; dimension is 46 but corresponding boolean dimension is 52

Thanks for any assistance you can provide!

Issue with TOI-1201 data optimal extraction

Hi Sebastian. I've come across an issue when running stage 20 with TOI-1201 data: the output of the white light curve and spectroscopic light curve spectra contained in files lc_spec.txt and lc_white.txt produce "nan" for spec_opt and var_opt. I think it is an issue with the optimal extraction algorithm, but I can't figure out how to resolve it. I am attaching a screenshot of the lc_white.txt file. I haven't changed the code at all, and the pipeline still works great for GJ-1214 data, producing no such "nans".

Screen Shot 2023-10-11 at 10 56 14 AM

Error when running Stage 30 (spec) on my own data

Hello,

I'm trying out PACMAN on my own WFC3/G141 data set, and run into the following attribute error when I get to fitting the spectroscopic light curves in Stage 30.

(pacman) mmmurphy@ilus:~/inquiry/hd219666b/pacman$ python pacman_script.py --s30
workdir: ./run_2022-12-12_15-54-19_hd219666b/
eventlabel: hd219666b
Successfully reloaded meta file
Starting s30
Spectroscopic light curve fit(s) will be performed
using most recent s21 run: ./run_2022-12-12_15-54-19_hd219666b//extracted_sp/bins16_2022-12-13_12-38-52
Identified file(s) for fitting: ['./run_2022-12-12_15-54-19_hd219666b//extracted_sp/bins16_2022-12-13_12-38-52/speclc1.151.txt', './run_2022-12-12_15-54-19_hd219666b//extracted_sp/bins16_2022-12-13_12-38-52/speclc1.183.txt', './run_2022-12-12_15-54-19_hd219666b//extracted_sp/bins16_2022-12-13_12-38-52/speclc1.214.txt', './run_2022-12-12_15-54-19_hd219666b//extracted_sp/bins16_2022-12-13_12-38-52/speclc1.246.txt', './run_2022-12-12_15-54-19_hd219666b//extracted_sp/bins16_2022-12-13_12-38-52/speclc1.278.txt', './run_2022-12-12_15-54-19_hd219666b//extracted_sp/bins16_2022-12-13_12-38-52/speclc1.309.txt', './run_2022-12-12_15-54-19_hd219666b//extracted_sp/bins16_2022-12-13_12-38-52/speclc1.341.txt', './run_2022-12-12_15-54-19_hd219666b//extracted_sp/bins16_2022-12-13_12-38-52/speclc1.373.txt', './run_2022-12-12_15-54-19_hd219666b//extracted_sp/bins16_2022-12-13_12-38-52/speclc1.404.txt', './run_2022-12-12_15-54-19_hd219666b//extracted_sp/bins16_2022-12-13_12-38-52/speclc1.436.txt', './run_2022-12-12_15-54-19_hd219666b//extracted_sp/bins16_2022-12-13_12-38-52/speclc1.468.txt', './run_2022-12-12_15-54-19_hd219666b//extracted_sp/bins16_2022-12-13_12-38-52/speclc1.499.txt', './run_2022-12-12_15-54-19_hd219666b//extracted_sp/bins16_2022-12-13_12-38-52/speclc1.531.txt', './run_2022-12-12_15-54-19_hd219666b//extracted_sp/bins16_2022-12-13_12-38-52/speclc1.563.txt', './run_2022-12-12_15-54-19_hd219666b//extracted_sp/bins16_2022-12-13_12-38-52/speclc1.594.txt', './run_2022-12-12_15-54-19_hd219666b//extracted_sp/bins16_2022-12-13_12-38-52/speclc1.626.txt']

****** File: 1/16

Removed 4 exposures because they were the first exposures in the orbit.
Removed 16 exposures because they were the first orbit in the visit.
median log10 raw flux: 6.77944412410621
The highest amount of exposures in an orbit is 16
Number of free parameters: 6
Names of free parameters: ['rp', 'c', 'v', 'r1', 'r2', 'scale']
The predicted rms is 158.67

STARTS LEAST SQUARED
Runs MPFIT...
rp_0 4.1487e-02 6.2156e-04
c_0 6.7778e+00 4.1090e-05
v_0 -1.2749e-06 2.8505e-07
r1_0 7.3465e-02 1.7971e-02
r2_0 6.8390e+00 8.4698e-02
scale_0 1.0447e-02 4.6646e-05
rms, chi2red = 141.2989683522296 0.9069527852844692
['rp', 'c', 'v', 'r1', 'r2', 'scale']

STARTS MCMC
Runs MPFIT...
rp_0 4.1487e-02 6.2156e-04
c_0 6.7778e+00 4.1090e-05
v_0 -1.2749e-06 2.8505e-07
r1_0 7.3465e-02 1.7971e-02
r2_0 6.8390e+00 8.4698e-02
scale_0 1.0447e-02 4.6646e-05
rms, chi2red = 141.2989683522296 0.9069527852844692
Run emcee...
0%| | 0/6000 [00:00<?, ?it/s]/home/mmmurphy/anaconda3/envs/pacman/lib/python3.9/site-packages/emcee/moves/red_blue.py:99: RuntimeWarning: invalid value encountered in double_scalars
lnpdiff = f + nlp - state.log_prob[j]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6000/6000 [00:20<00:00, 291.46it/s]
Traceback (most recent call last):
File "/home/mmmurphy/inquiry/hd219666b/pacman/pacman_script.py", line 139, in
main()
File "/home/mmmurphy/inquiry/hd219666b/pacman/pacman_script.py", line 135, in main
meta = s30.run30(eventlabel, workdir)
File "/home/mmmurphy/pipelines/PACMAN/src/pacman/s30_run.py", line 146, in run30
val_mcmc, err_lower_mcmc, err_upper_mcmc, fit = mcmc_fit(data, model, params, f, meta, fit_par)
File "/home/mmmurphy/pipelines/PACMAN/src/pacman/lib/mcmc.py", line 111, in mcmc_fit
util.append_fit_output(fit, meta, fitter='mcmc', medians=medians)
File "/home/mmmurphy/pipelines/PACMAN/src/pacman/lib/util.py", line 868, in append_fit_output
meta.chi2_notrescaled_list_mcmc.append(round(fit.chi2_notrescaled, precision))
AttributeError: 'Model' object has no attribute 'chi2_notrescaled'

I did not run into this error when doing the quickstart tutorial on the GJ 1214 data, which ran fine. I also did not run into this when fitting the white light curve for my data. Thanks in advance for any help you can provide!

Issue with "no directory" when running s21

Hello! I'm just trying to run the pipeline with the example dateset for GJ 1214b, and I'm stuck on stage 21. I haven't had any issues when running the previous stages, but when I try to run s21, I get the error message: NotADirectoryError: [Errno 20] Not a directory: './run_2023-09-20_12-23-36_GJ1214_Hubble13021//extracted_lc/.DS_Store/lc_spec.txt'
I haven't changed anything in the src code, so I'm not sure why this issue is coming up and how to resolve it.
Thanks!

Issue with TOI-561 data: Stage 20

Hi Sebastian! I am trying to run TOI-561 data that recently became available on MAST (proposal ID = 17192), but I'm running into an error at stage 20. I am attaching a screenshot of the error.
Screen Shot 2023-11-17 at 11 16 44 AM

The issue with the particular dataset is that the guide star was lost halfway through the observation, and then recovered. The result was that some of the images did not contain a spectrum, and some of them did contain a spectrum, but it was off-centered. Even after I removed these images from the data directory, I am still getting the same error.

S30: How to specify the directory containing the exotic-LD data

I use s30 to fit white light curves using the attached fit_par.txt and pcf files. With this setup, I expect PACMAN to calculate the quadratic limb darkening coefficients u1 and u2 and use these in the transit model without changing them in the fit. However, I get the following error message:

FileNotFoundError: Model not found for stellar grid=kurucz at path=/home/zieba/Downloads/exotic-ld_data/kurucz/MH-0.1/teff5250/logg4.5/kurucz_spectra.dat.

I don't see a way to change the directory containing the exotic-LD data from the path given in the error message to my own in the pcf, so how do I tell PACMAN where I keep my exotic-LD data?

obs_par_s30-only.txt
fit_par.txt

Fixing limb darkening coefficients

I see that there are two limb darkening parameters (u1, u2) in the fit_par file and the option fix_ld in the pcf. Thus, to fix the LD parameters, one could either fix their values to given numbers in the fit_par file or use model results from exotic-LD for them using the pcf. When I state in both files that I want to fix them, which values have priority?

Fitting the Light Curves documentation: Model combination

I'd be curious to know how PACMAN combines the individual models (constant, model_ramp, transit etc) to give the the full model. There are different ways one can combine systematics and astrophysical models, so it'd be great to point out in the documentation how PACMAN does this.

Problem with trace in GRISM512 subarray

Thank you for this super-helpful pipeline! I'm having an issue reducing a WFC3/G141 dataset taken with the GRISM512 subarray, and I think the trace step is the culprit.

I've reduced the example GJ1214 dataset, and the trace step behaves as expected.

trace_5

However, when I try to apply the pipeline to a transit observation of HD189733 (Program 12881, Visit 11), I haven't been able to extract the spectrum. This is what a typical trace image looks like:

trace_9

(The brightest spectrum in the top middle is the first-order spectrum of HD189733A, the second-order spectrum is to the right, and the spectrum of the fainter companion HD189733B is below.)

The star is correctly identified in the direct image, but as you can see from the position of the yellow trace line, the pipeline is looking for the spectrum in the wrong part of the chip.

di_0

I haven't noticed any parameters in the .pcf file that I can tweak to change this, so my best guess is that this is a bug with how the pipeline handles the GRISM512 subarray versus the GRISM256 one. Sorry if I missed something!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.