<div dir="ltr">Julia has Unitful and its associated packages such as UnitfulAstro that handle units and their mathematical behaviour, so this is not an implementation problem. However, it does not yet include the units of photon, count, beam, etc., because they are dimensionless units. I will have to add them.<div><br></div><div>These units are analogous to angular units, such as radians and degrees. However, in this case, their relationship and behaviour are well understood, so one can convert between radians and degrees and their associated units without problems.</div><div><br></div><div>I must disagree that my question is beyond the FITS specification. Good software design provides use cases that are used to inform and define the specification. They help to illuminate corner cases that the software needs to properly handle. Otherwise, the software will produce nonsense in these situations. So I am basically asking a use case question and how it informs and defines the FITS specification.</div><div><br></div><div> -- Paul</div><div><br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, Jun 6, 2025 at 10:51 AM Tiago Gomes <<a href="mailto:tiagogomes@fe.up.pt">tiagogomes@fe.up.pt</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>

  
    
  
  <div>
    <p>Hi Paul,</p>
    <p>I'm not part of the FITS team in any way, so these are just my
      two cents, take it for what it is. However, I've worked quite a
      bit with FITS and units, so I may have some insight.</p>
    <ul>
      <li>As I understand it, the specification itself does not attempt
        to specify any sort of behavior for operations between units, it
        merely defines how unit information should be stored. So, I
        would say that your question is actually completely outside
        what's covered by the specification and thus you likely won't
        have any sort of "officially correct" way of handling it. I'd
        say this is a layer above FITS, outside of what FITS itself
        actually cares about. As long as you can handle reading/writing
        the units specified in the specification, I would say you are
        completely within spec, so operations between units are just
        added convenience you are providing to your users.<br>
      </li>
      <li>If you are looking for implementation inspiration you may take
        a look at how Astropy handles units (look up "Astropy
        Quantity"). You can play around with units and you'll see it
        mostly makes sense. In their implementation, if you have 5
        photons and divide by 2 counts you have... 2.5 photons / count.
        If you have 3 counts and multiply by 3 counts, you have 9
        count^2. Do "photons / count" or "count^2" actually <i>mean</i>
        anything? I don't know, but I'd say you actually shouldn't care!
        That's for the user to decide. In short, my opinion is that if
        you have SI units and you know what to do with their operations,
        then do it; otherwise, just make it an explicit operation, and
        it's up to the user to decide how to interpret it.<br>
      </li>
    </ul>
    <p>Hope that was useful in any way. Best of luck with your package.</p>
    <p>Cheers,</p>
    <p>Tiago<br>
    </p>
    <div>On 2025-06-06 14:50, Barrett, Paul via
      fitsbits wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div dir="ltr">I am adding unit support to the Julia FITS
          package FITSFiles.jl. Table 4 of the FITS specification (aka
          standard) lists several nonphysical units, such as <i>pixel,
            voxel, photon, count, beam,</i> etc. The relationship and
          usage of physical units is well known and understood, but this
          does not appear to be the case for nonphysical units. For
          example, is a <i>photon</i> equivalent to a <i>count</i> ? In
          other words, if I divide a <i>count</i> by a <i>photon</i>,
          is that unitless? And what does <i>count^2</i> mean? Can
          anyone explain this or should I just ignore it?
          <div><br>
          </div>
          <div> - Paul</div>
        </div>
        <div><br>
        </div>
        <span class="gmail_signature_prefix">-- </span><br>
        <div dir="ltr" class="gmail_signature">
          <div dir="ltr">Paul Barrett, PhD
            <div>Department of Physics</div>
            <div>The George Washington University</div>
            <div>Washington, DC 20052</div>
            <div><br>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <pre>_______________________________________________
fitsbits mailing list
<a href="mailto:fitsbits@listmgr.nrao.edu" target="_blank">fitsbits@listmgr.nrao.edu</a>
<a href="https://listmgr.nrao.edu/mailman/listinfo/fitsbits" target="_blank">https://listmgr.nrao.edu/mailman/listinfo/fitsbits</a>
</pre>
    </blockquote>
  </div>

</blockquote></div>