!ozfxFAWEEDbVgXoYVA:matrix.org

Astropy general

260 Members
General discussion about astropy17 Servers

Load older messages


Timestamp Message
15 Jan 2020
22:00:48@slack_astropy_UHCHR5WEQ:openastronomy.orgeigenbrot The issue is with subformats:
22:01:48@slack_astropy_UHCHR5WEQ:openastronomy.orgeigenbrot
>>> d = Time('2019-06-21T10:00:00')
>>> d.to_value('iso', subfmt='date')
Traceback (most recent call last):
  File " stdin ", line 1, in  module 
  File "/usr/lib/python3.8/site-packages/astropy/time/core.py", line 993, in to_value
    value = tm._shaped_like_input(tm._time.to_value(
TypeError: to_value() got an unexpected keyword argument 'out_subfmt'
22:02:24@slack_astropy_UHCHR5WEQ:openastronomy.orgeigenbrot based on the docs at https://docs.astropy.org/en/stable/time/#subformat I would have expected that d.to_value call to be completely valid
22:02:33@slack_astropy_UHCHR5WEQ:openastronomy.orgeigenbrot is this a bug or am I misunderstanding something?
22:04:08@slack_astropy_U774ARTKR:openastronomy.orgpllim That sounds so familiar...
22:04:45@slack_astropy_U774ARTKR:openastronomy.orgpllim Maybe https://github.com/astropy/astropy/pull/9812 will fix your problem?
22:05:48@slack_astropy_U774ARTKR:openastronomy.orgpllim Looks like this problem? https://github.com/astropy/astropy/issues/9860
22:07:39@jorgepiloto:matrix.orgjorgepiloto changed their profile picture.
22:08:51@slack_astropy_UHCHR5WEQ:openastronomy.orgeigenbrot Thanks for those links. It does seem like these are all related problems.
22:09:27@slack_astropy_UHCHR5WEQ:openastronomy.orgeigenbrot Until that PR makes it to the masses it looks like doing d.out_subfmt = 'date' before the call to to_value works well enough
16 Jan 2020
01:06:13@slack_astropy_U75NUJ99P:openastronomy.orgparejkoj If you wanted to measure the FWHM of stars in an image with astropy tools, how would you go about it? It doesn't look like photutils can do this, as it expects that you know the PSF a priori.
01:27:19@slack_astropy_U8EC16YE4:openastronomy.orgjturner
In reply to@slack_astropy_U75NUJ99P:openastronomy.org
If you wanted to measure the FWHM of stars in an image with astropy tools, how would you go about it? It doesn't look like photutils can do this, as it expects that you know the PSF a priori.
We have been using sextractor. Just in case you were thinking Gemini might have the answer...
06:28:46@slack_astropy_U76R9NRLP:openastronomy.orgbsipocz
In reply to@slack_astropy_U8EC16YE4:openastronomy.org
We have been using sextractor. Just in case you were thinking Gemini might have the answer...
Look into the source detection or segmentation functionalities in photutils. I don't have an easy access atm to the docs, but as I recall a recent discussion with Larry, we do have functionality that returns 2d parameterisation of the fitted ellipses. Using that you may come up with a fwhm like value.
06:29:36@slack_astropy_U76R9NRLP:openastronomy.orgbsipocz
In reply to@slack_astropy_U76R9NRLP:openastronomy.org
Look into the source detection or segmentation functionalities in photutils. I don't have an easy access atm to the docs, but as I recall a recent discussion with Larry, we do have functionality that returns 2d parameterisation of the fitted ellipses. Using that you may come up with a fwhm like value.
Also, the epsf functionality might be relevant too
07:20:18@slack_astropy_U75NUJ99P:openastronomy.orgparejkoj
In reply to@slack_astropy_U76R9NRLP:openastronomy.org
Also, the epsf functionality might be relevant too
The goal is to write some automated focusing code for a student observatory. I’m surprised there isn’t a greater need for “auto-PSF” code for just this purpose. Does everybody just focus manually, or what?
07:34:58@slack_astropy_U76R9NRLP:openastronomy.orgbsipocz
In reply to@slack_astropy_U75NUJ99P:openastronomy.org
The goal is to write some automated focusing code for a student observatory. I’m surprised there isn’t a greater need for “auto-PSF” code for just this purpose. Does everybody just focus manually, or what?
I suppose focusing is part of TCS and that may be less python based than pipelines, etc 🤷‍♀️
07:35:43@slack_astropy_U76R9NRLP:openastronomy.orgbsipocz
In reply to@slack_astropy_U76R9NRLP:openastronomy.org
I suppose focusing is part of TCS and that may be less python based than pipelines, etc 🤷‍♀️
But even then, it shouldn't take many lines to build something from using the photutils segmentation code
07:37:38@slack_astropy_USEH4N9FT:openastronomy.orgShalmalee kapse joined the room.
07:41:03@slack_astropy_USEH4N9FT:openastronomy.orgShalmalee kapse Hi. I am trying to align two images I downloaded from MAST HST portal. For this, I am using astropy-reproject package. However, I am running into an error, every time I use reproject, despite providing the WCS information. Following is the error:
ValueError: an astropy.io.fits.HDUList is required for Lookup table distortion.
I am using reproject version 0.6, and astropy both versions (3.2.3 and 4.0).
Information about the images: One image is from HST/WFC3 and second one is from HST/ACS.  
Here's the google drive link where my images and code are: https://drive.google.com/open?id=1SRZ9Evb1NgF_yJmQdLCw5soO929lT204
12:17:34@slack_astropy_U7NCAGGJV:openastronomy.orgStuart Littlefair
In reply to@slack_astropy_U76R9NRLP:openastronomy.org
But even then, it shouldn't take many lines to build something from using the photutils segmentation code
For focusing a telescope automatically, it is usually more robust to measure the Half-Flux Diameter. See https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=9&ved=2ahUKEwig-9Ghi4jnAhUQShUIHXpOBbYQFjAIegQICBAB&url=http%3A%2F%2Fsolo.dc3.com%2Far%2FRefDocs%2FWeber-Brady_FocusMax.doc&usg=AOvVaw06Zs7KyEuiYuNxmcIlcu25 for more details of a solid algorithm for automated focusing. Measuring the HFD with photutils is possible; just perform photometry with a range of aperture sizes and use interpolation to find the aperture size that contains half the flux. However it’s easier with sep (a python port of sextractor) which has this functionality built in... bkg = sep.Background(data)
12:18:16@slack_astropy_U7NCAGGJV:openastronomy.orgStuart Littlefair
In reply to@slack_astropy_U7NCAGGJV:openastronomy.org
For focusing a telescope automatically, it is usually more robust to measure the Half-Flux Diameter. See https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=9&ved=2ahUKEwig-9Ghi4jnAhUQShUIHXpOBbYQFjAIegQICBAB&url=http%3A%2F%2Fsolo.dc3.com%2Far%2FRefDocs%2FWeber-Brady_FocusMax.doc&usg=AOvVaw06Zs7KyEuiYuNxmcIlcu25 for more details of a solid algorithm for automated focusing. Measuring the HFD with photutils is possible; just perform photometry with a range of aperture sizes and use interpolation to find the aperture size that contains half the flux. However it’s easier with sep (a python port of sextractor) which has this functionality built in... bkg = sep.Background(data)
bkg.subfrom(data) objev
12:21:04@slack_astropy_U7NCAGGJV:openastronomy.orgStuart Littlefair
In reply toundefined
sorry - keep hitting return by mistake - let's try again bkg = sep.Background(data) bkg.subfrom(data) objects = sep.extract(data, threshold_in_sigma, bkg.globalrms, clean=True) hfr, mask = sep.flux_radius(data, objects['x'], objects['y'], 40 np.ones_like(objects['x']), 0.5, normflux=objects['cflux']) hfd = 2 np.median(hfr[mask])
12:21:30@slack_astropy_U7NCAGGJV:openastronomy.orgStuart Littlefair
In reply toundefined
(edited) ... again ``` bkg = sep.Background(data) bkg.subfrom(data) objects = sep.extract(data, threshold_in_sigma, bkg.globalrms, clean=True) hfr, mask = sep.flux_radius(data, objects['x'], objects['y'], 40 * np.ones_like(objects['x']), 0.5, normflux=objects['cflux']) hfd = 2 * np.median(hfr[mask]) ``` => ... again `bkg = sep.Background(data) bkg.subfrom(data) objects = sep.extract(data, threshold_in_sigma, bkg.globalrms, clean=True) hfr, mask = sep.flux_radius(data, objects['x'], objects['y'], 40 * np.ones_like(objects['x']), 0.5, normflux=objects['cflux']) hfd = 2 * np.median(hfr[mask])`
15:20:01@slack_astropy_UE3AMRPL1:openastronomy.orgSimón
In reply to@slack_astropy_U7NCAGGJV:openastronomy.org
sorry - keep hitting return by mistake - let's try again bkg = sep.Background(data) bkg.subfrom(data) objects = sep.extract(data, threshold_in_sigma, bkg.globalrms, clean=True) hfr, mask = sep.flux_radius(data, objects['x'], objects['y'], 40 np.ones_like(objects['x']), 0.5, normflux=objects['cflux']) hfd = 2 np.median(hfr[mask])
I was recently discussing about having a focus calculator as part of an affiliated/coordinated package
15:20:21@slack_astropy_UE3AMRPL1:openastronomy.orgSimón
In reply to@slack_astropy_UE3AMRPL1:openastronomy.org
I was recently discussing about having a focus calculator as part of an affiliated/coordinated package
I have created this package https://github.com/soar-telescope/goodman_focus
15:21:29@slack_astropy_UE3AMRPL1:openastronomy.orgSimón
In reply to@slack_astropy_UE3AMRPL1:openastronomy.org
I have created this package https://github.com/soar-telescope/goodman_focus
which is relatively simple, though since the Goodman HTS is an Imaging Spectrograph, focus is calculated using the image of a slit, not stars in 2D
15:35:52@slack_astropy_U763FSX37:openastronomy.orgdshupe
In reply to@slack_astropy_USEH4N9FT:openastronomy.org
Hi. I am trying to align two images I downloaded from MAST HST portal. For this, I am using astropy-reproject package. However, I am running into an error, every time I use reproject, despite providing the WCS information. Following is the error:
ValueError: an astropy.io.fits.HDUList is required for Lookup table distortion.
I am using reproject version 0.6, and astropy both versions (3.2.3 and 4.0).
Information about the images: One image is from HST/WFC3 and second one is from HST/ACS.  
Here's the google drive link where my images and code are: https://drive.google.com/open?id=1SRZ9Evb1NgF_yJmQdLCw5soO929lT204
I’ve sent a reply to the Astropy mailing list. The key points are: 1. Construct input and output WCSs explicitly, passing HDULists as an additional argument so that the distortion information is properly picked up from the input FITS files. 2. When calling reproject_interp, pass as the first argument a tuple of (array, WCS) and specify the shape_out argument.
15:42:12@slack_astropy_UE3AMRPL1:openastronomy.orgSimón
In reply to@slack_astropy_UE3AMRPL1:openastronomy.org
which is relatively simple, though since the Goodman HTS is an Imaging Spectrograph, focus is calculated using the image of a slit, not stars in 2D
Stuart Littlefair very nice document!
15:57:04@slack_astropy_U763FSX37:openastronomy.orgdshupe
In reply to@slack_astropy_U763FSX37:openastronomy.org
I’ve sent a reply to the Astropy mailing list. The key points are: 1. Construct input and output WCSs explicitly, passing HDULists as an additional argument so that the distortion information is properly picked up from the input FITS files. 2. When calling reproject_interp, pass as the first argument a tuple of (array, WCS) and specify the shape_out argument.
Additionally, I think my email reply may have mixed up input and output — I’ll leave that to you to fix!
17:10:49@slack_astropy_U774ARTKR:openastronomy.orgpllim
In reply to@slack_astropy_U763FSX37:openastronomy.org
Additionally, I think my email reply may have mixed up input and output — I’ll leave that to you to fix!
Since you are using HST images, drizzlepac is the recommended package to align images. Please contact hsthelp.stsci.edu

There are no newer messages yet.


Back to Room List