Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Subtract images in batch process(leap year and regular year)  (Read 27900 times)

0 Members and 1 Guest are viewing this topic.

Geek-9pm


    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: Subtract images in batch process(leap year and regular year)
« Reply #60 on: January 14, 2015, 09:29:09 AM »
How did you launch this batch file?
I often see people pasting batch code into the cmd prompt these days - it makes me weep. ;)
Is gdal_calculate a batch file too?
It is a Python  script.
https://pypi.python.org/pypi/gdal-calculations
Quote
Author: Luke Pinner
Home Page: https://code.google.com/p/gdal-calculations
Download URL: https://bintray.com/lukepinnerau/generic/gdal-calculations/_latestVersion
License: MIT
Requires numpy, gdal

Squashman



    Specialist
  • Thanked: 134
  • Experience: Experienced
  • OS: Other
Re: Subtract images in batch process(leap year and regular year)
« Reply #61 on: January 14, 2015, 09:46:44 AM »
I think what Foxidrive is inferring is that you can't name the batch file the same as the gdal_calculate command.

foxidrive



    Specialist
  • Thanked: 268
  • Experience: Experienced
  • OS: Windows 8
Re: Subtract images in batch process(leap year and regular year)
« Reply #62 on: January 15, 2015, 02:14:32 AM »
I wasn't very clear, sorry.

This error message from unknown's post is something that may be related to pasting batch code into a cmd prompt.

Invalid attempt to call batch label outside of batch script.


It is a Python  script.
https://pypi.python.org/pypi/gdal-calculations

Thanks, that clarifies that it's not part of that problem.

