<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Hi Alexey,<br>
    <br>
    I'm not entirely sure why the lowercase convention was enforced
    originally.  It is possibly due to the fact that DiFX takes all
    2-letter codes and capitalizes them (e.g. Wf becomes WF) in the
    input file?<br>
    So while your patch works for this particular case (JL (vex)-> JL
    (difx) -> JL (mk4)) it changes the convention used by most other
    sites where it is assumed (Wf (vex) -> WF (difx) -> Wf (mk4)
    ), and will break<br>
    the ovex/root file that is generate (e.g. $FREQ section will no
    longer map to the proper station codes). The vex 'parser' (and I
    used that word very lightly) in difx2mark4 is extremely primitive
    and effectively is just looking for entire sections of the vex file
    to cut and paste into the ovex/root file, so it is not sophisticated
    enough to figure out all of the instances of a station 2-character
    code and replace them with what the user may actually desire.<br>
    <br>
    I have forked the difx-dev branch here:<br>
    <br>
    <a href="https://github.com/jpbarrett/difx.git"
      class="moz-txt-link-freetext">https://github.com/jpbarrett/difx.git</a><br>
    <br>
    and added a patch which will introduce the behavior you want for
    just the stations specified on the command line (the default
    behavior will remain as it is now), using a new option "-c" or
    "--case-keep".  <br>
    <br>
    So for example if you run:<br>
    <br>
    difx2mark4 -c GS -c WF -b X 0 10000000 -s ./station.codes -e 8899 -o
    -v ./h_1000.difx<br>
    <br>
    And pass the station codes you want to preserve as all upper case,
    with the "-c" option, you will see a message to the effect of:<br>
    <br>
       processing $GLOBAL block<br>
          processing $EXPER block<br>
          processing $MODE block<br>
    <b>      Did not lower case-ify the station code: GS <br>
            Did not lower case-ify the station code: WF </b><br>
          processing $STATION block<br>
          processing $ANTENNA block<br>
    <br>
    And the output ovex/root file "should" preserve the station code
    cases in the output.<br>
    <br>
    I actually don't have any data which has station codes which are all
    upper case, so I can't tell if this works properly for your
    situation or not. If you get a chance, can you clone and compile
    this version of difx2mak4 and let me know if it works for the "JL"
    station situation? If it does, I will put in a pull request for this
    change to merge it to the dev branch.<br>
    <br>
    I will also note, that if the -c code is erroneously applied to a
    station which in fact has a upper-lower case code in the vex file,
    then you will end up with a broken ovex/root file and fourfit will
    refuse to run on it as follows:<br>
    <br>
    fourfit -c ./cf_3686_GEHSVY_pstokes2  -b GE -P XX ./8899/105-1800/<br>
    fourfit: missing FREQ section for station G<br>
    fourfit: Error filling in station parameters<br>
    fourfit: Failure parsing observe vex portion of
'/home/barrettj/work/projects/hops-git/build/test_data/vt9105/8899/105-1800//0016+731.341E5I'<br>
    fourfit: The above errors occurred while processing<br>
    fourfit: ./8899/105-1800//0016+731.341E5I<br>
    fourfit: the top-level resolution is as follows:Error reading root
    for file ./8899/105-1800/, skipping<br>
    <br>
    Let me know how it goes,<br>
    <br>
    Best,<br>
    <br>
    John<br>
    <br>
    <div class="moz-cite-prefix">On 2/12/24 5:56 PM, Geoffrey B. Crew
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:3014dcaa-c1ca-478e-b910-6a8f0823a786@mit.edu">John (in
      CC) was looking at the issue, and as you've discovered, it's not
      quite as trivial as you thought.
      <br>
      <br>
      My recollection is that it is in fact a "standard" that two-letter
      codes have this camel case (first letter upper and second lower)
      convention, but I don't know how strict that is. Clearly the
      difx2mark4 code is trying to be correct here.
      <br>
      <br>
      A confusing issue (to me anyway) is that the vex2difx process
      seems to elevate both to uppercase which I suspect is for
      historical reasons (rather than an optimal design choice).
      <br>
      <br>
      Anyway, if you can modify your vex to use 'Jl' rather than 'JL'
      you should have no issues.
      <br>
      <br>
      On 2/12/24 17:29, Alexey Melnikov via Difx-users wrote:
      <br>
      <blockquote type="cite">Dear all,
        <br>
        <br>
        I need to withdraw my patch (it broke other cases) and ask for
        advise. In
        <br>
        DiFX *.input files all 2-symbol station names are converted to
        capitals
        <br>
        dispite how they were written in *.vex.
        <br>
        <br>
        In my particular case, difx2mark4 fails since I have station
        named in capitals
        <br>
        in vex, like 'JL'. So after line of code patched in my patch in
        turns out to
        <br>
        'Jl' and ovex file become wrong.
        <br>
        <br>
        Does it mean that the better solution would be to keep 2-symbol
        station names
        <br>
        in capitals when executing difx2mark4? Of course, another
        solution is to keep
        <br>
        2-symbol station names in sched's station.dat file as 'Jl', not
        'JL'.
        <br>
        <br>
        regards,
        <br>
        Alexey
        <br>
        <br>
        <br>
        <br>
        On 20240212 17:57:56, Adam Deller via Difx-users wrote:
        <br>
        <blockquote type="cite">Thanks, Alexey.
          <br>
          <br>
          Hopefully someone from Haystack (Geoff, John?) could take a
          look at this
          <br>
          and merge if happy? We should aim to get a new release off the
          git repo in
          <br>
          the not too distant future, as the number of small bugs fixed
          is starting
          <br>
          to stack up.
          <br>
          <br>
          Cheers,
          <br>
          Adam
          <br>
          <br>
          On Mon, 12 Feb 2024 at 11:57, Alexey Melnikov via Difx-users
          <
          <br>
          <a class="moz-txt-link-abbreviated" href="mailto:difx-users@listmgr.nrao.edu">difx-users@listmgr.nrao.edu</a>> wrote:
          <br>
          <br>
          <blockquote type="cite">Dear DiFX community,
            <br>
            <br>
            A few days ago I got an annoying bug in the difx2mark4. In
            my case I have
            <br>
            station in the vex file with 2-symbol code in capitals (say
            'JL'), after
            <br>
            correlation I have run difx2mark4 and got an error in the
            root file for
            <br>
            this
            <br>
            station. In occures that somebody converts 2-nd symbol of
            station name to
            <br>
            lower case, what cause problem of different tags in the ovex
            file. Patch
            <br>
            file
            <br>
            and the path to that file in difx2mark4 source code are
            attached.
            <br>
            <br>
            Can somebody help to review patch and incorporate it to the
            codebase? All
            <br>
            latest master_tag versions are affected, but there is only
            single release
            <br>
            in
            <br>
            git, so, I think I need somebody who knows what to do.
            <br>
            <br>
            regards,
            <br>
            Alexey
            <br>
            <br>
            --
            <br>
            Best regards,
            <br>
            Alexey Melnikov, Scientific Researcher
            <br>
            Laboratory of Radio Astronomy Observations
            <br>
            The Institute of Applied Astronomy RAS
            <br>
            St.-Petersburg, Russia, tel. +7 (812) 2751106
            <br>
            <br>
            <br>
            Please avoid sending me Word or PowerPoint attachments.
            <br>
            See <a class="moz-txt-link-freetext" href="http://www.gnu.org/philosophy/no-word-attachments.html">http://www.gnu.org/philosophy/no-word-attachments.html</a>
            <br>
            _______________________________________________
            <br>
            Difx-users mailing list
            <br>
            <a class="moz-txt-link-abbreviated" href="mailto:Difx-users@listmgr.nrao.edu">Difx-users@listmgr.nrao.edu</a>
            <br>
            <a class="moz-txt-link-freetext" href="https://listmgr.nrao.edu/mailman/listinfo/difx-users">https://listmgr.nrao.edu/mailman/listinfo/difx-users</a>
            <br>
            <br>
          </blockquote>
          <br>
          -- <br>
!=============================================================!
          <br>
          Prof. Adam Deller
          <br>
          Centre for Astrophysics & Supercomputing
          <br>
          Swinburne University of Technology
          <br>
          John St, Hawthorn VIC 3122 Australia
          <br>
          phone: +61 3 9214 5307
          <br>
          fax: +61 3 9214 8797
          <br>
!=============================================================!
          <br>
          _______________________________________________
          <br>
          Difx-users mailing list
          <br>
          <a class="moz-txt-link-abbreviated" href="mailto:Difx-users@listmgr.nrao.edu">Difx-users@listmgr.nrao.edu</a>
          <br>
          <a class="moz-txt-link-freetext" href="https://listmgr.nrao.edu/mailman/listinfo/difx-users">https://listmgr.nrao.edu/mailman/listinfo/difx-users</a>
          <br>
        </blockquote>
        <br>
      </blockquote>
    </blockquote>
    <br>
  </body>
</html>