jgliss / pyplis

Python toolbox for the analysis of UV SO2 camera data
GNU General Public License v3.0
7 stars 5 forks source link

update USGS camera definitions #13

Closed christophkern closed 5 years ago

christophkern commented 5 years ago

Dear Jonas - the USGS SO2 camera is currently defined in the cam_info.txt file as having a focal length of 12.5 mm. This is true for an earlier version of the instrument (e.g. the version used in the 2012 intercomparison at Stromboli). However, newer versions of the instrument have a 9 mm object lens. Could you please add an entry for this newer version, perhaps by renaming the cameras usgs_12mm and usgs_9mm to keep them separate? Thank you!

solvejgdinger commented 5 years ago

Hi, you have probably already performed these changes locally, but it might be useful for future users.

If you want to add a new camera to cam_info.txt, the easiest way is to adapt example script 0.2 to your needs. By calling pyplis.setupclasses.Camera.save_as_default() in the end, it gets written to your local copy of cam_info.txt and you can load it in your other scripts as usual. There is also a more detailed explanation in the documentation .

In your case, when you only want to change one parameter of an existing camera, something like this should work

import pyplis
cam = pyplis.setupclasses.Camera("usgs")
cam.focal_length = 9e-3
cam.cam_id = "usgs_9mm"
cam.save_as_default()

cam_reloaded = pyplis.setupclasses.Camera("usgs_9mm")

Hope this helps.

jgliss commented 5 years ago

Dear @christophkern,

I have now added a new camera usgs_9mm in the py3 branch of the repository (you might want to work on that branch for now, even if you are still using Python 2.7). The 12mm camera is accessible either using usgs_12mm or using the previous name usgs.

In any case: as @heliotropium72 pointed out, you can also always update this in your analysis script. Thanks, Solvejg!

Please, let me know if this works for you or if you have any questions / problems.

Cheers, Jonas