GrandFather has asked for the wisdom of the Perl Monks concerning the following question:

I'm playing around with some code to parse FITS format files. My immediate interest is in accessing data in the Guide Star Catalog. Along the way I'm putting together a fairly useful pure Perl object oriented FITS parser which looks like it should really be contributed to CPAN, but where does it FITS?

The obvious name space is Astro::FITS. But it is less obvious, to me at least, what this parserish code should be called. As a working title I'm using Astro::FITS::Parser, but maybe it should advertise that it is pure Perl with the speed disadvantages that implies in a context where speed is often important? Maybe too it should advertise that it is OO? Astro::FITS::ParserPPOO looks too ugly (and maybe rude too) for words. And in any case it does more than simply parsing the file - it provides access to the data in the file. Any better ideas for names and/or name spaces?

When it's ready to be rolled out the GSC module is likely to end up as Astro::GSC or Astro::FITS::GSC. Comments?

True laziness is hard work

Replies are listed 'Best First'.
Re: Where does it FITS?
by almut (Canon) on Jun 24, 2010 at 11:57 UTC
    but maybe it should advertise that it is pure Perl

    Personally, as you're the first to populate that namspace, I would say simply leave it at Astro::FITS::Parser (or maybe Astro::FITS::Parse), and not put something like PP in the name.  If anyone later comes up with a C implementation, they can always add ::XS to the name of their variant.  I don't think there's any clear CPAN convention whether to indicate the type of module with PP or XS (there are both variants to be found).  Just mentioning in the docs that it is pure Perl should be sufficient, IMHO.

    As for whether to use Astro::FITS::GSC vs. Astro::GSC::FITS, I think it depends on the semantic relation of GSC and FITS.  If FITS is just one GSC format among others, I would suggest putting the GSC first, while if FITS may also store other data, using FITS::GSC might be more appropriate  (I'm no expert in the field, so I can't tell...)

Re: Where does it FITS?
by dHarry (Abbot) on Jun 24, 2010 at 15:57 UTC

    The obvious name is...

    I would like to see a more generic name. The Astro part might lead people to think it's an astronomy specific thing which it is not. We are using the FITS format (among other formats like PDS) for planetary data products. FITS is, after all, just another data format. Maybe AnyData::Format::FITS?

    Cheers

    Harry

    PS I'm sure you've looked around/are aware of it, but I'm going to mention it anyway: There are already perl modules available to parse FITS files, like the wrapper of the CFITSIO lib and the PDL FITS reader (See fits libraries).

      Isn't 'planetary' stuff astronomy related? Certainly the first area in CPAN I'd think of looking would be in Astro. Putting it in the AnyData name space implies using the AnyData interface which could work, but isn't a particularly good match.

      Indeed I have looked around. FITS is complicated enough that that it's not a wheel you'd want to reinvent for preference. However both the modules you allude to sit on top of the CFITSIO lib and I was looking for a pure Perl solution. Besides, I was a bit bothered by the CPAN test results for Astro::FITS::CFITSIO!

      True laziness is hard work
        Besides, I was a bit bothered by the CPAN test results for Astro::FITS::CFITSIO!

        Report summary is PASS (5) FAIL (51) UNKNOWN (127) but it should be PASS (5) FAIL(0) UNKNOWN (178)

Re: Where does it FITS?
by andreas1234567 (Vicar) on Jun 24, 2010 at 20:05 UTC
    How about Parse::FITS?
    --
    No matter how great and destructive your problems may seem now, remember, you've probably only seen the tip of them. [1]