mfouesneau / pyphot

suite to deal with passband photometry
https://mfouesneau.github.io/pyphot/
MIT License
57 stars 18 forks source link

With regard adding new filters #33

Closed jvines closed 2 years ago

jvines commented 2 years ago

Hi,

I recently added some filters to pyphot, but when calling the info method it shows an AttributeError, stating that it needs wavelength units. I fear I may have missed something while adding the filters. How could I go around to fix this?

Thanks in advance.

mfouesneau commented 2 years ago

Depending on using HDF5 file or ascii the method is slightly different. Ascii you need to update the header file, hdf5 you need to update the attributes of the table.

If they are loaded in memory, you can also manually set the unit attribute and this should work.

jvines commented 2 years ago

I used the HDF5 method. How can I update the attributes??

mfouesneau commented 2 years ago

Did you create the SM_g filter? it breaks the tests

jvines commented 2 years ago

Yes, I did. The info about those filters can be found here

mfouesneau commented 2 years ago

Yes, so the library is broken. I would also not call the filters SM_... SkyMapper or Skymapper is more explicit.

Would you mind to redo it?

jvines commented 2 years ago

No problem. How can I address the attribute issue??

mfouesneau commented 2 years ago

revert the file to its previous version and redo your script.

jvines commented 2 years ago

No, I meant specifically the AttributeError I was getting. How can I tell pyphot the units are angstrom, for example

mfouesneau commented 2 years ago

When you create the filter object you have keywords to set the units properly.

jvines commented 2 years ago

So I can't just add them to the HDF5 file right away, then?

jvines commented 2 years ago

I ask mainly because the add_filter method from the pyphot.phot.Library class is not implemented and I don't remember how I added the NGTS filter succesfully

jvines commented 2 years ago

Just FYI, I added the filters correctly this time, with a pending PR!

mfouesneau commented 2 years ago

Unit tests are now created to avoid merging when the file is broken.