Menu

#461 psrinfo

next release
closed
None
5
2022-05-18
2022-04-22
Wael Farah
No

I installed psrchive using conda, following the installation guide, and I saw no errors during installation.

When I try running dspsr, however, I am getting the following:

(base) sonata@obs-node1:/mnt/buf0$ dspsr -v -L 20 -Lmin 15 coherent.fil
sh: 1: psrinfo: not found

Error::stack
    Pulsar::Parameters::Lookup::operator()
    Pulsar::Parameters::Lookup::operator()system (psrinfo -e 0332+5434)
Error::FailedSys

If I recall correctly, this happens because psrchive can't find psrcat (and thus is falls back to the old psrinfo). Am I missing setting an environment variable (I tried $PSRCAT, $PSRCAT_DIR, $PSRCAT_FILE, and non seemed to work)? Or this is a compile time issue (which I probably can't fix on my machine given that I'm installing via conda)?

Discussion

  • Paul Demorest

    Paul Demorest - 2022-04-22

    hi Wael, yes it looks like there is a compile-time setting needed for psrcat. We might be able to fix this in a future conda build. Until then you could just provide a parfile on the command line via -E instead of using the automatic psrcat lookup. Or, since psrinfo is the fallback you could probably make a script named "psrinfo" that calls psrcat appropriately..

     
  • Wael Farah

    Wael Farah - 2022-04-22

    Thanks Paul. I'm not extremely familiar with the intricacies of psrchive/dspsr, but what is the typical equivalent call to psrcat look like? Is it simply psrcat -E JNAME > pulsar.par. I'm thinking a psrinfo script that looks like:

    #!/bin/bash
    
    psrcat $@
    

    should do the trick?

     
  • Wael Farah

    Wael Farah - 2022-04-22

    or maybe an alias can work

     
  • Willem van Straten

    Hi Wael,

    The relevant bit of code is

    #ifdef HAVE_PSRCAT
    
      string catalogue = "psrcat";
      string command = catalogue;
    
      if (getenv("PSRCAT_RUNDIR") != 0)
        command += " -all ";
    
      command += " -e " + psr_name + " > " + psr_name + ".eph";
    
    #else
    
      string command = "psrinfo -e " + psr_name;
      string catalogue = "psrinfo";
    
    #endif
    

    so I think you'll want your script to do

    #!/bin/bash
    
    psr=$2
    all=""
    
    if [[ ! -z "${PSRCAT_RUNDIR}" ]]; then
      all="-all"
    fi
    
    psrcat $all -e $psr > ${psr}.eph
    
     
  • Willem van Straten

    • status: open --> closed
    • assigned_to: Willem van Straten
     
  • Willem van Straten

    I've just committed a fix for this bug, such that availability of psrcat is determined by checking the PSRCAT_FILE environment variable at runtime.

    [master d4f3fa896] bugs:#461 determine if psrcat is available at runtime, not compile time

     
  • Wael Farah

    Wael Farah - 2022-04-25

    Hi @straten,
    The script would not work because of the get_param call.
    I just saw that in the fix, thanks for implementing it!

    Should I wait for it to be available on source-forge, or should I go ahead with a manual compilation?

     
  • Wael Farah

    Wael Farah - 2022-04-25

    Sorry I meant conda-forge*

     
  • Wael Farah

    Wael Farah - 2022-05-17

    Hi @demorest @straten, apologies to revive this thread, but do you think I should compile psrchive (and all its dependencies) from source? I was pretty thrilled that psrchive is now included as a conda package which makes it easy for users to install/use.

    I'm also happy to help with testing any beta versions here on our cluster if you would like.

    Thanks again!

     
  • Paul Demorest

    Paul Demorest - 2022-05-17

    Hi Wael, I can generate a new release (and conda package) in the next couple days. Willem do you have anything else you're working on that you'd like to get in first?

    We don't have a specific release schedule but tend to do them every few months. I agree conda install is much easier to deal with, but if you want new features or bug fixes on a quicker timescale you could consider building from source.

     
  • Willem van Straten

    Hi Paul, I don't have anything urgent that I'd like to commit first. Thanks for asking!

     
  • Wael Farah

    Wael Farah - 2022-05-17

    Thanks Paul, Willem, I really appreciate this.

     
  • Paul Demorest

    Paul Demorest - 2022-05-18

    OK, a new psrchive release (2022.05.14) is now available on conda-forge.

     
  • Willem van Straten

    Thanks for that, Paul!

     

Log in to post a comment.

MongoDB Logo MongoDB