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

HDFN-demo.ipynb issue and questions #25

Open
xraider1 opened this issue Dec 3, 2022 · 2 comments
Open

HDFN-demo.ipynb issue and questions #25

xraider1 opened this issue Dec 3, 2022 · 2 comments

Comments

@xraider1
Copy link

xraider1 commented Dec 3, 2022

I am trying to use my own catalog using fluxes I calculated from the magnitudes I got from the B,V,g',I',r, sdss filtered pictures I took. I have been having issues with getting it set up. I was using HDFN-demo.ipynb to learn how to do so and I got an error but had help how to figure it out. the issue was with

self = eazy.photoz.PhotoZ(param_file=None, translate_file=translate_file, zeropoint_file=None, params=params, load_prior=True, load_products=False)

see picture below of the error

image

what the issue was the templates file

Had to do
!rm -R templates

os.symlink(os.path.join('easy-photos','templates'), 'templates')

to fix it.

now I was using this demo to figure out how to add my magnitudes and fluxes csv file so I can estimate the redshift and what im doing is not working. do you have any recommendations on how to do so?

@gbrammer
Copy link
Owner

gbrammer commented Dec 5, 2022

Recent updates to the eazy-py codebase should checkout the eazy-photoz repository if necessary, and then the sym-linking should work. But it may also be the case that the code doesn't adequately check that if templates already exists in the working directory, that the symlink is correct. Removing the link manually, like you say, may be the working solution for now.

Here is the output when I run the HDFN-demo notebook in a fresh conda environement with a clone of the most recent eazy-py repository:

import os
import numpy as np
import matplotlib.pyplot as plt

import eazy

if not os.path.exists('templates'):
    eazy.symlink_eazy_inputs() 
Cloning into 'eazy-photoz'...
cloning https://github.com/gbrammer/eazy-photoz.git to [...]/miniconda3/envs/eazytest/lib/python3.9/site-packages/eazy/data/
[...]/miniconda3/envs/eazytest/lib/python3.9/site-packages/eazy/data/templates -> ./templates
[...]/miniconda3/envs/eazytest/lib/python3.9/site-packages/eazy/data/filters/FILTER.RES.latest -> ./FILTER.RES.latest

@gbrammer
Copy link
Owner

gbrammer commented Dec 5, 2022

Your second question about the format of the input catalog is quite separate from this. Can you give more information on your problems formatting the input catalog?

Generally, the catalog must be a list of flux densities and associated uncertainties in a number of filters, for example the old demo catalog hdfn_fs99_eazy.cat. The translate file tells the code which filters in FILTER.RES.latest correspond to which columns in the catalog file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants