<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
I was going to chime in similar to Adam wrt this. Surely the best approach is to fix the broken code which does not do case independent matching? 
<div><br>
</div>
<div>Do we *really* want At and AT treated as separate antenna codes? </div>
<div><br>
</div>
<div>Cheers</div>
<div>Chris<br id="lineBreakAtBeginningOfMessage">
<div><br>
<blockquote type="cite">
<div>On 14 Feb 2024, at 09:34, Adam Deller via Difx-users <difx-users@listmgr.nrao.edu> wrote:</div>
<br class="Apple-interchange-newline">
<div>
<div dir="ltr">
<div>I will wait for someone more knowledgeable to chime in on the case convention of the two letter station codes generally, but I did just want to note that I believe that the station names are treated in a case independent manner by DiFX (specifically, by
 vex2difx, which writes the DiFX input fileset based on the original vex file: see "All parameter names and values are case sensitive except for source names and antenna names" in the vex2difx documentation on
<a href="https://www.atnf.csiro.au/vlbi/dokuwiki/doku.php/difx/vex2difx">https://www.atnf.csiro.au/vlbi/dokuwiki/doku.php/difx/vex2difx</a>). </div>
<div><br>
</div>
<div>So I suspect there is a mismatch between some parts of the codebase being case insensitive (and having looked at
<a href="https://github.com/difx/difx/blob/main/applications/vex2difx/vexdatamodel/vexload.cpp#L465">
https://github.com/difx/difx/blob/main/applications/vex2difx/vexdatamodel/vexload.cpp#L465</a>, I suspect this is what is happening, although I will note that you have both the station code and the antenna name in vex and I haven't carefully checked to see
 which one is being upper-cased here) and other downstream stuff in vex2mark4 which expects case to be respected.</div>
<div><br>
</div>
<div>Cheers,</div>
<div>Adam<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, 14 Feb 2024 at 05:09, Leonid Petrov via Difx-users <<a href="mailto:difx-users@listmgr.nrao.edu">difx-users@listmgr.nrao.edu</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">
Dear colleagues,<br>
<br>
   Can you clarify, is there a convention on a case of two-letter station <br>
codes:<br>
gs, GS, or Gs?<br>
<br>
Leonid<br>
<br>
> On 2024-02-13 11:56, John Barrett via Difx-users wrote:<br>
> Hi Alexey,<br>
> <br>
> I'm not entirely sure why the lowercase convention was enforced<br>
> originally.  It is possibly due to the fact that DiFX takes all<br>
> 2-letter codes and capitalizes them (e.g. Wf becomes WF) in the input<br>
> file?<br>
> So while your patch works for this particular case (JL (vex)-> JL<br>
> (difx) -> JL (mk4)) it changes the convention used by most other sites<br>
> where it is assumed (Wf (vex) -> WF (difx) -> Wf (mk4) ), and will<br>
> break<br>
> the ovex/root file that is generate (e.g. $FREQ section will no longer<br>
> map to the proper station codes). The vex 'parser' (and I used that<br>
> word very lightly) in difx2mark4 is extremely primitive and<br>
> effectively is just looking for entire sections of the vex file to cut<br>
> and paste into the ovex/root file, so it is not sophisticated enough<br>
> to figure out all of the instances of a station 2-character code and<br>
> 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" rel="noreferrer" target="_blank">
https://github.com/jpbarrett/difx.git</a><br>
> <br>
> and added a patch which will introduce the behavior you want for just<br>
> the stations specified on the command line (the default behavior will<br>
> 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<br>
> -v ./h_1000.difx<br>
> <br>
> And pass the station codes you want to preserve as all upper case,<br>
> 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>
>       Did not lower case-ify the station code: GS<br>
>       Did not lower case-ify the station code: WF<br>
>       processing $STATION block<br>
>       processing $ANTENNA block<br>
> <br>
> And the output ovex/root file "should" preserve the station code cases<br>
> in the output.<br>
> <br>
> I actually don't have any data which has station codes which are all<br>
> upper case, so I can't tell if this works properly for your situation<br>
> or not. If you get a chance, can you clone and compile this version of<br>
> difx2mak4 and let me know if it works for the "JL" station situation?<br>
> If it does, I will put in a pull request for this change to merge it<br>
> to the dev branch.<br>
> <br>
> I will also note, that if the -c code is erroneously applied to a<br>
> station which in fact has a upper-lower case code in the vex file,<br>
> then you will end up with a broken ovex/root file and fourfit will<br>
> 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<br>
> '/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<br>
> file ./8899/105-1800/, skipping<br>
> <br>
> Let me know how it goes,<br>
> <br>
> Best,<br>
> <br>
> John<br>
> <br>
> On 2/12/24 5:56 PM, Geoffrey B. Crew wrote:<br>
> <br>
>> John (in CC) was looking at the issue, and as you've discovered,<br>
>> it's not quite as trivial as you thought.<br>
>> <br>
>> My recollection is that it is in fact a "standard" that two-letter<br>
>> codes have this camel case (first letter upper and second lower)<br>
>> convention, but I don't know how strict that is. Clearly the<br>
>> difx2mark4 code is trying to be correct here.<br>
>> <br>
>> A confusing issue (to me anyway) is that the vex2difx process seems<br>
>> to elevate both to uppercase which I suspect is for historical<br>
>> reasons (rather than an optimal design choice).<br>
>> <br>
>> Anyway, if you can modify your vex to use 'Jl' rather than 'JL' you<br>
>> should have no issues.<br>
>> <br>
>> On 2/12/24 17:29, Alexey Melnikov via Difx-users wrote:<br>
>> Dear all,<br>
>> <br>
>> I need to withdraw my patch (it broke other cases) and ask for<br>
>> advise. In<br>
>> DiFX *.input files all 2-symbol station names are converted to<br>
>> capitals<br>
>> dispite how they were written in *.vex.<br>
>> <br>
>> In my particular case, difx2mark4 fails since I have station named<br>
>> in capitals<br>
>> in vex, like 'JL'. So after line of code patched in my patch in<br>
>> 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<br>
>> station names<br>
>> in capitals when executing difx2mark4? Of course, another solution<br>
>> is to keep<br>
>> 2-symbol station names in sched's station.dat file as 'Jl', not<br>
>> 'JL'.<br>
>> <br>
>> regards,<br>
>> Alexey<br>
>> <br>
>> On 20240212 17:57:56, Adam Deller via Difx-users wrote:<br>
>> Thanks, Alexey.<br>
>> <br>
>> Hopefully someone from Haystack (Geoff, John?) could take a look at<br>
>> this<br>
>> and merge if happy? We should aim to get a new release off the git<br>
>> repo in<br>
>> the not too distant future, as the number of small bugs fixed is<br>
>> 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 href="mailto:difx-users@listmgr.nrao.edu" target="_blank">difx-users@listmgr.nrao.edu</a>> wrote:<br>
>> <br>
>> Dear DiFX community,<br>
>> <br>
>> A few days ago I got an annoying bug in the difx2mark4. In my case I<br>
>> have<br>
>> station in the vex file with 2-symbol code in capitals (say 'JL'),<br>
>> after<br>
>> correlation I have run difx2mark4 and got an error in the root file<br>
>> for<br>
>> this<br>
>> station. In occures that somebody converts 2-nd symbol of station<br>
>> name to<br>
>> lower case, what cause problem of different tags in the ovex file.<br>
>> 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<br>
>> codebase? All<br>
>> latest master_tag versions are affected, but there is only single<br>
>> 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>
>> Please avoid sending me Word or PowerPoint attachments.<br>
>> See <a href="http://www.gnu.org/philosophy/no-word-attachments.html" rel="noreferrer" target="_blank">
http://www.gnu.org/philosophy/no-word-attachments.html</a><br>
>> _______________________________________________<br>
>> Difx-users mailing list<br>
>> <a href="mailto:Difx-users@listmgr.nrao.edu" target="_blank">Difx-users@listmgr.nrao.edu</a><br>
>> <a href="https://listmgr.nrao.edu/mailman/listinfo/difx-users" rel="noreferrer" target="_blank">
https://listmgr.nrao.edu/mailman/listinfo/difx-users</a><br>
>> <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 href="mailto:Difx-users@listmgr.nrao.edu" target="_blank">Difx-users@listmgr.nrao.edu</a><br>
>> <a href="https://listmgr.nrao.edu/mailman/listinfo/difx-users" rel="noreferrer" target="_blank">
https://listmgr.nrao.edu/mailman/listinfo/difx-users</a><br>
> _______________________________________________<br>
> Difx-users mailing list<br>
> <a href="mailto:Difx-users@listmgr.nrao.edu" target="_blank">Difx-users@listmgr.nrao.edu</a><br>
> <a href="https://listmgr.nrao.edu/mailman/listinfo/difx-users" rel="noreferrer" target="_blank">
https://listmgr.nrao.edu/mailman/listinfo/difx-users</a><br>
<br>
_______________________________________________<br>
Difx-users mailing list<br>
<a href="mailto:Difx-users@listmgr.nrao.edu" target="_blank">Difx-users@listmgr.nrao.edu</a><br>
<a href="https://listmgr.nrao.edu/mailman/listinfo/difx-users" rel="noreferrer" target="_blank">https://listmgr.nrao.edu/mailman/listinfo/difx-users</a><br>
</blockquote>
</div>
<br clear="all">
<br>
<span class="gmail_signature_prefix">-- </span><br>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr" style="font-size:12.8px">
<div dir="ltr" style="font-size:12.8px">
<div dir="ltr" style="font-size:12.8px">
<div dir="ltr" style="font-size:12.8px">
<div dir="ltr" style="font-size:12.8px">
<div dir="ltr" style="font-size:12.8px">!=============================================================!<br>
<div dir="ltr" style="font-size:12.8px">Prof. Adam Deller         </div>
</div>
<div style="font-size:12.8px">Centre for Astrophysics & Supercomputing </div>
<div dir="ltr" style="font-size:12.8px">Swinburne University of Technology    <br>
John St, Hawthorn VIC 3122 Australia</div>
<div style="font-size:12.8px">phone: +61 3 9214 5307</div>
<div style="font-size:12.8px">fax: +61 3 9214 8797</div>
<div style="font-size:12.8px">!=============================================================!</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
_______________________________________________<br>
Difx-users mailing list<br>
Difx-users@listmgr.nrao.edu<br>
https://listmgr.nrao.edu/mailman/listinfo/difx-users<br>
</div>
</blockquote>
</div>
<br>
</div>
</body>
</html>