_unknown_

    Topic Starter


    Beginner

    • Experience: Beginner
    • OS: Windows 7
    Re: Subtract images in batch process(leap year and regular year)
    « Reply #63 on: January 17, 2015, 02:38:21 AM »
    How did you launch this batch file?

    I often see people pasting batch code into the cmd prompt these days - it makes me weep. ;)

    Is gdal_calculate a batch file too?


    Pasted it into an editor and then saved it as sample.bat in the desktop and call the bat file there from the cmd prompt or sometimes from the windows powershell. Is batch strict with white spaces? Is that why I'm getting this error?

    foxidrive



      Specialist
    • Thanked: 268
    • Experience: Experienced
    • OS: Windows 8
    Re: Subtract images in batch process(leap year and regular year)
    « Reply #64 on: January 17, 2015, 05:27:48 AM »
    I predict 6 pages for this Topic...

    Getting closer!

    Pasted it into an editor and then saved it as sample.bat in the desktop and call the bat file there from the cmd prompt or sometimes from the windows powershell. Is batch strict with white spaces? Is that why I'm getting this error?

    Batch code handles white space well in most of it, but not well at all in other places.

    Did you ever say where the files were located?  Are they on your desktop?

    The fact that you add powershell into this thread (for the first time AFAIK) just insults everyone who has replied,
    because you are doing things that you haven't revealed.

    If you had to pay for this support then the person getting your munny would need to know every single detail about the files, locations, hard drives or network drives, how they were processed, have copies of the files to test, and know how they were being launched.

    They would need access to the machine involved, or a copy of the data trees.

    Here we only know what you choose to tell us - and without the information it's like baking a pie with no recipe.
    « Last Edit: January 17, 2015, 05:49:14 AM by foxidrive »

    foxidrive



      Specialist
    • Thanked: 268
    • Experience: Experienced
    • OS: Windows 8
    Re: Subtract images in batch process(leap year and regular year)
    « Reply #65 on: January 17, 2015, 08:49:02 AM »
    I did get a bit annoyed, didn't I?

    patio

    • Moderator


    • Genius
    • Maud' Dib
    • Thanked: 1769
      • Yes
    • Experience: Beginner
    • OS: Windows 7
    Re: Subtract images in batch process(leap year and regular year)
    « Reply #66 on: January 17, 2015, 09:27:46 AM »
    It's all good...
    " Anyone who goes to a psychiatrist should have his head examined. "

    Squashman



      Specialist
    • Thanked: 134
    • Experience: Experienced
    • OS: Other
    Re: Subtract images in batch process(leap year and regular year)
    « Reply #67 on: January 17, 2015, 10:50:23 AM »
    Here is what I propose.
    1) Tell us where to download the software you use and tell us how to install and configure it.
    2) Post a full compliment of test files that will handle every scenario on dropbox for us to test with.
    3) Explain in exact detail what folder you have your input files in.
    4) Explain in exact detail what folder the output files need to go into.
    5) Explain in exact detail what folder the processed files need to go into.
    6) Explain in exact detail how the program works for processing just a single file. Use one of the test files you provided as an example.
    7) Explain in exact detail what your expected output should be based on the test files you have provided us.

    If anyone else feels I have left anything out for this testing scenario please add to the list.

    _unknown_

      Topic Starter


      Beginner

      • Experience: Beginner
      • OS: Windows 7
      Re: Subtract images in batch process(leap year and regular year)
      « Reply #68 on: January 18, 2015, 03:49:26 AM »
      Getting closer!

      Batch code handles white space well in most of it, but not well at all in other places.

      Did you ever say where the files were located?  Are they on your desktop?

      The fact that you add powershell into this thread (for the first time AFAIK) just insults everyone who has replied,
      because you are doing things that you haven't revealed.


      I just answered based from what I understand in your question. Guessed I didn't get it. Sorry for insulting you I'm just getting a hard time understanding this. I'm really slow in understanding things.

      Quote
      How did you launch this batch file?

      That's why powershell was added. Because every time I run, call or launch a batch file I can used either cmd prompt or windows powershell right? I saved the bat file to the desktop.

      You said:
      Quote
      This error message from unknown's post is something that may be related to pasting batch code into a cmd prompt.

      That is why I asked if the batch processing is strict with the white spaces. Because I got that "Invalid attempt to call batch label outside of batch script." And thought of maybe the pasting did that and white spaces has something to do with it.
       

      _unknown_

        Topic Starter


        Beginner

        • Experience: Beginner
        • OS: Windows 7
        Re: Subtract images in batch process(leap year and regular year)
        « Reply #69 on: January 18, 2015, 03:49:56 AM »
        Here is what I propose.
        1) Tell us where to download the software you use and tell us how to install and configure it.
        2) Post a full compliment of test files that will handle every scenario on dropbox for us to test with.
        3) Explain in exact detail what folder you have your input files in.
        4) Explain in exact detail what folder the output files need to go into.
        5) Explain in exact detail what folder the processed files need to go into.
        6) Explain in exact detail how the program works for processing just a single file. Use one of the test files you provided as an example.
        7) Explain in exact detail what your expected output should be based on the test files you have provided us.

        If anyone else feels I have left anything out for this testing scenario please add to the list.

        Thanks squashman for this proposal but that would be too much. Honestly, I really want to learn. I want to help myself. I want to be like you here. Creating codes for you was that simple. I want to figure out what was the error, what should I do but I really just can't do it  maybe I'm just really dumb.  :'(

        _unknown_

          Topic Starter


          Beginner

          • Experience: Beginner
          • OS: Windows 7
          Re: Subtract images in batch process(leap year and regular year)
          « Reply #70 on: January 18, 2015, 04:28:17 AM »
          This is untested - it displays the command to the screen only.

          It is right then you can thank Squashman for supplying the meat of the batch file on the 3rd post in this thread.


          Yes. The code only displays the command to the screen only. Which says the file matches with this file. But never executed the calculation.

          Squashman



            Specialist
          • Thanked: 134
          • Experience: Experienced
          • OS: Other
          Re: Subtract images in batch process(leap year and regular year)
          « Reply #71 on: January 18, 2015, 01:03:45 PM »
          Thanks squashman for this proposal but that would be too much. Honestly, I really want to learn. I want to help myself. I want to be like you here. Creating codes for you was that simple. I want to figure out what was the error, what should I do but I really just can't do it  maybe I'm just really dumb.  :'(
          We have basically spoon fed you basically everything.  I am not sure how you are learning. I am sure you have heard the saying, "give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime".

          Squashman



            Specialist
          • Thanked: 134
          • Experience: Experienced
          • OS: Other
          Re: Subtract images in batch process(leap year and regular year)
          « Reply #72 on: January 18, 2015, 01:04:35 PM »
          Yes. The code only displays the command to the screen only. Which says the file matches with this file. But never executed the calculation.
          Correct.  And since you said you wanted to learn, tell me why it did not execute the command and only displayed it on the screen.

          _unknown_

            Topic Starter


            Beginner

            • Experience: Beginner
            • OS: Windows 7
            Re: Subtract images in batch process(leap year and regular year)
            « Reply #73 on: January 18, 2015, 08:22:48 PM »
            We have basically spoon fed you basically everything.  I am not sure how you are learning. I am sure you have heard the saying, "give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime".

            Yeah I've heard that saying. Thank you!

            _unknown_

              Topic Starter


              Beginner

              • Experience: Beginner
              • OS: Windows 7
              Re: Subtract images in batch process(leap year and regular year)
              « Reply #74 on: January 18, 2015, 08:34:25 PM »
              Correct.  And since you said you wanted to learn, tell me why it did not execute the command and only displayed it on the screen.

              Yes I really want to. Maybe because it's missing some command?A command which will make it execute? And it just call the ordinal date and echoed that is why it was displayed only on the screen.