gbrammer / eazy-py

Pythonic photometric redshift tools based on EAZY
MIT License
37 stars 25 forks source link

HDFN-demo.ipynb issue and questions #25

Open xraider1 opened 1 year ago

xraider1 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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.