[AstroPy] Need Help about Astropy.table.Table.write

Michael Droettboom mdroe at stsci.edu
Thu Jul 31 09:51:33 EDT 2014


On 07/29/2014 05:43 PM, Derek Homeier wrote:

> On 29 Jul 2014, at 09:39 pm, Phil Hodge <hodge at stsci.edu> wrote:
>
>>> Meet Anders Jonas Ångström:http://en.wikipedia.org/wiki/Anders_Jonas_%C3%85ngstr%C3%B6m
>> It's the abbreviation, not the full unit name, that begins with (or is)
>> an upper case letter if the unit is named for a person.
> As with newton or kelvin… But that leads a bit astray from the original problem.
> I certainly think capitalisation variants should be tolerated,

The problem is that capitalization is meaningful in units. mm vs. Mm is 
an obvious one.

>   and specifically for
> FITS I wonder if it even makes sense to raise a warning, as I have hardly seen
> any real life FITS header that was not FORTRAN 6-style fully capitalised.
> The example I gave was about angstroms, which is arguably poor language and
> even unnecessarily creates a >8 character keyword, and ‘units’ like ‘FLAM’ which
> are of course of relatively limited use.
> My original point was if/why one could not offer similar suggestions for correct units
> in the case of ‘ct’ instead of ‘counts’, but as Erik has clarified these suggestions are
> simply heuristic guesses from utils.misc.did_you_mean.
> Therefore it could not come up with a useful replacement for FLAM (and even a
> truly smart algorithm or complete lexicographic database would have no way to
> tell whether to suggest erg/s/cm**2/A, erg/s/cm**2/cm, W/m**2/um…

I’m not opposed to extending |did_you_mean| to include some hard-coded 
suggestions in addition to the current algorithm which is just based on 
string edit distance.

If someone was willing to develop the mapping itself, I’m happy to work 
on the implementation.

> An interesting note btw. is that angstrom or Angstrom are listed in units.format.fits among
> deprecated_units; however Fits is initialising its ._units from the union of units and deprecated_units,
> and the ._deprecated_units from the union of deprecated_names and deprecated_units.
> That’s why angstrom is even suggested as a replacement; not sure about the exact logic
> behind this.

I’ll look into this. That logic may be broken.

Mike

> Cheers,
> 						Derek
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy

-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute

http://www.droettboom.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20140731/b2d57d97/attachment.html>


More information about the AstroPy mailing list