Search Results

Search found 246 results on 10 pages for 'nicholas quirk'.

Page 2/10 | < Previous Page | 1 2 3 4 5 6 7 8 9 10  | Next Page >

  • [JavaScript-CSS-Firefox] Cannot change borderColor of TD

    - by Tadeus Prastowo
    Using JS to set the background color of a TD is fine. But, setting the border color is problematic in FF 3.0.18 although IE 6 doesn't experience this. FF is problematic in that it requires the TD element to have an attribute style initialized to border-style: solid. Without that, setting border color of a TD won't work. Is this known bug? How do I set the border color without having to set style attribute as well as the initialization value? I know another trick of setting the class attribute instead of setting the border color directly. Is this an indication that somehow TD hates having its border color set dynamically? Is this known as well? The problematic code is below (the goal is find out why setting the border color of simple truth 1 does not work while simple truth 3 works when I employ the trick described above): <html> <head> <title>Quirks FF 3.0.18</title> <style type="text/css"> table { border-collapse: collapse; } </style> <script type="text/javascript"> function changeBgColor() { document.getElementById('simple').style.backgroundColor='yellow'; document.getElementById('simple2').style.backgroundColor='yellow'; document.getElementById('simple3').style.backgroundColor='yellow'; } function quirk(id) { var x = document.getElementById(id); x.style.border = '2px solid red'; } </script> </head> <body> <input type="button" onclick="changeBgColor()" value="Change background color"/> <input type="button" onclick="quirk('simple')" value="Change border color 1"/> <input type="button" onclick="quirk('simple2')" value="Change border color 2"/> <input type="button" onclick="quirk('simple3')" value="Change border color 3"/> <table> <tr><td id="simple">Simple truth 1</td></tr> </table> <table> <tr><td><span id="simple2">Simple truth 2</span></td></tr> <table> <tr><td id="simple3" style="border-style: solid">Simple truth 3</td></tr> </table> </body> </html>

    Read the article

  • Cannot change borderColor of TD

    - by Tadeus Prastowo
    Using JS to set the background color of a TD is fine. But, setting the border color is problematic in FF 3.0.18 although IE 6 doesn't experience this. FF is problematic in that it requires the TD element to have an attribute style initialized to border-style: solid. Without that, setting border color of a TD won't work. Is this known bug? How do I set the border color without having to set style attribute as well as the initialization value? I know another trick of setting the class attribute instead of setting the border color directly. Is this an indication that somehow TD hates having its border color set dynamically? Is this known as well? The problematic code is below (the goal is find out why setting the border color of simple truth 1 does not work while simple truth 3 works when I employ the trick described above): <html> <head> <title>Quirks FF 3.0.18</title> <style type="text/css"> table { border-collapse: collapse; } </style> <script type="text/javascript"> function changeBgColor() { document.getElementById('simple').style.backgroundColor='yellow'; document.getElementById('simple2').style.backgroundColor='yellow'; document.getElementById('simple3').style.backgroundColor='yellow'; } function quirk(id) { var x = document.getElementById(id); x.style.border = '2px solid red'; } </script> </head> <body> <input type="button" onclick="changeBgColor()" value="Change background color"/> <input type="button" onclick="quirk('simple')" value="Change border color 1"/> <input type="button" onclick="quirk('simple2')" value="Change border color 2"/> <input type="button" onclick="quirk('simple3')" value="Change border color 3"/> <table> <tr><td id="simple">Simple truth 1</td></tr> </table> <table> <tr><td><span id="simple2">Simple truth 2</span></td></tr> <table> <tr><td id="simple3" style="border-style: solid">Simple truth 3</td></tr> </table> </body> </html>

    Read the article

  • Eclipse Check for Updates issue

    - by Nicholas Ryan Bowers
    I install Eclipse from the Software Center so it links up and will be updated with the rest of my software. Because I am developing for Android, however, I have to install the ADT Plugin within Eclipse by going to Help Install new software (or something to that effect). Now, I do understand that I can update Eclipse through the actual Ubuntu software center/system, but in order to update plugins and extensions within Eclipse, I have to go to Help Check for Updates (which then scans all plugins for updates). The only issue, is that when I installed through the software center, the owner became root, and whenever I run it without root, I'm not able to update - I get the error message "Insufficient access privileges to apply this update." When I run it as root, all of my plugins disappear, because I guess I installed them as myself, not as root. I tried to install the plugins as root, but the Install New Software choice would not work. Ubuntu 12.04 and Eclipse 3.7.2-1

    Read the article

  • Installing missing package that provides Xm/Xm.h

    - by Nicholas Kinar
    I'm compiling a software package that requires a header file. The header file is missing from my Ubuntu 11.10 (64-bit) installation. During the compilation using make, gcc and gfortran, I receive the following error message. XMstr.c:7:19: fatal error: Xm/Xm.h: No such file or directory Googling for an answer leads me to believe that a MESA library needs to be installed on my system, but I can't find an exact match for the package name. What might be the name of the package that I need to install? Does the package have the same name on more recent Ubuntu distros?

    Read the article

  • Pygame Import Error, Python 3.2

    - by Treb Nicholas
    I'm having an issue with the Pygame module. I run Python 3.2 and installed the respective Pygame file, but now when I try to import it in the IDLE, it gives me this error: import pygame Traceback (most recent call last): File "", line 1, in import pygame File "C:\Python32\lib\site-packages\pygame__init__.py", line 95, in from pygame.base import * ImportError: DLL load failed: %1 is not a valid Win32 application. Any help will be appreciated.

    Read the article

  • Pidgin doesn't show buddy list?

    - by Nicholas Flynt
    I like to use pidgin instead of Empathy because I'm used to it, and because I have to venture into windows for more development than I would prefer. In Ubuntu 11.10, I can't find any way to get to the buddy list. It opens, and just sits there in the messenger panel tray thing. From its previous behavior, I believe Pidgin usually starts up minimized-- you have to click on its system tray to show the buddy list. The messenger applet does not seem to support this functionality. Is this a bug, or am I just missing something obvious?

    Read the article

  • Author has inserted copyright into code with gnu public license notice - implications?

    - by Nicholas Pickering
    I've found a project on Github that I'm interested in contributing to which claims to be open source and has a GPL license included with it. But the original author has added a copyright notification to each source file. I'm not sure why but I don't feel right contributing to a project that's always going to have someone else's name on it. It really breaks the community-created feel, and makes me uneasy about what the author might choose to do with the project next. What are the implications of copyrighting open source GPL code as so? What power does this give the original author over a contributor? # Copyright (C) 2012, 2013 __AUTHORNAME__ # This file is part of __PROJECTNAME__. # # __PROJECTNAME__ is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # __PROJECTNAME__ is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License

    Read the article

  • 12.10 x64 - RTL8188CE - Intermittent/Slow Internet Connection

    - by Nicholas Ryan Bowers
    I have to reset my internet connection often to get it to work. When it does work, it's definitely slower than when I'm on my Windows installation. My computer uses an RTL8188CE wireless card from Realtek. I'm running the 64-bit version of Ubuntu 12.10. Power management is not on. I've read on other sites that some people fixed the issue pertaining to this wireless card by downloading and installing the drivers from the Realtek site, but it seems as if that only helped people with 32-bit installations. Anyone have any luck with this specific wireless card?

    Read the article

  • Designing binary operations(AND, OR, NOT) in graphs DB's like neo4j

    - by Nicholas
    I'm trying to create a recipe website using a graph database, specifically neo4j using spring-data-neo4j, to try and see what can be done in Graph Databases. My model so far is: (Chef)-[HAS_INGREDIENT]->(Ingredient) (Chef)-[HAS_VALUE]->(Value) (Ingredient)-[HAS_INGREDIENT_VALUE]->(Value) (Recipe)-[REQUIRES_INGREDIENT]->(Ingredient) (Recipe)-[REQUIRES_VALUE]->(Value) I have this set up so I can do things like have the "chef" enter ingredients they have on hand, and suggest recipes, as well as suggest recipes that are close matches, but missing one ingredient. Some recipes can get complex, utilizing AND, OR, and NOT type logic, something like (Milk AND (Butter OR spread OR (vegetable oil OR olive oil))) and I'm wondering if it would be sane to model this in a graph using a tree type representation? An example of what I was thinking is to create three "node" types of AND, OR, and NOT and have each of them connect to the nodes value underneath. How else might this be represented in a Graph Database or is my example above a decent representation?

    Read the article

  • Smooth Camera Rotation around 90 degrees

    - by Nicholas
    I'm developing a third person 3D platformer in XNA. My problem is when I try to rotate the camera around the player. I would like to rotate (and animate) the camera 90 degrees around the player. So the camera should rotate until it has reached 90 degrees from the starting position. I cannot figure out how to keep track of the rotation, and when the rotation has made the full 90 degrees. Currently my cameras update: public void Update(Vector3 playerPosition) { if (rotateCamera) { position = Vector3.Transform(position - playerPosition, Matrix.CreateRotationY(0.1f)) + playerPosition; } this.viewMatrix = Matrix.CreateLookAt(position, playerPosition, Vector3.Up); } The initial position of the camera is set in the constructor. The "rotateCamera" bool is set on keypress. Thanks for the help in advance. Cheers.

    Read the article

  • I Installed Ubuntu 12.04 on a dell Inspiron 1501 along side windows vista using the windows installer but it wont boot into Ubuntu

    - by Nicholas
    I Installed Ubuntu 12.04 on a dell Inspiron 1501 with an AMD 64 along side windows vista using the windows installer but it wont boot into Ubuntu. It shows that Ubuntu is on the system when my computer boots up but when I select it to load it goes into a black screen and displays some error messages and tells me that the is no operating system installed. this is the error that i get: Try (hdo, 0):FAT16:no WUBILDR try (hdo, 1)NTFS: error: "Prefix" is not set. symbol not found:'grub_file_get_device_name' Aborted. Broadcom UNDI PXE-2.1 V2-1.0 copyright (c) 2000-2006 Broadcom corporation copyright (c) 1997-2000 Intel corporation All rights reserved PXE-EC8:PXE structure was not found in UNDI driver code segment. PXE-M0F Broadcom PXE Rom Operating system not found How can I fix this? I have tryed re-installing it but i get the same error.

    Read the article

  • Functional/nonfunctional requirements VS design ideas

    - by Nicholas Chow
    Problem domain Functional requirements defines what a system does. Non-Functional requirements defines quality attributes of what the system does as a whole.(performance, security, reliability, volume, useability, etc.) Constraints limits the design space, they restrict designers to certain types of solutions. Solution domain Design ideas , defines how the system does it. For example a stakeholder need might be we want to increase our sales, therefore we must improve the usability of our webshop so more customers will purchase, a requirement can be written for this. (problem domain) Design takes this further into the solution domain by saying "therefore we want to offer credit card payments in addition to the current prepayment option". My problem is that the transition phase from requirement to design seems really vague, therefore when writing requirements I am often confused whether or not I incorporated design ideas in my requirements, that would make my requirement wrong. Another problem is that I often write functional requirements as what a system does, and then I also specify in what timeframe it must be done. But is this correct? Is it then a still a functional requirement or a non functional one? Is it better to seperate it into two distinct requirements? Here are a few requirements I wrote: FR1 Registration of Organizer FR1 describes the registration of an Organizer on CrowdFundum FR1.1 The system shall display a registration form on the website. FR1.2 The system shall require a Name, Username, Document number passport/ID card, Address, Zip code, City, Email address, Telephone number, Bank account, Captcha code on the registration form when a user registers. FR1.4 The system shall display an error message containing: “Registration could not be completed” to the subscriber within 1 seconds after the system check of the registration form was unsuccessful. FR1.5 The system shall send a verification email containing a verification link to the subscriber within 30 seconds after the system check of the registration form was successful. FR1.6 The system shall add the newly registered Organizer to the user base within 5 seconds after the verification link was accessed. FR2 Organizer submits a Project FR2 describes the submission of a Project by an Organizer on CrowdFundum - FR2 The system shall display a submit Project form to the Organizer accounts on the website.< - FR2.3 The system shall check for completeness the Name of the Project, 1-3 Photo’s, Keywords of the Project, Punch line, Minimum and maximum amount of people, Funding threshold, One or more reward tiers, Schedule of when what will be organized, Budget plan, 300-800 Words of additional information about the Project, Contact details within 1 secondin after an Organizer submits the submit Project form. - FR2.8 The system shall add to the homepage in the new Projects category the Project link within 30 seconds after the system made a Project webpage - FR2.9 The system shall include in the Project link for the homepage : Name of the Project, 1 Photo, Punch line within 30 seconds after the system made a Project webpage. Questions: FR 1.1 : Have I incorporated a design idea here, would " the system shall have a registration form" be a better functional requirement? F1.2 ,2.3 : Is this not singular? Would the conditions be better written for each its own separate requirement FR 1.4: Is this a design idea? Is this a correct functional requirement or have I incorporated non functional(performance) in it? Would it be better if I written it like this: FR1 The system shall display an error message when check is unsuccessful. NFR: The system will respond to unsuccesful registration form checks within 1 seconds. Same question with FR 2.8 and 2.9. FR2.3: The system shall check for "completeness", is completeness here used ambigiously? Should I rephrase it? FR1.2: I added that the system shall require a "Captcha code" is this a functional requirement or does it belong to the "security aspect" of a non functional requirement. I am eagerly waiting for your response. Thanks!

    Read the article

  • Software requirements specification, please help!

    - by Nicholas Chow
    For a school project, I had to create a SRS for a "fictional" application. However they did not show us what it exactly entails, and were very vague with explanations. The SRS asked of us has to have at least 5 functional requirements, 5 non functional requirements and 1 constraint. Now I have tried my best to make one however I think there are still a lot of mistakes in it. Could you all please look at it and provide me with some feedback on which parts I can improve or just tell me which parts are plain out wrong and how to make it better? (The project has a maximum of 12 pages so it is a bit long, I will post it below. FR1 Registration of Organizer FR1 describes the registration of an Organizer on CrowdFundum FR1.1 The system shall display a registration form on the website. FR1.2 The system shall require a Name, Username, Document number passport/ID card, Address, Zip code, City, Email address, Telephone number, Bank account, Captcha code on the registration form when a user registers.

    Read the article

  • Why are you doing this? [closed]

    - by NIcholas Lawson
    I am working on a story that I am going to be querying to several magazines in my hometown about this work that is being done by the AXR group. This is a group of people who have networked online and are working on developing a higher level syntax structure than CSS and HTML currently offer. I am covering this is as a story because I see potential in this as a human interest story in cosmopolitan society. I have been asked by the group to pose this question to you and would appreciate any and all comments you would have on the following ... To AXR: So when does the internet become finished? At what point does a computer scientist say to himself ... my job here is finished ... the internet is complete? When is the internet ready to be more about the display of content than the uploading of new websites or computer tech? You are embarking on upon a sixty year project every day you work with this internet, what drives you? Why are you spending your hard earned hours working on the code to this computer? I spend thirty hours a week online because I love the writing and I know what would make the internet better ... ease of use ... i know it is difficult to program but I see some very elegant solutions online ... in this early inception phase of your programming development for this HSS prototype ... I would like to know why I do not see you programmers asking questions such as ... What would make the end user's life the easiest when using this code? I know you can solve the problem but an evolution forward would be simple, not simple to a computer scientist but simple to use for a career janitor ... if you could solve the problem of alleviating the stress at using a the computer you could get better content out of the computer ... right now the main problem is that the best content is in the hands of the people least likely to use the computer and the more simple you make the computer to use ... the better the content collection will be in the long run ... That is not what I want to talk about though ... why are you writing code when you could be writing stories? I know the computer is worthless without content so I build content, I know the book is worthless without the combinations of words in them, i know the television is worthless without the television news anchor or the actor, what I want to know from you folks in a very journalistic sense is why are you even bothering to bother to write code for a machine that has only made our lives i would dare say less interesting. why are you feeding the beast your time when you could be writing stories or being an actor or musician or auto mechanic ... why code? why this machine? what do you love about it? what do you hate about it? what do you wonder about it? I want to know so that starting out I know how to further shape my questions with axr ... i want the full story ... i want the real answers ... and i want to know why you are doing this, it would make for great writing if you could elucidate on this point.

    Read the article

  • How can I use WebGL to create a tile-based multi-layer scrolling platform game?

    - by Nicholas Hill
    I've found WebGL (based on OpenGL) to be a fiendish and unforgiving framework for those learning to write HTML5-based games. Despite the presence of many examples on how to get started, I'm really struggling to understand how I could simply load a bunch of images and render them to a canvas quickly using WebGL. My specific scenario involves trying to render a map using a bespoke but simple multi-layered tile engine, where each value in a three dimensional array points to the image to use for that location in the rendered image. Think "Sonic the Hedgehog" via tilesets, tiles, maps, layers, sprites etc. Can anyone enlighten me: 1) How can I load an image that I can use as a texture in WebGL? 2) How can I dynamically select an image at run time and draw it at any co-ordinate, that I also select at run time?

    Read the article

  • Tunnels in pseudo 3D racing game

    - by Nicholas
    How would one go about doing tunnels in a pseudo 3D racing game ? The main problem I have at the moment is perspective - I cant think of a way, beyond having to Z sort the sprites and tunnel coordinates, so that vehicles are displayed in front of the tunnel entrance and somehow block the display when out of site. I would like my tunnels to be used on both flat, curved and hills and slopes. The tunnel enterance/exit is made up of 3 separate graphics, (left, right and top), whilst inside the tunnel it is just one line graphic along the top (the idea being its supposed to be a set distance above the current vertical road position). As you can see from the picture, the vehicles are still being rendered whilst in the tunnel. I've converted the Code Incomplete road system to GLBasic.

    Read the article

  • Functional vs. Non-Functional Requirements vs Design ideas in an SRS

    - by Nicholas Chow
    For a school project, I had to create a SRS for a "fictional" application. However they did not show us what it exactly entails, and were very vague with explanations. The SRS asked of us has to have at least 5 functional requirements, 5 non functional requirements and 1 constraint. Now I have tried my best to make one however I there are still some uncertainties left, I hope you experts can tell me whether or not I am thinking in the right direction. I will keep on updating this posts as I have questions regarding requirements that are vague to me, thank you all in advance for making SRS more clear for me FR1 Registration of Organizer FR1 describes the registration of an Organizer on CrowdFundum FR1.1 The system shall display a registration form on the website. FR1.2 The system shall require a Name, Username, Document number passport/ID card, Address, Zip code, City, Email address, Telephone number, Bank account, Captcha code on the registration form when a user registers. FR1.3 The system shall check whether the Name, Username, Document number passport/ID card, Address, Zip code, City, Email address, Telephone number, Bank account, Captcha code are filled out correctly within 1 seconds after a user submits the registration form. FR1.4 The system shall display an error message containing: “Registration could not be completed” to the subscriber within 1 seconds after the system check of the registration form was unsuccessful. FR1.5 The system shall send a verification email containing a verification link to the subscriber within 30 seconds after the system check of the registration form was successful. FR1.6 The system shall add the newly registered Organizer to the user base within 5 seconds after the verification link was accessed. Questions: FR1.1 Is this a functional requirement, or have I incorporated design idea in it by using "shall display on website". If so what would be a better way to write it? FR1.2 Is this better written in one requirement, or should I write each condition as a seperate requirement? FR1.3-1.5 Are these functional requirements or did I mix some non functional elements in it? How is it better phrased? FR1.3-1.6 Are these all correct functional requirements? As in free of ambiguity, complete, implementation free etc.

    Read the article

  • Can WebGL be used to create a tile-based multi-layer scrolling platform game?

    - by Nicholas Hill
    I've found WebGL (based on OpenGL) to be a fiendish and unforgiving framework for those learning to write HTML5-based games. Despite the presence of many examples on how to get started, I'm really struggling to understand how I could simply load a bunch of images and render them to a canvas quickly using WebGL. My specific scenario involves trying to render a map using a bespoke but simple multi-layered tile engine, where each value in a three dimensional array points to the image to use for that location in the rendered image. Think "Sonic the Hedgehog" via tilesets, tiles, maps, layers, sprites etc. Can anyone enlighten me: 1) How can I load an image that I can use as a texture in WebGL? 2) How can I dynamically select an image at run time and draw it at any co-ordinate, that I also select at run time?

    Read the article

  • Given two sets of DNA, what does it take to computationally "grow" that person from a fertilised egg and see what they become? [closed]

    - by Nicholas Hill
    My question is essentially entirely in the title, but let me add some points to prevent some "why on earth would you want to do that" sort of answers: This is more of a mind experiment than an attempt to implement real software. For fun. Don't worry about computational speed or the number of available memory bytes. Computers get faster and better all of the time. Imagine we have two data files: Mother.dna and Father.dna. What else would be required? (Bonus point for someone who tells me approx how many GB each file will be, and if the size of the files are exactly the same number of bytes for everyone alive on Earth!) There would ideally need to be a way to see what the egg becomes as it becomes a human adult. If you fancy, feel free to outline the design. I am initially thinking that there'd need to be some sort of volumetric voxel-based 3D environment for simulation purposes.

    Read the article

  • System beeps on shutdown

    - by Nicholas Smith
    Very recently a couple of our systems have started making beeps on shutdown, we've not been able to isolate the exact time that they've been updated and it's occuring, but I've narrowed it down to being not pcspkr or snd_pcsp as both are blacklisted under modprobe, and rmmod'ed just to be sure. Now I'm a bit puzzled as I was under the impression those were the only two modules that could make the beep, is there a third lurking that I need to blacklist? Edit: I've copied the results of lsmod over on Pastebin.

    Read the article

  • Microformats, Reviews and Duplicate Content

    - by Nicholas
    Let's say I have a site that sells widgets, and the URL structure is like so: /[type-of-widget]/[sub-type]/[widget-name]/ So, a URL for a widget might be: /screwdrivers/philips-screwdrivers/acme-big-screwdriver/ We show reviews on the widget page, and use the appropriate microformat data so Google knows it's a review, etc. Now, what if I want to show random reviews in the "sub-type" and "type-of-widget" landing pages? Will Google ding me for duplicate content, or is it smart enough to know (based on microformat data/etc.) that this is not duplicate content?

    Read the article

  • How can I choose which menubar indicators are shown in 12.04?

    - by Nicholas Weininger
    I'd like to be able to tweak the set of shortcuts on the right side of the menubar in 12.04 (e.g. remove the email shortcut, remove the wifi shortcut on my laptop, add a lock screen shortcut so I can lock the screen with a single click rather than facing the choice between two clicks and Ctrl-Alt-L). Is this possible? The only thing I can find to configure in the settings is the date/time display.

    Read the article

  • Python/Tkinter Audio Player

    - by Nicholas Quirk
    Hey everyone reading this, I've recently got into doing GUI development with Python. Tkinter seems like the easiest and most logical choice starting out. I did a little with wxPython but it was more sophisticated than what I needed. Anyway, I'm developing a media player. Right now it's a simple window with a button to load .wav files. The problem is I would like to implement a pause button now. But, when playing a audio file the GUI isn't accessible again (no buttons can be pushed) till the file is done playing. How can I make the GUI dynamic while an audio file is playing? I was thinking this maybe be because I'm using PyAudio, and their implementation doesn't allow this. Anyway, thanks for any advice before hand.

    Read the article

  • C++: Calculate probability percentage during each iteration

    - by Mur Quirk
    Can't seem to get this to work. The idea is to calculate the percentage of heads and tails after each count, accumulating after each iteration. Except I keep getting nan% for my calculations. Anybody see what I'm doing wrong? void flipCoin(time_t seconds, int flipCount){ vector<int> flips; float headCount = 0; float tailCount = 0; double headProbability = double((headCount/(headCount + tailCount))*100); double tailProbability = double((tailCount/(headCount + tailCount))*100); for (int i=0; i < flipCount; i++) { int flip = rand() % (HEADS - TAILS + 1) + TAILS; flips.push_back(flip); if (flips[i] == 1) { tailCount++; cout << "Tail Percent: " << tailProbability << "%" << endl; }else{ headCount++; cout << "Head Percent: " << headProbability << "%" << endl; } } }

    Read the article

  • Why do I get rows of zeros in my 2D fft?

    - by Nicholas Pringle
    I am trying to replicate the results from a paper. "Two-dimensional Fourier Transform (2D-FT) in space and time along sections of constant latitude (east-west) and longitude (north-south) were used to characterize the spectrum of the simulated flux variability south of 40degS." - Lenton et al(2006) The figures published show "the log of the variance of the 2D-FT". I have tried to create an array consisting of the seasonal cycle of similar data as well as the noise. I have defined the noise as the original array minus the signal array. Here is the code that I used to plot the 2D-FT of the signal array averaged in latitude: import numpy as np from numpy import ma from matplotlib import pyplot as plt from Scientific.IO.NetCDF import NetCDFFile ### input directory indir = '/home/nicholas/data/' ### get the flux data which is in ### [time(5day ave for 10 years),latitude,longitude] nc = NetCDFFile(indir + 'CFLX_2000_2009.nc','r') cflux_southern_ocean = nc.variables['Cflx'][:,10:50,:] cflux_southern_ocean = ma.masked_values(cflux_southern_ocean,1e+20) # mask land nc.close() cflux = cflux_southern_ocean*1e08 # change units of data from mmol/m^2/s ### create an array that consists of the seasonal signal fro each pixel year_stack = np.split(cflux, 10, axis=0) year_stack = np.array(year_stack) signal_array = np.tile(np.mean(year_stack, axis=0), (10, 1, 1)) signal_array = ma.masked_where(signal_array > 1e20, signal_array) # need to mask ### average the array over latitude(or longitude) signal_time_lon = ma.mean(signal_array, axis=1) ### do a 2D Fourier Transform of the time/space image ft = np.fft.fft2(signal_time_lon) mgft = np.abs(ft) ps = mgft**2 log_ps = np.log(mgft) log_mgft= np.log(mgft) Every second row of the ft consists completely of zeros. Why is this? Would it be acceptable to add a randomly small number to the signal to avoid this. signal_time_lon = signal_time_lon + np.random.randint(0,9,size=(730, 182))*1e-05 EDIT: Adding images and clarify meaning The output of rfft2 still appears to be a complex array. Using fftshift shifts the edges of the image to the centre; I still have a power spectrum regardless. I expect that the reason that I get rows of zeros is that I have re-created the timeseries for each pixel. The ft[0, 0] pixel contains the mean of the signal. So the ft[1, 0] corresponds to a sinusoid with one cycle over the entire signal in the rows of the starting image. Here are is the starting image using following code: plt.pcolormesh(signal_time_lon); plt.colorbar(); plt.axis('tight') Here is result using following code: ft = np.fft.rfft2(signal_time_lon) mgft = np.abs(ft) ps = mgft**2 log_ps = np.log1p(mgft) plt.pcolormesh(log_ps); plt.colorbar(); plt.axis('tight') It may not be clear in the image but it is only every second row that contains completely zeros. Every tenth pixel (log_ps[10, 0]) is a high value. The other pixels (log_ps[2, 0], log_ps[4, 0] etc) have very low values.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10  | Next Page >